HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
basic_gpu.h
Go to the documentation of this file.
1 #ifndef _BASIC_GPU_H_
2 #define _BASIC_GPU_H_
3 
4 #include <basic.h>
5 
6 #define GPU_ONE_SIXTH (1.0/6.0)
7 #define GPU_THREADS_PER_BLOCK 64
8 #define GPU_MAX_NDIMS 3
9 #define GPU_MAX_NVARS 5
10 
11 #if defined(HAVE_CUDA) && defined(__NVCC__)
12  inline
13  cudaError_t checkCuda(cudaError_t result)
14  {
15  #if defined(DEBUG) || defined(_DEBUG)
16  if (result != cudaSuccess) {
17  fprintf(stderr, "CUDA Runtime Error: %s\n", cudaGetErrorString(result));
18  assert(result == cudaSuccess);
19  }
20  #endif
21  return result;
22  }
23 #endif
24 
25 #endif /* _BASIC_GPU_H_ */
Some basic definitions and macros.