Skip to content

Commit 21c2f06

Browse files
kgibalaCompute-Runtime-Automation
authored andcommitted
Remove redundant GmmHelper init in createDeviceImpl
Initialization of GmmHelper is carried out earlier in the prepareDeviceEnvironments method. Related-To: NEO-6523 Signed-off-by: Krzysztof Gibala <[email protected]>
1 parent ce91edc commit 21c2f06

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

shared/source/device/device.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ bool Device::createDeviceImpl() {
206206
auto &hwInfo = getHardwareInfo();
207207
preemptionMode = PreemptionHelper::getDefaultPreemptionMode(hwInfo);
208208

209-
executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->initGmm();
210-
211209
if (!getDebugger()) {
212210
this->executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->initDebugger();
213211
}

shared/test/common/libult/create_command_stream.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ bool prepareDeviceEnvironments(ExecutionEnvironment &executionEnvironment) {
6262
}
6363

6464
bool prepareDeviceEnvironment(ExecutionEnvironment &executionEnvironment, std::string &osPciPath, const uint32_t rootDeviceIndex) {
65+
auto retVal = true;
6566
executionEnvironment.prepareRootDeviceEnvironment(rootDeviceIndex);
6667
auto currentHwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
6768
if (currentHwInfo->platform.eProductFamily == IGFX_UNKNOWN && currentHwInfo->platform.eRenderCoreFamily == IGFX_UNKNOWN_CORE) {
@@ -70,10 +71,16 @@ bool prepareDeviceEnvironment(ExecutionEnvironment &executionEnvironment, std::s
7071
if (ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc) {
7172
uint32_t numRootDevices = DebugManager.flags.CreateMultipleRootDevices.get() != 0 ? DebugManager.flags.CreateMultipleRootDevices.get() : 1u;
7273
UltDeviceFactory::prepareDeviceEnvironments(executionEnvironment, numRootDevices);
73-
return ultHwConfig.mockedPrepareDeviceEnvironmentsFuncResult;
74+
retVal = ultHwConfig.mockedPrepareDeviceEnvironmentsFuncResult;
75+
} else {
76+
retVal = prepareDeviceEnvironmentImpl(executionEnvironment, osPciPath, rootDeviceIndex);
77+
}
78+
79+
for (uint32_t rootDeviceIndex = 0u; rootDeviceIndex < executionEnvironment.rootDeviceEnvironments.size(); rootDeviceIndex++) {
80+
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->initGmm();
7481
}
7582

76-
return prepareDeviceEnvironmentImpl(executionEnvironment, osPciPath, rootDeviceIndex);
83+
return retVal;
7784
}
7885
const HardwareInfo *getDefaultHwInfo() {
7986
return defaultHwInfo.get();

0 commit comments

Comments
 (0)