mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Fix returned local memory size
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
75012f4465
commit
0346a5679f
@ -259,7 +259,12 @@ TEST(RootDevicesTest, givenRootDeviceWithSubdevicesWhenCreateEnginesThenDeviceCr
|
||||
EXPECT_EQ(1u, device.engines.size());
|
||||
}
|
||||
|
||||
TEST(SubDevicesTest, givenRootDeviceWithSubDevicesWhenGettingGlobalMemorySizeThenSubDevicesReturnReducedAmountOfGlobalMemAllocSize) {
|
||||
TEST(SubDevicesTest, givenRootDeviceWithSubDevicesAndLocalMemoryWhenGettingGlobalMemorySizeThenSubDevicesReturnReducedAmountOfGlobalMemAllocSize) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableLocalMemory.set(1);
|
||||
DebugManager.flags.CreateMultipleSubDevices.set(2);
|
||||
DebugManager.flags.HBMSizePerTileInGigabytes.set(1);
|
||||
|
||||
const uint32_t numSubDevices = 2u;
|
||||
UltDeviceFactory deviceFactory{1, numSubDevices};
|
||||
|
||||
@ -275,6 +280,25 @@ TEST(SubDevicesTest, givenRootDeviceWithSubDevicesWhenGettingGlobalMemorySizeThe
|
||||
}
|
||||
}
|
||||
|
||||
TEST(SubDevicesTest, givenRootDeviceWithSubDevicesWithoutLocalMemoryWhenGettingGlobalMemorySizeThenSubDevicesReturnReducedAmountOfGlobalMemAllocSize) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableLocalMemory.set(0);
|
||||
DebugManager.flags.CreateMultipleSubDevices.set(2);
|
||||
|
||||
const uint32_t numSubDevices = 2u;
|
||||
UltDeviceFactory deviceFactory{1, numSubDevices};
|
||||
|
||||
auto rootDevice = deviceFactory.rootDevices[0];
|
||||
|
||||
auto totalGlobalMemorySize = rootDevice->getGlobalMemorySize(static_cast<uint32_t>(rootDevice->getDeviceBitfield().to_ulong()));
|
||||
|
||||
for (const auto &subDevice : deviceFactory.subDevices) {
|
||||
auto mockSubDevice = static_cast<MockSubDevice *>(subDevice);
|
||||
auto subDeviceBitfield = static_cast<uint32_t>(mockSubDevice->getDeviceBitfield().to_ulong());
|
||||
EXPECT_EQ(totalGlobalMemorySize, mockSubDevice->getGlobalMemorySize(subDeviceBitfield));
|
||||
}
|
||||
}
|
||||
|
||||
TEST(SubDevicesTest, whenCreatingEngineInstancedSubDeviceThenSetCorrectSubdeviceIndex) {
|
||||
class MyRootDevice : public RootDevice {
|
||||
public:
|
||||
|
Reference in New Issue
Block a user