rocr: Fix inefficient copy operations
Refactor variable assignments to use std::move() where appropriate.
Updat function headers to accept parameters by const& where appropriate.
Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>
[ROCm/ROCR-Runtime commit: f6c8cbd293]
Esse commit está contido em:
@@ -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<core::Driver>& driver) {
|
||||
std::string devnode("/dev/kfd");
|
||||
auto tmp_driver = std::unique_ptr<core::Driver>(new KfdDriver(devnode));
|
||||
auto tmp_driver = std::unique_ptr<core::Driver>(new KfdDriver("/dev/kfd"));
|
||||
|
||||
if (tmp_driver->Open() == HSA_STATUS_SUCCESS) {
|
||||
driver = std::move(tmp_driver);
|
||||
|
||||
@@ -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.
|
||||
///
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário