I want to reset (set to 0) a buffer of type unsigned int. I don’t know why but for me only the cuMemsetD8-version works. Here is my code:
CUdeviceptr pBuffer;
cuMemAlloc(&pBuffer, sizeof(unsigned int) * 1000);
cuMemsetD32(pBuffer, 0, sizeof(unsigned int) * 1000); // fails with invalid argument (range) error
The third parameter of cuMemsetD32 is the number of elements, not the number of bytes. So
it should be: