A pointer can be usable on the device and host at the same time. We can't invert is_dev_ptr() to check that something is a host pointer.
Here is the results of looking at the cudaPointerGetAttributes of different allocation types. As we can see things like cudaMallocManaged and cudaMallocHost allow the same pointer to be both host and device.
A pointer can be usable on the device and host at the same time. We can't invert
is_dev_ptr()
to check that something is a host pointer.Here is the results of looking at the cudaPointerGetAttributes of different allocation types. As we can see things like cudaMallocManaged and cudaMallocHost allow the same pointer to be both host and device.