mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
refactor: remove redundant definitions KB/MB/GB
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
878a95aaf9
commit
6849d33326
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -21,6 +21,6 @@ std::unique_ptr<MemoryManager> MemoryManager::createMemoryManager(ExecutionEnvir
|
||||
}
|
||||
size_t getSizeToReserve() {
|
||||
// 4 x sizeof(Heap32) + 2 x sizeof(Standard/Standard64k)
|
||||
return (4 * 4 + 2 * 4) * GB;
|
||||
return (4 * 4 + 2 * 4) * MemoryConstants::gigaByte;
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
@@ -142,9 +142,9 @@ void DrmMemoryManagerFixtureWithoutQuietIoctlExpectation::setUp(bool enableLocal
|
||||
mock = static_cast<DrmMockCustom *>(executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->osInterface->getDriverModel()->as<Drm>());
|
||||
std::vector<MemoryRegion> regionInfo(2);
|
||||
regionInfo[0].region = {drm_i915_gem_memory_class::I915_MEMORY_CLASS_SYSTEM, 0};
|
||||
regionInfo[0].probedSize = 8 * GB;
|
||||
regionInfo[0].probedSize = 8 * MemoryConstants::gigaByte;
|
||||
regionInfo[1].region = {drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0};
|
||||
regionInfo[1].probedSize = 16 * GB;
|
||||
regionInfo[1].probedSize = 16 * MemoryConstants::gigaByte;
|
||||
mock->memoryInfo.reset(new MockedMemoryInfo(regionInfo, *mock));
|
||||
executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock, 0u, false);
|
||||
memoryManager.reset(new TestedDrmMemoryManager(enableLocalMem, false, false, *executionEnvironment));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -14,19 +14,19 @@
|
||||
#include <vector>
|
||||
|
||||
const std::vector<NEO::MemoryRegion> memoryRegions = {
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_SYSTEM, 0}, 64 * GB, 0},
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0}, 8 * GB, 0}};
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_SYSTEM, 0}, 64 * MemoryConstants::gigaByte, 0},
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0}, 8 * MemoryConstants::gigaByte, 0}};
|
||||
|
||||
struct MockMemoryInfo : public NEO::MemoryInfo {
|
||||
MockMemoryInfo(const NEO::Drm &drm) : MemoryInfo(memoryRegions, drm) {}
|
||||
};
|
||||
|
||||
const std::vector<NEO::MemoryRegion> extendedMemoryRegions = {
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_SYSTEM, 1}, 64 * GB, 0},
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0x100}, 8 * GB, 0},
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0x200}, 8 * GB, 0},
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0x400}, 8 * GB, 0},
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0x800}, 8 * GB, 0}};
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_SYSTEM, 1}, 64 * MemoryConstants::gigaByte, 0},
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0x100}, 8 * MemoryConstants::gigaByte, 0},
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0x200}, 8 * MemoryConstants::gigaByte, 0},
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0x400}, 8 * MemoryConstants::gigaByte, 0},
|
||||
{{drm_i915_gem_memory_class::I915_MEMORY_CLASS_DEVICE, 0x800}, 8 * MemoryConstants::gigaByte, 0}};
|
||||
|
||||
struct MockExtendedMemoryInfo : public NEO::MemoryInfo {
|
||||
MockExtendedMemoryInfo(const NEO::Drm &drm) : MemoryInfo(extendedMemoryRegions, drm) {}
|
||||
|
||||
Reference in New Issue
Block a user