Hi all.
I allocated a host memory by used cudaHostAlloc() and the flag is cudaHostAllocMapped
cudaSetDeviceFlags(cudaDeviceMapHost);
cudaSetDevice(0);
float hostData = NULL;
cudaHostAlloc((void*) &hostData, allocateSize, cudaHostAllocMapped | cudaHostAllocWriteCombined);
and then get device pointer.
void * devPtr;
cudaHostGetDevicePointer(&devPtr, hostData, 0);
finally I tried to bind with my texture
texture<float, 1, cudaReadModeElementType> textureRef;
cudaBindTexture(0, textureRef, devPtr, allocateSize);
printf(“CUDA cudaBindTexture: %s\n”, cudaGetErrorString(cudaGetLastError()));
the error return is “invalid device pointer”.
Does anyone success in binding texture to a host mapped memory, please help me.
thank you.
Vinh!