Create only available engines

Change-Id: If7880db0dd7aa76b578d0e4e300f510ca686b825
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2020-02-21 15:25:04 +01:00
committed by sys_ocldev
parent c345939dd6
commit 750036742d
39 changed files with 242 additions and 171 deletions

View File

@@ -41,7 +41,9 @@ class WddmPreemptionTests : public Test<WddmFixtureWithMockGdiDll> {
regReader->forceRetValue = forceReturnPreemptionRegKeyValue;
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(hwInfoTest);
wddm->init();
osContext = std::make_unique<OsContextWin>(*wddm, 0u, 1, HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances()[0], preemptionMode, false);
auto hwInfo = executionEnvironment->getHardwareInfo();
auto engine = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
osContext = std::make_unique<OsContextWin>(*wddm, 0u, 1, engine, preemptionMode, false);
}
DebugManagerStateRestore *dbgRestorer = nullptr;

View File

@@ -539,7 +539,8 @@ HWTEST_F(MidThreadPreemptionTests, givenMidThreadPreemptionWhenFailingOnCsrSurfa
FailingMemoryManager(ExecutionEnvironment &executionEnvironment) : OsAgnosticMemoryManager(executionEnvironment) {}
GraphicsAllocation *allocateGraphicsMemoryWithAlignment(const AllocationData &allocationData) override {
if (++allocateGraphicsMemoryCount > HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances().size() - 1) {
auto hwInfo = executionEnvironment.getHardwareInfo();
if (++allocateGraphicsMemoryCount > HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo).size() - 1) {
return nullptr;
}
return OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment(allocationData);