Commit da7bebf0 authored by incardon's avatar incardon

Fixing copy of two vectors

parent 575d1b6a
......@@ -23,10 +23,13 @@ __global__ void merge_add_prp_device_impl(vector_src_type v_src, vector_dst_type
}
template<typename vector_src_type, typename vector_dst_type>
__global__ void copy_two_vectors(vector_src_type v_src, vector_dst_type v_dst)
__global__ void copy_two_vectors(vector_src_type v_dst, vector_dst_type v_src)
{
int i = threadIdx.x + blockIdx.x * blockDim.x;
if (i >= v_src.size())
{return;}
v_src.get(i) = v_dst.get(i);
}
......
......@@ -39,6 +39,7 @@
#include "util/cuda_util.hpp"
#include "util/cuda/cuda_launch.hpp"
#include "cuda/map_vector_cuda_ker.cuh"
#include "util/cuda/cuda_launch.hpp"
namespace openfpm
{
......@@ -1318,7 +1319,7 @@ namespace openfpm
if (mv.size() != 0)
{
auto it = mv.getGPUIterator();
copy_two_vectors<<<it.wthr,it.thr>>>(toKernel(),mv.toKernel());
CUDA_LAUNCH(copy_two_vectors,it,toKernel(),mv.toKernel());
}
#endif
}
......
......@@ -17,6 +17,15 @@
#define CUDA_LAUNCH(cuda_call,ite, ...) \
{\
cudaDeviceSynchronize(); \
{\
cudaError_t e = cudaGetLastError();\
if (e != cudaSuccess)\
{\
std::string error = cudaGetErrorString(e);\
std::cout << "Cuda an error has occurred before, detected in: " << __FILE__ << ":" << __LINE__ << " " << error << std::endl;\
}\
}\
CHECK_SE_CLASS1_PRE\
cuda_call<<<ite.wthr,ite.thr>>>(__VA_ARGS__); \
cudaDeviceSynchronize(); \
......
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