| 251 | } |
| 252 | |
| 253 | Storage CUDADevice::getPtrStorage(const void* ptr) |
| 254 | { |
| 255 | cudaPointerAttributes attrib; |
| 256 | if (cudaPointerGetAttributes(&attrib, ptr) != cudaSuccess) |
| 257 | return Storage::Undefined; |
| 258 | |
| 259 | switch (attrib.type) |
| 260 | { |
| 261 | case cudaMemoryTypeHost: |
| 262 | return Storage::Host; |
| 263 | case cudaMemoryTypeDevice: |
| 264 | return Storage::Device; |
| 265 | case cudaMemoryTypeManaged: |
| 266 | return Storage::Managed; |
| 267 | default: |
| 268 | return systemMemorySupported ? Storage::Managed : Storage::Undefined; |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | void CUDADevice::wait() |
| 273 | { |
nothing calls this directly
no test coverage detected