mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 23:56:39 +08:00
fix: use const auto& to avoid unnecessary copies
Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
dfd926a9c6
commit
8cf8fe4f5a
@@ -480,7 +480,7 @@ void ContextImp::freePeerAllocations(const void *ptr, bool blocking, Device *dev
|
||||
auto peerAlloc = peerAllocData->gpuAllocations.getDefaultGraphicsAllocation();
|
||||
auto peerPtr = reinterpret_cast<void *>(peerAlloc->getGpuAddress());
|
||||
if (peerAllocData->mappedAllocData) {
|
||||
auto gpuAllocations = peerAllocData->gpuAllocations;
|
||||
const auto &gpuAllocations = peerAllocData->gpuAllocations;
|
||||
for (const auto &graphicsAllocation : gpuAllocations.getGraphicsAllocations()) {
|
||||
this->driverHandle->getMemoryManager()->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ ze_result_t DriverHandleImp::getExtensionProperties(uint32_t *pCount,
|
||||
*pCount = std::min(extensionCount, *pCount);
|
||||
|
||||
for (uint32_t i = 0; i < *pCount; i++) {
|
||||
auto extension = (i < this->extensionsSupported.size()) ? this->extensionsSupported[i] : additionalExtensions[i - this->extensionsSupported.size()];
|
||||
const auto &extension = (i < this->extensionsSupported.size()) ? this->extensionsSupported[i] : additionalExtensions[i - this->extensionsSupported.size()];
|
||||
strncpy_s(pExtensionProperties[i].name, ZE_MAX_EXTENSION_NAME,
|
||||
extension.first.c_str(), extension.first.length());
|
||||
pExtensionProperties[i].version = extension.second;
|
||||
|
||||
@@ -204,7 +204,7 @@ KernelData *MutableCommandListImp::getKernelData(L0::Kernel *kernel) {
|
||||
|
||||
auto &kernelDescriptor = kernel->getKernelDescriptor();
|
||||
|
||||
const auto kernelName = kernelDescriptor.kernelMetadata.kernelName;
|
||||
const auto &kernelName = kernelDescriptor.kernelMetadata.kernelName;
|
||||
const L0::Module *module = &(static_cast<L0::KernelImp *>(kernel)->getParentModule());
|
||||
std::pair<const L0::Module *, std::string> pairFind(module, kernelName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user