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

Method Init

tensorflow/stream_executor/rocm/rocm_dnn.cc:497–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495MIOpenSupport::MIOpenSupport(GpuExecutor* parent) : parent_(parent) {}
496
497port::Status MIOpenSupport::Init() {
498 ScopedActivateExecutorContext context(parent_);
499 miopenHandle_t miopen_handle = nullptr;
500 auto status = wrap::miopenCreateWithStream(
501 reinterpret_cast<miopenHandle_t*>(&miopen_handle), (hipStream_t)(0));
502 if (status == miopenStatusSuccess) {
503 miopen_.reset(new MIOpenAccess(miopen_handle));
504 return port::Status::OK();
505 }
506
507 CHECK_EQ(miopen_handle, nullptr);
508 LOG(ERROR) << "could not create miopen handle: " << ToString(status);
509 if (status == miopenStatusNotInitialized) {
510 auto result = rocm::Diagnostician::FindKernelDriverVersion();
511 if (!result.ok()) {
512 LOG(ERROR) << "error retrieving driver version: "
513 << rocm::DriverVersionStatusToString(result);
514 } else {
515 const auto& version = result.ValueOrDie();
516 LOG(INFO) << "possibly insufficient driver version: "
517 << rocm::DriverVersionToString(version);
518 }
519 }
520
521 return port::Status{port::error::INTERNAL,
522 absl::StrCat("miopen library could not create a handle: ",
523 ToString(status))};
524}
525
526port::StatusOr<perftools::gputools::dnn::VersionInfo>
527MIOpenSupport::GetVersion() {

Calls 6

ToStringFunction · 0.70
DriverVersionToStringFunction · 0.70
StrCatFunction · 0.50
resetMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected