mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:35:19 +08:00
refactor: use reference in for-range loops
Related-To: NEO-9038 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9b344280d6
commit
895a586083
@@ -114,7 +114,7 @@ inline std::string concatenate(T &&arg, RestT &&...rest) {
|
||||
template <size_t NumOptions>
|
||||
constexpr size_t concatenationLength(const ConstStringRef (&options)[NumOptions]) {
|
||||
size_t ret = 0U;
|
||||
for (auto opt : options) {
|
||||
for (auto &opt : options) {
|
||||
ret += spaceSeparatorSize + opt.length();
|
||||
}
|
||||
return (ret != 0U) ? ret - nullterminateSize : 0U;
|
||||
@@ -141,7 +141,7 @@ class ConstConcatenation {
|
||||
template <size_t NumOptions>
|
||||
constexpr ConstConcatenation(const ConstStringRef (&options)[NumOptions]) {
|
||||
size_t i = 0U;
|
||||
for (auto opt : options) {
|
||||
for (auto &opt : options) {
|
||||
for (size_t j = 0U, e = opt.length(); j < e; ++j, ++i) {
|
||||
storage[i] = opt[j];
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ void *MemoryManager::createMultiGraphicsAllocationInSystemMemoryPool(RootDeviceI
|
||||
auto graphicsAllocation = createGraphicsAllocationFromExistingStorage(properties, ptr, multiGraphicsAllocation);
|
||||
|
||||
if (!graphicsAllocation) {
|
||||
for (auto gpuAllocation : multiGraphicsAllocation.getGraphicsAllocations()) {
|
||||
for (auto &gpuAllocation : multiGraphicsAllocation.getGraphicsAllocations()) {
|
||||
freeGraphicsMemory(gpuAllocation);
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
namespace NEO {
|
||||
|
||||
bool Drm::registerResourceClasses() {
|
||||
for (auto classNameUUID : classNamesToUuid) {
|
||||
for (auto &classNameUUID : classNamesToUuid) {
|
||||
auto className = classNameUUID.first;
|
||||
auto uuid = classNameUUID.second;
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ size_t MemoryInfo::getMemoryRegionSize(uint32_t memoryBank) {
|
||||
}
|
||||
|
||||
void MemoryInfo::printRegionSizes() {
|
||||
for (auto region : drmQueryRegions) {
|
||||
for (auto ®ion : drmQueryRegions) {
|
||||
std::cout << "Memory type: " << region.region.memoryClass
|
||||
<< ", memory instance: " << region.region.memoryInstance
|
||||
<< ", region size: " << region.probedSize << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user