diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/driver/kfd/amd_kfd_driver.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/driver/kfd/amd_kfd_driver.cpp index 3d6a4c872f..1c05d95f5e 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/driver/kfd/amd_kfd_driver.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/driver/kfd/amd_kfd_driver.cpp @@ -83,7 +83,7 @@ __forceinline uint64_t drm_perm(hsa_access_permission_t perm) { } // namespace -KfdDriver::KfdDriver(std::string& devnode_name) +KfdDriver::KfdDriver(std::string devnode_name) : core::Driver(core::DriverType::KFD, std::move(devnode_name)) {} hsa_status_t KfdDriver::Init() { @@ -128,8 +128,7 @@ hsa_status_t KfdDriver::ShutDown() { } hsa_status_t KfdDriver::DiscoverDriver(std::unique_ptr& driver) { - std::string devnode("/dev/kfd"); - auto tmp_driver = std::unique_ptr(new KfdDriver(devnode)); + auto tmp_driver = std::unique_ptr(new KfdDriver("/dev/kfd")); if (tmp_driver->Open() == HSA_STATUS_SUCCESS) { driver = std::move(tmp_driver); diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/amd_kfd_driver.h b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/amd_kfd_driver.h index 07e3f5f1e6..4579b6e8b0 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/amd_kfd_driver.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/amd_kfd_driver.h @@ -69,7 +69,7 @@ namespace AMD { /// and more. class KfdDriver final : public core::Driver { public: - KfdDriver(std::string& devnode_name); + KfdDriver(std::string devnode_name); /// @brief Determine of the KFD is present on the system and attemp to open it if found. ///