Skip to content

Commit 75d0fb3

Browse files
Fixed AUB Center class object initialization
Related-To: NEO-3916 Change-Id: Ia17abe09c638ee76b8fda98166938c1bab6629a7 Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
1 parent 79907be commit 75d0fb3

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

runtime/os_interface/device_factory.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "core/os_interface/aub_memory_operations_handler.h"
99
#include "runtime/aub/aub_center.h"
1010
#include "runtime/device/device.h"
11+
#include "runtime/helpers/hw_helper.h"
1112
#include "runtime/helpers/options.h"
1213
#include "runtime/os_interface/debug_settings_manager.h"
1314
#include "runtime/os_interface/hw_info_config.h"
@@ -40,7 +41,9 @@ bool DeviceFactory::getDevicesForProductFamilyOverride(size_t &numDevices, Execu
4041
DeviceFactory::numDevices = numDevices;
4142
auto csr = DebugManager.flags.SetCommandStreamReceiver.get();
4243
if (csr > 0) {
43-
executionEnvironment.initAubCenter(DebugManager.flags.EnableLocalMemory.get(), "", static_cast<CommandStreamReceiverType>(csr));
44+
auto &hwHelper = HwHelper::get(hardwareInfo->platform.eRenderCoreFamily);
45+
auto localMemoryEnabled = hwHelper.getEnableLocalMemory(*hardwareInfo);
46+
executionEnvironment.initAubCenter(localMemoryEnabled, "", static_cast<CommandStreamReceiverType>(csr));
4447
auto aubCenter = executionEnvironment.rootDeviceEnvironments[0].aubCenter.get();
4548
executionEnvironment.memoryOperationsInterface = std::make_unique<AubMemoryOperationsHandler>(aubCenter->getAubManager());
4649
}

unit_tests/os_interface/device_factory_tests.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "runtime/os_interface/os_interface.h"
1515
#include "runtime/os_interface/os_library.h"
1616
#include "runtime/platform/platform.h"
17+
#include "unit_tests/mocks/mock_execution_environment.h"
1718

1819
#include "gtest/gtest.h"
1920

@@ -164,6 +165,22 @@ TEST_F(DeviceFactoryTest, givenCreateMultipleRootDevicesDebugFlagWhenGetDevicesF
164165
EXPECT_EQ(requiredDeviceCount, numDevices);
165166
}
166167

168+
TEST_F(DeviceFactoryTest, givenSetCommandStreamReceiverInAubModeForTgllpProductFamilyWhenGetDevicesForProductFamilyOverrideIsCalledThenAubCenterIsInitializedCorrectly) {
169+
DeviceFactoryCleaner cleaner;
170+
DebugManagerStateRestore stateRestore;
171+
DebugManager.flags.SetCommandStreamReceiver.set(1);
172+
DebugManager.flags.ProductFamilyOverride.set("tgllp");
173+
174+
MockExecutionEnvironment executionEnvironment(*platformDevices);
175+
176+
size_t numDevices = 0;
177+
bool success = DeviceFactory::getDevicesForProductFamilyOverride(numDevices, executionEnvironment);
178+
ASSERT_TRUE(success);
179+
180+
EXPECT_TRUE(executionEnvironment.initAubCenterCalled);
181+
EXPECT_FALSE(executionEnvironment.localMemoryEnabledReceived);
182+
}
183+
167184
TEST_F(DeviceFactoryTest, givenGetDevicesCallWhenItIsDoneThenOsInterfaceIsAllocated) {
168185
DeviceFactoryCleaner cleaner;
169186

0 commit comments

Comments
 (0)