I’m trying to copy some memory over to the device, but I’m having some trouble with larger vectors, the following vectors works perfectly:
thrust::device_vector<unsigned int> data = std::vector<unsigned int>(115200); // smaller size
But this one does not:
thrust::device_vector<unsigned int> data = std::vector<unsigned int>(1152000); // (roughly 5 MB worth of data)
When I get a pointer from the larger vector (thrust::raw_pointer_cast
) and use it in a kernel like this I get an access violation error after the kernel finishes running, the smaller vector works just fine.
__global__ void Kernel(unsigned int* data) {
printf("%u\n", data[0]);
}
Is there perhaps a size limit on device vectors, or is the size type overflowing?
Any advice is greatly appreciated!