mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +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
@@ -1006,7 +1006,7 @@ ze_result_t DeviceImp::getCacheProperties(uint32_t *pCount, ze_device_cache_prop
|
||||
|
||||
const auto &hardwareInfo = this->getHwInfo();
|
||||
uint32_t subDeviceCount = std::max(this->numSubDevices, 1u);
|
||||
pCacheProperties[0].cacheSize = hardwareInfo.gtSystemInfo.L3CacheSizeInKb * subDeviceCount * KB;
|
||||
pCacheProperties[0].cacheSize = hardwareInfo.gtSystemInfo.L3CacheSizeInKb * subDeviceCount * MemoryConstants::kiloByte;
|
||||
pCacheProperties[0].flags = 0;
|
||||
|
||||
if (pCacheProperties->pNext) {
|
||||
|
||||
@@ -456,7 +456,7 @@ ze_result_t KernelImp::suggestMaxCooperativeGroupCount(uint32_t *totalGroupCount
|
||||
auto &descriptor = kernelImmData->getDescriptor();
|
||||
auto availableThreadCount = helper.calculateAvailableThreadCount(hardwareInfo, descriptor.kernelAttributes.numGrfRequired);
|
||||
|
||||
auto availableSlmSize = static_cast<uint32_t>(dssCount * KB * hardwareInfo.capabilityTable.slmSize);
|
||||
auto availableSlmSize = static_cast<uint32_t>(dssCount * MemoryConstants::kiloByte * hardwareInfo.capabilityTable.slmSize);
|
||||
auto usedSlmSize = helper.alignSlmSize(slmArgsTotalSize + descriptor.kernelAttributes.slmInlineSize);
|
||||
auto maxBarrierCount = static_cast<uint32_t>(helper.getMaxBarrierRegisterPerSlice());
|
||||
auto barrierCount = descriptor.kernelAttributes.barrierCount;
|
||||
@@ -688,7 +688,7 @@ ze_result_t KernelImp::setArgBuffer(uint32_t argIndex, size_t argSize, const voi
|
||||
slmOffset += static_cast<uint32_t>(slmArgSizes[argIndex]);
|
||||
++argIndex;
|
||||
}
|
||||
slmArgsTotalSize = static_cast<uint32_t>(alignUp(slmOffset, KB));
|
||||
slmArgsTotalSize = static_cast<uint32_t>(alignUp(slmOffset, MemoryConstants::kiloByte));
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ void CommandListPrivateHeapsFixture::setUp() {
|
||||
CommandListStateBaseAddressFixture::setUp();
|
||||
|
||||
for (uint32_t i = 0; i < storeAllocations; i++) {
|
||||
auto heapAllocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), true, 2 * MB,
|
||||
auto heapAllocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), true, 2 * MemoryConstants::megaByte,
|
||||
NEO::AllocationType::LINEAR_STREAM, false, false,
|
||||
neoDevice->getDeviceBitfield()});
|
||||
commandListImmediate->csr->getInternalAllocationStorage()->storeAllocation(std::unique_ptr<GraphicsAllocation>(heapAllocation), REUSABLE_ALLOCATION);
|
||||
@@ -246,7 +246,7 @@ void ImmediateCmdListSharedHeapsFixture::setUp() {
|
||||
ModuleMutableCommandListFixture::setUp();
|
||||
|
||||
for (uint32_t i = 0; i < storeAllocations; i++) {
|
||||
auto heapAllocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), true, 2 * MB,
|
||||
auto heapAllocation = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), true, 2 * MemoryConstants::megaByte,
|
||||
NEO::AllocationType::LINEAR_STREAM, false, false,
|
||||
neoDevice->getDeviceBitfield()});
|
||||
commandListImmediate->csr->getInternalAllocationStorage()->storeAllocation(std::unique_ptr<GraphicsAllocation>(heapAllocation), REUSABLE_ALLOCATION);
|
||||
|
||||
@@ -25,7 +25,7 @@ void KernelImpSuggestMaxCooperativeGroupCountFixture::setUp() {
|
||||
if (dssCount == 0) {
|
||||
dssCount = hardwareInfo.gtSystemInfo.SubSliceCount;
|
||||
}
|
||||
availableSlm = dssCount * KB * hardwareInfo.capabilityTable.slmSize;
|
||||
availableSlm = dssCount * MemoryConstants::kiloByte * hardwareInfo.capabilityTable.slmSize;
|
||||
maxBarrierCount = static_cast<uint32_t>(helper.getMaxBarrierRegisterPerSlice());
|
||||
|
||||
kernelInfo.kernelDescriptor->kernelAttributes.simdSize = simd;
|
||||
|
||||
@@ -1063,7 +1063,7 @@ TEST_F(MultiSubDeviceCachePropertiesTest, givenDeviceWithSubDevicesWhenQueriedFo
|
||||
|
||||
auto rootDeviceIndex = device->getNEODevice()->getRootDeviceIndex();
|
||||
auto &hwInfo = *device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex]->getMutableHardwareInfo();
|
||||
auto singleRootDeviceCacheSize = hwInfo.gtSystemInfo.L3CacheSizeInKb * KB;
|
||||
auto singleRootDeviceCacheSize = hwInfo.gtSystemInfo.L3CacheSizeInKb * MemoryConstants::kiloByte;
|
||||
|
||||
uint32_t count = 0;
|
||||
ze_result_t res = device->getCacheProperties(&count, nullptr);
|
||||
|
||||
@@ -451,7 +451,7 @@ HWTEST_F(KernelImpSuggestMaxCooperativeGroupCountTests, GivenBarriersWhenCalcula
|
||||
}
|
||||
|
||||
HWTEST_F(KernelImpSuggestMaxCooperativeGroupCountTests, GivenUsedSlmSizeWhenCalculatingMaxCooperativeGroupCountThenResultIsCalculatedWithRegardToUsedSlmSize) {
|
||||
usedSlm = 64 * KB;
|
||||
usedSlm = 64 * MemoryConstants::kiloByte;
|
||||
auto expected = availableSlm / usedSlm;
|
||||
EXPECT_EQ(expected, getMaxWorkGroupCount());
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ PVCTEST_F(KernelImpSuggestMaxCooperativeGroupCountTestsPvc, GivenBarriersWhenCal
|
||||
}
|
||||
|
||||
PVCTEST_F(KernelImpSuggestMaxCooperativeGroupCountTestsPvc, GivenUsedSlmSizeWhenCalculatingMaxCooperativeGroupCountThenResultIsCalculatedWithRegardToUsedSlmSize) {
|
||||
usedSlm = 64 * KB;
|
||||
usedSlm = 64 * MemoryConstants::kiloByte;
|
||||
auto expected = (availableSlm / usedSlm) / 2;
|
||||
EXPECT_EQ(expected, getMaxWorkGroupCount());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user