| 400 | } |
| 401 | |
| 402 | port::Status GpuExecutor::LoadModule(const MultiModuleLoaderSpec& spec, |
| 403 | ModuleHandle* module_handle) { |
| 404 | // In GpuExecutor we store the pointer to the HSACO binary as |
| 405 | // ModuleHandle::id(). |
| 406 | hipModule_t hip_module = nullptr; |
| 407 | // TODO(ROCm): Need generic term instead of cubin/cuda/ptx |
| 408 | if (spec.has_cuda_cubin_in_memory()) { |
| 409 | absl::MutexLock lock{&in_memory_modules_mu_}; |
| 410 | if (!LoadModuleFromHsaco( |
| 411 | reinterpret_cast<const char*>(spec.cuda_cubin_in_memory().data()), |
| 412 | &hip_module)) { |
| 413 | return port::InternalError("Failed loading module from HSACO"); |
| 414 | } |
| 415 | *module_handle = ModuleHandle(const_cast<void*>( |
| 416 | static_cast<const void*>(spec.cuda_cubin_in_memory().data()))); |
| 417 | return port::Status::OK(); |
| 418 | } else { |
| 419 | return port::InternalError("No HASCO binary found"); |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | port::Status GpuExecutor::LoadModuleFromCuBin(const char* cubin, |
| 424 | hipModule_t* module) { |
nothing calls this directly
no test coverage detected