diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index ebc6341a72..df03b88a94 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -239,7 +239,7 @@ ze_result_t CommandListCoreFamily::initialize(Device *device, NEO this->useOnlyGlobalTimestamps = gfxCoreHelper.useOnlyGlobalTimestamps(); this->maxFillPaternSizeForCopyEngine = productHelper.getMaxFillPaternSizeForCopyEngine(); this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled(); - this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(); + this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(this->heaplessModeEnabled); this->requiredStreamState.initSupport(rootDeviceEnvironment); this->finalStreamState.initSupport(rootDeviceEnvironment); this->duplicatedInOrderCounterStorageEnabled = gfxCoreHelper.duplicatedInOrderCounterStorageEnabled(rootDeviceEnvironment); diff --git a/level_zero/core/source/cmdqueue/cmdqueue.cpp b/level_zero/core/source/cmdqueue/cmdqueue.cpp index 95fbcdef65..b0add42c1b 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue.cpp +++ b/level_zero/core/source/cmdqueue/cmdqueue.cpp @@ -100,7 +100,7 @@ ze_result_t CommandQueueImp::initialize(bool copyOnly, bool isInternal, bool imm this->dispatchCmdListBatchBufferAsPrimary = L0GfxCoreHelper::dispatchCmdListBatchBufferAsPrimary(rootDeviceEnvironment, !immediateCmdListQueue); auto &compilerProductHelper = rootDeviceEnvironment.getHelper(); this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled(); - this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(); + this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(this->heaplessModeEnabled); } return returnValue; } diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index 6854c2a16b..2f0ab2615b 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -131,7 +131,7 @@ CommandQueue::CommandQueue(Context *context, ClDevice *device, const cl_queue_pr } this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled(); - this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(); + this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(this->heaplessModeEnabled); } } diff --git a/shared/source/command_container/command_encoder_xehp_and_later.inl b/shared/source/command_container/command_encoder_xehp_and_later.inl index 99f84e757f..a27f612aff 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -283,7 +283,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis } } - bool heaplessStateInitEnabled = rootDeviceEnvironment.getHelper().isHeaplessStateInitEnabled(); + bool heaplessStateInitEnabled = rootDeviceEnvironment.getHelper().isHeaplessStateInitEnabled(heaplessModeEnabled); if (heaplessStateInitEnabled == false) { if (container.isAnyHeapDirty() || diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 6b9359f49c..aadfdf542f 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -461,7 +461,9 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa } auto &compilerProductHelper = this->getCompilerProductHelper(); - bool isHeaplessStateInit = isPrimaryEngine && compilerProductHelper.isHeaplessStateInitEnabled(); + auto heaplessEnabled = compilerProductHelper.isHeaplessModeEnabled(); + + bool isHeaplessStateInit = isPrimaryEngine && compilerProductHelper.isHeaplessStateInitEnabled(heaplessEnabled); bool initializeDevice = (useContextGroup || isHeaplessStateInit) && !firstSubmissionDone; if (initializeDevice) { diff --git a/shared/source/helpers/compiler_product_helper.h b/shared/source/helpers/compiler_product_helper.h index 5eaed0f877..7b593bbbc2 100644 --- a/shared/source/helpers/compiler_product_helper.h +++ b/shared/source/helpers/compiler_product_helper.h @@ -77,7 +77,7 @@ class CompilerProductHelper { virtual StackVec getDeviceOpenCLCVersions(const HardwareInfo &hwInfo, OclCVersion max) const = 0; virtual void adjustHwInfoForIgc(HardwareInfo &hwInfo) const = 0; virtual bool isHeaplessModeEnabled() const = 0; - virtual bool isHeaplessStateInitEnabled() const = 0; + virtual bool isHeaplessStateInitEnabled(bool heaplessModeEnabled) const = 0; virtual void getKernelFp16AtomicCapabilities(const ReleaseHelper *releaseHelper, uint32_t &fp16Caps) const = 0; virtual void getKernelFp32AtomicCapabilities(uint32_t &fp32Caps) const = 0; virtual void getKernelFp64AtomicCapabilities(uint32_t &fp64Caps) const = 0; @@ -124,7 +124,7 @@ class CompilerProductHelperHw : public CompilerProductHelper { StackVec getDeviceOpenCLCVersions(const HardwareInfo &hwInfo, OclCVersion max) const override; void adjustHwInfoForIgc(HardwareInfo &hwInfo) const override; bool isHeaplessModeEnabled() const override; - bool isHeaplessStateInitEnabled() const override; + bool isHeaplessStateInitEnabled(bool heaplessModeEnabled) const override; void getKernelFp16AtomicCapabilities(const ReleaseHelper *releaseHelper, uint32_t &fp16Caps) const override; void getKernelFp32AtomicCapabilities(uint32_t &fp32Caps) const override; void getKernelFp64AtomicCapabilities(uint32_t &fp64Caps) const override; diff --git a/shared/source/helpers/compiler_product_helper_base.inl b/shared/source/helpers/compiler_product_helper_base.inl index 595ee2e59f..2d2bcb1e8d 100644 --- a/shared/source/helpers/compiler_product_helper_base.inl +++ b/shared/source/helpers/compiler_product_helper_base.inl @@ -234,7 +234,7 @@ bool CompilerProductHelperHw::isHeaplessModeEnabled() const { } template -bool CompilerProductHelperHw::isHeaplessStateInitEnabled() const { +bool CompilerProductHelperHw::isHeaplessStateInitEnabled([[maybe_unused]] bool heaplessModeEnabled) const { return false; }