Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't presume pointers are mutually exclusive for device/host.
Here is the results of looking at the cudaPointerGetAttributes of different allocation types. As we can see things like cudaMallocManaged allow the same pointer to be both host and device. ``` cudaPointerGetAttributes attributes integer is_dev_ptr -> 0 is_host_ptr -> 0 cudaPointerGetAttributes attributes std::vector<int> data is_dev_ptr -> 0 is_host_ptr -> 0 cudaPointerGetAttributes attributes malloc ptr is_dev_ptr -> 0 is_host_ptr -> 0 cudaPointerGetAttributes attributes cudaMalloc ptr is_dev_ptr -> 1 is_host_ptr -> 0 cudaPointerGetAttributes attributes cudaMallocManaged cudaMemAttachGlobal ptr is_dev_ptr -> 1 is_host_ptr -> 1 cudaPointerGetAttributes attributes cudaMallocManaged cudaMemAttachHost ptr is_dev_ptr -> 1 is_host_ptr -> 1 cudaPointerGetAttributes attributes cudaMallocHost ptr is_dev_ptr -> 1 is_host_ptr -> 1 ```
- Loading branch information