invalid device pointer freeing something I just made

I’m getting this strange problem with this code

cudaPitchedPtr d_result;

  cudaExtent extent = make_cudaExtent(4, 4, 4);

  cutilSafeCall(cudaMalloc3D(&d_result, extent));

  cutilSafeCall(cudaFree(&d_result));   //FAILS with invalid device pointer


what the hell is going on? is this a vista bug?

nevermind. I didn’t know you had to use the ptr inside the struct

which means in clear you have to write :


It would be nice to have a word about that in the documentation…