static */
| 834 | } |
| 835 | |
| 836 | /* static */ void GpuDriver::UnifiedMemoryDeallocate(GpuContext* context, |
| 837 | void* location) { |
| 838 | ScopedActivateContext activation(context); |
| 839 | CUdeviceptr pointer = absl::bit_cast<CUdeviceptr>(location); |
| 840 | CUresult res = cuMemFree(pointer); |
| 841 | if (res != CUDA_SUCCESS) { |
| 842 | LOG(ERROR) << "failed to free unified memory at " << location |
| 843 | << "; result: " << ToString(res); |
| 844 | } else { |
| 845 | VLOG(2) << "deallocated unified memory at " << location << " for context " |
| 846 | << context->context(); |
| 847 | } |
| 848 | } |
| 849 | |
| 850 | /* static */ void* GpuDriver::HostAllocate(GpuContext* context, uint64 bytes) { |
| 851 | ScopedActivateContext activation(context); |