static */
| 762 | } |
| 763 | |
| 764 | /* static */ void GpuDriver::DestroyStream(GpuContext* context, |
| 765 | CUstream* stream) { |
| 766 | if (*stream == nullptr) { |
| 767 | return; |
| 768 | } |
| 769 | |
| 770 | ScopedActivateContext activated{context}; |
| 771 | CUresult res = cuStreamDestroy(*stream); |
| 772 | if (res != CUDA_SUCCESS) { |
| 773 | LOG(ERROR) << "failed to destroy CUDA stream for context " |
| 774 | << context->context() << ": " << ToString(res); |
| 775 | } else { |
| 776 | VLOG(2) << "successfully destroyed stream " << *stream << " for context " |
| 777 | << context->context(); |
| 778 | *stream = nullptr; |
| 779 | } |
| 780 | } |
| 781 | |
| 782 | /* static */ void* GpuDriver::DeviceAllocate(GpuContext* context, |
| 783 | uint64 bytes) { |