Newer
Older
/*
* cuda_util.hpp
*
* Created on: Jun 13, 2018
* Author: i-bird
*/
#ifndef OPENFPM_DATA_SRC_UTIL_CUDA_UTIL_HPP_
#define OPENFPM_DATA_SRC_UTIL_CUDA_UTIL_HPP_
#include "config.h"
#include <cuda_runtime.h>
#endif
#ifdef CUDA_GPU
#ifndef __NVCC__
#ifndef __host__
#define __host__
#define __device__
#else
#ifndef __host__
#define __host__
#define __device__
#ifdef __shared__
#undef __shared__
#endif
cudaError_t e = cudaPeekAtLastError();\
if (e != cudaSuccess)\
{\
std::string error = cudaGetErrorString(e);\
std::cout << "Cuda Error in: " << __FILE__ << ":" << __LINE__ << " " << error << std::endl;\
}\
}
#endif
#else
#ifndef __host__
#define __host__
#define __device__
#endif
#endif
#endif /* OPENFPM_DATA_SRC_UTIL_CUDA_UTIL_HPP_ */