MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / LoadModule

Method LoadModule

tensorflow/stream_executor/rocm/rocm_gpu_executor.cc:402–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402port::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
423port::Status GpuExecutor::LoadModuleFromCuBin(const char* cubin,
424 hipModule_t* module) {

Callers

nothing calls this directly

Calls 5

ModuleHandleClass · 0.85
cuda_cubin_in_memoryMethod · 0.80
InternalErrorFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected