#ifndef UTIL_H_ #define UTIL_H_ /** @file util.h various utility functions and macros */ #include #include #include #include using namespace std; #include "event-point.h" /** CUDA check macro */ #define cucheck(call) \ {\ cudaError_t res = (call);\ if(res != cudaSuccess) {\ const char* err_str = cudaGetErrorString(res);\ fprintf(stderr, "%s (%d): %s in %s", __FILE__, __LINE__, err_str, #call); \ exit(-1);\ }\ } /** upward-roudning division for positive divisors */ inline int divup(int a, int b) { return a / b + (a % b ? 1 : 0); } /** a function to read event point data from a file */ vector read_events(const char* path); #endif