static */
| 803 | } |
| 804 | |
| 805 | /* static */ void GpuDriver::DeviceDeallocate(GpuContext* context, |
| 806 | void* location) { |
| 807 | ScopedActivateContext activation(context); |
| 808 | CUdeviceptr pointer = absl::bit_cast<CUdeviceptr>(location); |
| 809 | CUresult res = cuMemFree(pointer); |
| 810 | if (res != CUDA_SUCCESS) { |
| 811 | LOG(ERROR) << "failed to free device memory at " << location |
| 812 | << "; result: " << ToString(res); |
| 813 | } else { |
| 814 | VLOG(2) << "deallocated " << location << " for context " |
| 815 | << context->context(); |
| 816 | } |
| 817 | } |
| 818 | |
| 819 | /* static */ void* GpuDriver::UnifiedMemoryAllocate(GpuContext* context, |
| 820 | uint64 bytes) { |