File indexing completed on 2026-07-13 08:21:03
0001 #ifndef G4HepEmCuUtils_HH
0002 #define G4HepEmCuUtils_HH
0003
0004 #ifdef G4HepEm_CUDA_BUILD
0005
0006 #include <cuda_runtime.h>
0007 #include <cstdio>
0008 #include <cstdlib>
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #define gpuErrchk(ans) { cuAssert((ans), __FILE__, __LINE__); }
0020 inline void cuAssert(cudaError_t code, const char *file, int line, bool abort=true){
0021 if (code != cudaSuccess) {
0022 fprintf(stderr,"CUAassert: %s %s %d\n",
0023 cudaGetErrorString(code), file, line);
0024 if (abort) exit(code);
0025 }
0026 }
0027
0028 #endif
0029
0030 #endif