mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Defer OsContext initialization
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com> Related-To: NEO-5610
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b01b8ba5ac
commit
5318ff1872
@@ -150,16 +150,17 @@ std::unique_ptr<CommandStreamReceiver> Device::createCommandStreamReceiver() con
|
||||
}
|
||||
|
||||
bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsage) {
|
||||
auto &hwInfo = getHardwareInfo();
|
||||
auto defaultEngineType = getChosenEngineType(hwInfo);
|
||||
const auto &hwInfo = getHardwareInfo();
|
||||
const auto engineType = engineTypeUsage.first;
|
||||
const auto engineUsage = engineTypeUsage.second;
|
||||
const auto defaultEngineType = getChosenEngineType(hwInfo);
|
||||
const bool isDefaultEngine = defaultEngineType == engineType && engineUsage == EngineUsage::Regular;
|
||||
|
||||
std::unique_ptr<CommandStreamReceiver> commandStreamReceiver = createCommandStreamReceiver();
|
||||
if (!commandStreamReceiver) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto engineType = engineTypeUsage.first;
|
||||
|
||||
bool internalUsage = (engineTypeUsage.second == EngineUsage::Internal);
|
||||
if (internalUsage) {
|
||||
commandStreamReceiver->initializeDefaultsForInternalEngine();
|
||||
@@ -175,6 +176,9 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa
|
||||
getDeviceBitfield(),
|
||||
preemptionMode,
|
||||
false);
|
||||
if (osContext->isImmediateContextInitializationEnabled(isDefaultEngine)) {
|
||||
osContext->ensureContextInitialized();
|
||||
}
|
||||
commandStreamReceiver->setupContext(*osContext);
|
||||
|
||||
if (!commandStreamReceiver->initializeTagAllocation()) {
|
||||
@@ -185,7 +189,7 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa
|
||||
return false;
|
||||
}
|
||||
|
||||
if (engineType == defaultEngineType && !lowPriority && !internalUsage) {
|
||||
if (isDefaultEngine) {
|
||||
defaultEngineIndex = deviceCsrIndex;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user