| 17 | } |
| 18 | |
| 19 | SyncMem::~SyncMem() { |
| 20 | if (this->head_ != UNINITIALIZED) { |
| 21 | this->head_ = UNINITIALIZED; |
| 22 | if (own_host_data || own_device_data) total_memory_size -= size_; |
| 23 | if (host_ptr && own_host_data) { |
| 24 | free_host(host_ptr); |
| 25 | host_ptr = nullptr; |
| 26 | } |
| 27 | #ifdef USE_CUDA |
| 28 | if (device_ptr && own_device_data) { |
| 29 | CUDA_CHECK(cudaFree(device_ptr)); |
| 30 | device_ptr = nullptr; |
| 31 | } |
| 32 | #endif |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | void *SyncMem::host_data() { |
| 37 | to_host(); |
nothing calls this directly
no test coverage detected