Flush task at device init

Resolves: NEO-7642

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2023-01-26 11:56:14 +00:00
committed by Compute-Runtime-Automation
parent fe8a6d98ad
commit 73bd55ad40
15 changed files with 76 additions and 16 deletions

View File

@@ -381,13 +381,18 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa
commandStreamReceiver->createKernelArgsBufferAllocation();
if (preemptionMode == PreemptionMode::MidThread && !commandStreamReceiver->createPreemptionAllocation()) {
return false;
}
if (isDefaultEngine) {
bool defaultEngineAlreadySet = (allEngines.size() > defaultEngineIndex) && (allEngines[defaultEngineIndex].getEngineType() == engineType);
if (!defaultEngineAlreadySet) {
defaultEngineIndex = deviceCsrIndex;
if (osContext->isDebuggableContext()) {
if (osContext->isDebuggableContext() ||
this->isInitDeviceWithFirstSubmissionSupported(commandStreamReceiver->getType())) {
if (SubmissionStatus::SUCCESS != commandStreamReceiver->initializeDeviceWithFirstSubmission()) {
return false;
}
@@ -399,15 +404,12 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa
defaultBcsEngineIndex = deviceCsrIndex;
}
if (preemptionMode == PreemptionMode::MidThread && !commandStreamReceiver->createPreemptionAllocation()) {
return false;
}
EngineControl engine{commandStreamReceiver.get(), osContext};
allEngines.push_back(engine);
if (engineUsage == EngineUsage::Regular) {
addEngineToEngineGroup(engine);
}
commandStreamReceivers.push_back(std::move(commandStreamReceiver));
return true;
@@ -440,6 +442,11 @@ bool Device::isBcsSplitSupported() {
return bcsSplit;
}
bool Device::isInitDeviceWithFirstSubmissionSupported(CommandStreamReceiverType csrType) {
return getProductHelper().isInitDeviceWithFirstSubmissionRequired(getHardwareInfo()) &&
Device::isInitDeviceWithFirstSubmissionEnabled(csrType);
}
double Device::getPlatformHostTimerResolution() const {
if (getOSTime()) {
return getOSTime()->getHostTimerResolution();

View File

@@ -10,6 +10,7 @@
#include "shared/source/helpers/engine_control.h"
#include "shared/source/helpers/engine_node_helper.h"
#include "shared/source/helpers/non_copyable_or_moveable.h"
#include "shared/source/helpers/options.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/performance_counters.h"
#include "shared/source/utilities/reference_tracked_object.h"
@@ -108,7 +109,9 @@ class Device : public ReferenceTrackedObject<Device> {
RootDeviceEnvironment &getRootDeviceEnvironmentRef() const;
bool isFullRangeSvm() const;
static bool isBlitSplitEnabled();
static bool isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType csrType);
bool isBcsSplitSupported();
bool isInitDeviceWithFirstSubmissionSupported(CommandStreamReceiverType csrType);
bool areSharedSystemAllocationsAllowed() const;
template <typename SpecializedDeviceT>
void setSpecializedDevice(SpecializedDeviceT *specializedDevice) {