mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Correct cache memory size returned
Change-Id: I1b0467b23acf8c72c42430100237d921f565c86c Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
4122554b71
commit
d0634d3090
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user