Correct cache memory size returned

Change-Id: I1b0467b23acf8c72c42430100237d921f565c86c
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2020-10-19 18:30:15 -07:00
committed by sys_ocldev
parent 4122554b71
commit d0634d3090
2 changed files with 19 additions and 1 deletions

View File

@@ -440,7 +440,7 @@ ze_result_t DeviceImp::getCacheProperties(uint32_t *pCount, ze_device_cache_prop
}
const auto &hardwareInfo = this->getHwInfo();
pCacheProperties[0].cacheSize = getIntermediateCacheSize(hardwareInfo);
pCacheProperties[0].cacheSize = hardwareInfo.gtSystemInfo.L3BankCount * 128 * KB;
pCacheProperties[0].flags = 0;
return ZE_RESULT_SUCCESS;

View File

@@ -169,6 +169,24 @@ TEST_F(DeviceTest, givenKernelPropertiesStructureWhenKernelPropertiesCalledThenA
EXPECT_NE(kernelPropertiesBefore.printfBufferSize, kernelProperties.printfBufferSize);
}
TEST_F(DeviceTest, givenDeviceCachePropertiesThenAllPropertiesAreAssigned) {
ze_device_cache_properties_t deviceCacheProperties, deviceCachePropertiesBefore;
deviceCacheProperties.cacheSize = std::numeric_limits<size_t>::max();
deviceCachePropertiesBefore = deviceCacheProperties;
uint32_t count = 0;
ze_result_t res = device->getCacheProperties(&count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
EXPECT_EQ(count, 1u);
res = device->getCacheProperties(&count, &deviceCacheProperties);
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
EXPECT_NE(deviceCacheProperties.cacheSize, deviceCachePropertiesBefore.cacheSize);
}
TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenAllPropertiesAreAssigned) {
ze_device_properties_t deviceProperties, devicePropertiesBefore;