Commit 8d576118 authored by incardon's avatar incardon

Fixing CUDA util

parent 77fc4055
......@@ -103,7 +103,7 @@ namespace openfpm
auto ite = v.getGPUIterator();
merge_add_prp_device_impl<decltype(v.toKernel()),decltype(this_.toKernel()),args...><<<ite.wthr,ite.thr>>>(v.toKernel(),this_.toKernel(),(unsigned int)old_sz);
CUDA_LAUNCH((merge_add_prp_device_impl<decltype(v.toKernel()),decltype(this_.toKernel()),args...>),ite.wthr,ite.thr,v.toKernel(),this_.toKernel(),(unsigned int)old_sz);
#else
std::cout << __FILE__ << ":" << __LINE__ << " Error the function add_prp_device only work when map_vector is compiled with nvcc" << std::endl;
......@@ -135,7 +135,7 @@ namespace openfpm
auto ite = v.getGPUIterator();
merge_add_prp_device_impl<decltype(v.toKernel()),decltype(this_.toKernel()),args...><<<ite.wthr,ite.thr>>>(v.toKernel(),this_.toKernel(),(unsigned int)offset);
CUDA_LAUNCH((merge_add_prp_device_impl<decltype(v.toKernel()),decltype(this_.toKernel()),args...>),ite.wthr,ite.thr,v.toKernel(),this_.toKernel(),(unsigned int)offset);
#else
std::cout << __FILE__ << ":" << __LINE__ << " Error the function merge_prp_device only work when map_vector is compiled with nvcc" << std::endl;
......
......@@ -16,6 +16,26 @@
#ifdef CUDA_GPU
#if defined(SE_CLASS1) || defined(CUDA_CHECK_LAUNCH)
#define CUDA_LAUNCH(cuda_call,grid_size,block_size, ...) \
cuda_call<<<(grid_size),(block_size)>>>(__VA_ARGS__); \
cudaDeviceSynchronize(); \
{\
cudaError_t e = cudaGetLastError();\
if (e != cudaSuccess)\
{\
std::string error = cudaGetErrorString(e);\
std::cout << "Cuda Error in: " << __FILE__ << ":" << __LINE__ << " " << error << std::endl;\
}\
}
#else
#define CUDA_LAUNCH(cuda_call,grid_size,block_size, ...) \
cuda_call<<<(grid_size),(block_size)>>>(__VA_ARGS__);
#endif
#include "util/cuda/ofp_context.hxx"
#ifndef __NVCC__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment