I need to determine the memory type of raw pointers,
which have been allocated on device (cudaMalloc) or host (malloc, cudaHostMalloc).
The following snippet should have solved this according to the reference manual:
T* h_t = ... // host mem allocation, T e.g. float cudaPointerAttributes attr; cudaPointerGetAttributes(&attr, h_t); // get memory type (host/dev) from attr struct // ...
Unfortunately I get an “invalid argument” error in line 2.
Any proposals on how to solve/achieve this?