#ifndef RIEMANN_TRACK_FINDER_UTIL_H_ #define RIEMANN_TRACK_FINDER_UTIL_H_ /** a macro for checking CUDA calls */ #define cucheck(call) \ { \ cudaError_t cucheck_err = (call); \ if(cucheck_err != cudaSuccess) { \ const char* err_str = cudaGetErrorString(cucheck_err); \ fprintf(stderr, "%s (%d): %s in %s\n", __FILE__, __LINE__, err_str, #call); \ exit(-1); \ } \ } #ifdef __CUDACC__ #define hostdevice__ __host__ __device__ #else #define hostdevice__ #endif static inline int divup(int a, int b) { return a / b + (a % b ? 1 : 0); } #endif