| 69 | } |
| 70 | |
| 71 | void GPUVMemAllocator::DeallocateRaw(void* ptr) { |
| 72 | mutex_lock l(lock_); |
| 73 | if (device_ptrs_.count(ptr) > 0) { |
| 74 | device_allocator_->DeallocateRaw(ptr); |
| 75 | device_ptrs_.erase(ptr); |
| 76 | return; |
| 77 | } else { |
| 78 | host_allocator_->DeallocateRaw(ptr); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | size_t GPUVMemAllocator::RequestedSize(const void* ptr) const { |
| 83 | mutex_lock l(lock_); |