OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
cuda_macro.h
1 /*
2  * cuda_macro.h
3  *
4  * Created on: Aug 17, 2014
5  * Author: Pietro Incardona
6  */
7 
8 #include <iostream>
9 
10 #if defined(__HIP__)
11 
12 #define CUDA_SAFE_CALL(call) {\
13  hipError_t err = call;\
14  if (hipSuccess != err) {\
15  std::cerr << "HIP error in file "<< __FILE__ << " in line " << __LINE__ << ": " << hipGetErrorString(err);\
16  }\
17 }
18 
19 #elif defined(CUDA_GPU)
20 
21 #define CUDA_SAFE_CALL(call) {\
22  cudaError_t err = call;\
23  if (cudaSuccess != err) {\
24  std::cerr << "Cuda error in file "<< __FILE__ << " in line " << __LINE__ << ": " << cudaGetErrorString(err);\
25  }\
26 }
27 
28 #endif
29 
30