Add helper function to detect if hw mode is selected

Related-To: NEO-4208
Change-Id: Iac34e9e9cea36d7ab354d7d5b5c716e8ea3a483d
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-02-07 09:00:25 +01:00
committed by sys_ocldev
parent 2343cd72c3
commit 5f4f1eb55a
4 changed files with 32 additions and 17 deletions

View File

@@ -48,25 +48,10 @@ CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEn
}
bool getDevicesImpl(size_t &numDevicesReturned, ExecutionEnvironment &executionEnvironment) {
bool result;
int32_t csr = DebugManager.flags.SetCommandStreamReceiver.get();
if (csr < 0) {
csr = CommandStreamReceiverType::CSR_HW;
}
switch (csr) {
case CSR_HW:
result = DeviceFactory::getDevices(numDevicesReturned, executionEnvironment);
DEBUG_BREAK_IF(!result);
return result;
case CSR_AUB:
case CSR_TBX:
case CSR_TBX_WITH_AUB:
return DeviceFactory::getDevicesForProductFamilyOverride(numDevicesReturned, executionEnvironment);
case CSR_HW_WITH_AUB:
if (DeviceFactory::isHwModeSelected()) {
return DeviceFactory::getDevices(numDevicesReturned, executionEnvironment);
default:
return false;
}
return DeviceFactory::getDevicesForProductFamilyOverride(numDevicesReturned, executionEnvironment);
}
} // namespace NEO