Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/common/umf_pools/disjoint_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ void *DisjointPool::malloc(size_t size) { // For full-slab allocations indicates
auto Ptr = impl->allocate(size, FromPool);

if (impl->getParams().PoolTrace > 2) {
auto MT = impl->getParams().name;
const auto &MT = impl->getParams().name;
std::cout << "Allocated " << std::setw(8) << size << " " << MT
<< " bytes from " << (FromPool ? "Pool" : "Provider") << " ->"
<< Ptr << std::endl;
Expand All @@ -938,7 +938,7 @@ void *DisjointPool::aligned_malloc(size_t size, size_t alignment) {
auto Ptr = impl->allocate(size, alignment, FromPool);

if (impl->getParams().PoolTrace > 2) {
auto MT = impl->getParams().name;
const auto &MT = impl->getParams().name;
std::cout << "Allocated " << std::setw(8) << size << " " << MT
<< " bytes aligned at " << alignment << " from "
<< (FromPool ? "Pool" : "Provider") << " ->" << Ptr
Expand All @@ -957,7 +957,7 @@ enum umf_result_t DisjointPool::free(void *ptr) try {
impl->deallocate(ptr, ToPool);

if (impl->getParams().PoolTrace > 2) {
auto MT = impl->getParams().name;
const auto &MT = impl->getParams().name;
std::cout << "Freed " << MT << " " << ptr << " to "
<< (ToPool ? "Pool" : "Provider")
<< ", Current total pool size "
Expand Down
7 changes: 4 additions & 3 deletions source/loader/ur_adapter_registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class AdapterRegistry {
}

if (exists) {
adaptersLoadPaths.emplace_back(std::vector{path});
adaptersLoadPaths.emplace_back(
std::vector{std::move(path)});
} else {
logger::warning(
"Detected nonexistent path {} in environmental "
Expand Down Expand Up @@ -164,12 +165,12 @@ class AdapterRegistry {

auto adapterNamePathOpt = getAdapterNameAsPath(adapterName);
if (adapterNamePathOpt.has_value()) {
auto adapterNamePath = adapterNamePathOpt.value();
const auto &adapterNamePath = adapterNamePathOpt.value();
loadPaths.emplace_back(adapterNamePath);
}

if (loaderLibPathOpt.has_value()) {
auto loaderLibPath = loaderLibPathOpt.value();
const auto &loaderLibPath = loaderLibPathOpt.value();
loadPaths.emplace_back(loaderLibPath / adapterName);
}

Expand Down
4 changes: 2 additions & 2 deletions test/loader/adapter_registry/search_order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "fixtures.hpp"

template <typename P>
void assertRegistryPathSequence(std::vector<fs::path> testAdapterPaths,
void assertRegistryPathSequence(const std::vector<fs::path> &testAdapterPaths,
P predicate) {
static size_t assertIndex = 0;

Expand All @@ -24,7 +24,7 @@ TEST_F(adapterRegSearchTest, testSearchOrder) {
auto it = std::find_if(registry.cbegin(), registry.cend(), hasTestLibName);
ASSERT_NE(it, registry.end());

auto testAdapterPaths = *it;
const auto &testAdapterPaths = *it;
assertRegistryPathSequence(testAdapterPaths, isTestEnvPath);
#ifndef _WIN32
assertRegistryPathSequence(testAdapterPaths, isTestLibName);
Expand Down
2 changes: 1 addition & 1 deletion test/usm/usmPoolManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ TEST_P(urUsmPoolManagerTest, poolManagerInsertExisting) {
auto [ret, manager] = usm::pool_manager<usm::pool_descriptor>::create();
ASSERT_EQ(ret, UR_RESULT_SUCCESS);

auto desc = poolDescriptors[0];
const auto &desc = poolDescriptors[0];

auto pool = nullPoolCreate();
ASSERT_NE(pool, nullptr);
Expand Down