static */
| 692 | } |
| 693 | |
| 694 | /* static */ bool GpuDriver::GetModuleSymbol(GpuContext* context, |
| 695 | CUmodule module, |
| 696 | const char* symbol_name, |
| 697 | CUdeviceptr* dptr, size_t* bytes) { |
| 698 | ScopedActivateContext activated{context}; |
| 699 | CHECK(module != nullptr && symbol_name != nullptr && |
| 700 | (dptr != nullptr || bytes != nullptr)); |
| 701 | CUresult res = cuModuleGetGlobal(dptr, bytes, module, symbol_name); |
| 702 | if (res != CUDA_SUCCESS) { |
| 703 | // symbol may not be found in the current module, but it may reside in |
| 704 | // another module. |
| 705 | VLOG(2) << "failed to get symbol \"" << symbol_name |
| 706 | << "\" from module: " << ToString(res); |
| 707 | return false; |
| 708 | } |
| 709 | |
| 710 | return true; |
| 711 | } |
| 712 | |
| 713 | /* static */ void GpuDriver::UnloadModule(GpuContext* context, |
| 714 | CUmodule module) { |
nothing calls this directly
no test coverage detected