mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Improve creating HwContextController
Change-Id: If81ec18793a5af7fb58d66bb26a3bc476eaf94e0 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
9af011809f
commit
af2dc200c5
@@ -95,8 +95,12 @@ void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::setupContext(OsContext &
|
||||
|
||||
auto &engineType = osContext.getEngineType();
|
||||
if (aubManager && !(engineType.type == lowPriorityGpgpuEngine.type && engineType.id == lowPriorityGpgpuEngine.id)) {
|
||||
hardwareContextController = std::make_unique<HardwareContextController>(*aubManager, osContext,
|
||||
deviceIndex, engineIndex, flags);
|
||||
if (osContext.getNumDevicesSupported() == 1) {
|
||||
hardwareContextController = std::make_unique<HardwareContextController>(*aubManager, osContext,
|
||||
deviceIndex, engineIndex, flags);
|
||||
} else {
|
||||
hardwareContextController = std::make_unique<HardwareContextController>(*aubManager, osContext, engineIndex, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -803,7 +803,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess
|
||||
memoryManager->freeGraphicsMemory(gfxImageAllocation);
|
||||
}
|
||||
|
||||
HWTEST_F(AubCommandStreamReceiverTests, givenOsContextWithMultipleDevicesSupportedWhenSetupIsCalledThenAbort) {
|
||||
HWTEST_F(AubCommandStreamReceiverTests, givenOsContextWithMultipleDevicesSupportedWhenSetupIsCalledThenCreateMultipleHardwareContexts) {
|
||||
MockAubCenter *mockAubCenter = new MockAubCenter(platformDevices[0], false, "", CommandStreamReceiverType::CSR_AUB);
|
||||
mockAubCenter->aubManager = std::make_unique<MockAubManager>();
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
@@ -811,8 +811,9 @@ HWTEST_F(AubCommandStreamReceiverTests, givenOsContextWithMultipleDevicesSupport
|
||||
uint32_t numSupportedDevices = 3;
|
||||
OsContext osContext(nullptr, 1, numSupportedDevices, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled);
|
||||
auto aubCsr = std::make_unique<AUBCommandStreamReceiverHw<FamilyType>>(*platformDevices[0], "", true, *pDevice->executionEnvironment);
|
||||
aubCsr->setupContext(osContext);
|
||||
|
||||
EXPECT_THROW(aubCsr->setupContext(osContext), std::exception);
|
||||
EXPECT_EQ(numSupportedDevices, aubCsr->hardwareContextController->hardwareContexts.size());
|
||||
}
|
||||
|
||||
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGraphicsAllocationTypeIsntNonAubWritableThenWriteMemoryIsAllowed) {
|
||||
|
||||
Reference in New Issue
Block a user