Hello everyone,
I have the following problem in my C++ code. I think it is pretty basic, but I have no clue how to avoid this:
-
I have 1D vector filled with data:
vector image; -
Then I allocate memory on GPU (works fine!).
double *d_image;
cudaMalloc(&d_image,sizeof(double)*image.size()); -
Here’s the problem:
cudaMemcpy(d_image,&image,sizeof(double)*image.size(),cudaMemcpyHostToDevice));
The error comes out:
“Unhandled exception at 0x52858b34 in 2ndcuda.exe: 0xC0000005: Access violation reading location 0x002a1000.”
How to solve this?
Michał