diff --git a/runtime/hsa-runtime/core/driver/kfd/amd_kfd_driver.cpp b/runtime/hsa-runtime/core/driver/kfd/amd_kfd_driver.cpp index 79038ac2b9..1c05d95f5e 100644 --- a/runtime/hsa-runtime/core/driver/kfd/amd_kfd_driver.cpp +++ b/runtime/hsa-runtime/core/driver/kfd/amd_kfd_driver.cpp @@ -84,7 +84,7 @@ __forceinline uint64_t drm_perm(hsa_access_permission_t perm) { } // namespace KfdDriver::KfdDriver(std::string devnode_name) - : core::Driver(core::DriverType::KFD, devnode_name) {} + : core::Driver(core::DriverType::KFD, std::move(devnode_name)) {} hsa_status_t KfdDriver::Init() { HSAKMT_STATUS ret = diff --git a/runtime/hsa-runtime/core/inc/scratch_cache.h b/runtime/hsa-runtime/core/inc/scratch_cache.h index 4fcb242f7e..2846da7250 100644 --- a/runtime/hsa-runtime/core/inc/scratch_cache.h +++ b/runtime/hsa-runtime/core/inc/scratch_cache.h @@ -126,7 +126,7 @@ class ScratchCache { ScratchCache& operator=(const ScratchCache& rhs) = delete; ScratchCache& operator=(ScratchCache&& rhs) = delete; - ScratchCache(deallocator_t deallocator) : dealloc(deallocator), available_bytes_(0) {} + ScratchCache(deallocator_t deallocator) : dealloc(std::move(deallocator)), available_bytes_(0) {} ~ScratchCache() { assert(map.empty() && "ScratchCache not empty at shutdown."); } diff --git a/runtime/hsa-runtime/core/runtime/amd_filter_device.cpp b/runtime/hsa-runtime/core/runtime/amd_filter_device.cpp index 7b87317bfb..eaf21d2137 100644 --- a/runtime/hsa-runtime/core/runtime/amd_filter_device.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_filter_device.cpp @@ -118,7 +118,7 @@ void RvdFilter::BuildDeviceUuidList(uint32_t numNodes) { << props.UniqueID; std::string uuidVal(stream.str()); std::transform(uuidVal.begin(), uuidVal.end(), uuidVal.begin(), ::toupper); - devUuidList_.push_back(uuidVal); + devUuidList_.push_back(std::move(uuidVal)); } } @@ -239,7 +239,7 @@ void RvdFilter::SetDeviceUuidList() { << dbgUuid[idx]; std::string uuidVal(stream.str()); std::transform(uuidVal.begin(), uuidVal.end(), uuidVal.begin(), ::toupper); - devUuidList_[idx] = uuidVal; + devUuidList_[idx] = std::move(uuidVal); } } diff --git a/runtime/hsa-runtime/core/util/lazy_ptr.h b/runtime/hsa-runtime/core/util/lazy_ptr.h index 2aef6a3bf3..3c20b88316 100644 --- a/runtime/hsa-runtime/core/util/lazy_ptr.h +++ b/runtime/hsa-runtime/core/util/lazy_ptr.h @@ -76,7 +76,7 @@ template class lazy_ptr { void reset(std::function Constructor = nullptr) { obj.reset(); - func = Constructor; + func = std::move(Constructor); } void reset(T* ptr) { diff --git a/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp b/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp index f6eb92d241..fa13dbf282 100644 --- a/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp +++ b/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp @@ -175,7 +175,7 @@ namespace code { std::string Symbol::GetSymbolName() const { std::string FullName = Name(); return FullName.rfind(":") != std::string::npos ? - FullName.substr(FullName.rfind(":") + 1) : FullName; + std::move(FullName.substr(FullName.rfind(":") + 1)) : std::move(FullName); } hsa_code_symbol_t Symbol::ToHandle(Symbol* sym) @@ -1732,7 +1732,7 @@ namespace code { std::string AmdHsaCode::MangleSymbolName(const std::string& module_name, const std::string symbol_name) { if (module_name.empty()) { - return symbol_name; + return std::move(symbol_name); } else { return module_name + "::" + symbol_name; }