diff --git a/runtime/command_stream/command_stream_receiver.cpp b/runtime/command_stream/command_stream_receiver.cpp index 597f22ee91..0c66698e91 100644 --- a/runtime/command_stream/command_stream_receiver.cpp +++ b/runtime/command_stream/command_stream_receiver.cpp @@ -37,8 +37,8 @@ namespace OCLRT { // Global table of CommandStreamReceiver factories for HW and tests CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE] = {}; -CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvironment, size_t defaultSshSize) - : defaultSshSize(defaultSshSize), executionEnvironment(executionEnvironment) { +CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvironment) + : executionEnvironment(executionEnvironment) { latestSentStatelessMocsConfig = CacheSettings::unknownMocs; submissionAggregator.reset(new SubmissionAggregator()); if (DebugManager.flags.CsrDispatchMode.get()) { diff --git a/runtime/command_stream/command_stream_receiver.h b/runtime/command_stream/command_stream_receiver.h index d1e0a49e18..5c4a971283 100644 --- a/runtime/command_stream/command_stream_receiver.h +++ b/runtime/command_stream/command_stream_receiver.h @@ -63,7 +63,7 @@ class CommandStreamReceiver { samplerCacheFlushAfter //add sampler cache flush after Walker with redescribed image }; using MutexType = std::recursive_mutex; - CommandStreamReceiver(ExecutionEnvironment &executionEnvironment, size_t defaultSshSize); + CommandStreamReceiver(ExecutionEnvironment &executionEnvironment); virtual ~CommandStreamReceiver(); virtual FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency, OsContext &osContext) = 0; @@ -155,7 +155,7 @@ class CommandStreamReceiver { return kmdNotifyHelper.get(); } - const size_t defaultSshSize; + size_t defaultSshSize; protected: void setDisableL3Cache(bool val) { diff --git a/runtime/command_stream/command_stream_receiver_hw.h b/runtime/command_stream/command_stream_receiver_hw.h index 57ba50f3d2..42ea7509c7 100644 --- a/runtime/command_stream/command_stream_receiver_hw.h +++ b/runtime/command_stream/command_stream_receiver_hw.h @@ -99,6 +99,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver { void addDcFlushToPipeControl(typename GfxFamily::PIPE_CONTROL *pCmd, bool flushDC); void addClearSLMWorkAround(typename GfxFamily::PIPE_CONTROL *pCmd); PIPE_CONTROL *addPipeControlCmd(LinearStream &commandStream); + size_t getSshHeapSize(); uint64_t getScratchPatchAddress(); diff --git a/runtime/command_stream/command_stream_receiver_hw.inl b/runtime/command_stream/command_stream_receiver_hw.inl index c7dbf2b0aa..2efeb98553 100644 --- a/runtime/command_stream/command_stream_receiver_hw.inl +++ b/runtime/command_stream/command_stream_receiver_hw.inl @@ -40,12 +40,18 @@ namespace OCLRT { +template +size_t CommandStreamReceiverHw::getSshHeapSize() { + return defaultHeapSize; +} + template CommandStreamReceiverHw::CommandStreamReceiverHw(const HardwareInfo &hwInfoIn, ExecutionEnvironment &executionEnvironment) - : CommandStreamReceiver(executionEnvironment, defaultHeapSize), hwInfo(hwInfoIn) { + : CommandStreamReceiver(executionEnvironment), hwInfo(hwInfoIn) { requiredThreadArbitrationPolicy = PreambleHelper::getDefaultThreadArbitrationPolicy(); resetKmdNotifyHelper(new KmdNotifyHelper(&(hwInfoIn.capabilityTable.kmdNotifyProperties))); flatBatchBufferHelper.reset(new FlatBatchBufferHelperHw(this->memoryManager)); + defaultSshSize = getSshHeapSize(); } template diff --git a/unit_tests/fixtures/memory_manager_fixture.h b/unit_tests/fixtures/memory_manager_fixture.h index 0a373c5bbb..3a395f62c7 100644 --- a/unit_tests/fixtures/memory_manager_fixture.h +++ b/unit_tests/fixtures/memory_manager_fixture.h @@ -39,7 +39,7 @@ class MemoryManagerWithCsrFixture { uint32_t taskCount = 0; uint32_t currentGpuTag = initialHardwareTag; - MemoryManagerWithCsrFixture() { csr = std::make_unique(this->executionEnvironment, defaultHeapSize); } + MemoryManagerWithCsrFixture() { csr = std::make_unique(this->executionEnvironment); } ~MemoryManagerWithCsrFixture() = default; diff --git a/unit_tests/kernel/kernel_tests.cpp b/unit_tests/kernel/kernel_tests.cpp index ae8cd8cca7..734024a7d6 100644 --- a/unit_tests/kernel/kernel_tests.cpp +++ b/unit_tests/kernel/kernel_tests.cpp @@ -422,7 +422,7 @@ class CommandStreamReceiverMock : public CommandStreamReceiver { typedef CommandStreamReceiver BaseClass; public: - CommandStreamReceiverMock() : BaseClass(*(new ExecutionEnvironment), defaultHeapSize) { + CommandStreamReceiverMock() : BaseClass(*(new ExecutionEnvironment)) { this->mockExecutionEnvironment.reset(&this->executionEnvironment); } diff --git a/unit_tests/mocks/mock_csr.h b/unit_tests/mocks/mock_csr.h index e2fc9532ed..55c41fec2f 100644 --- a/unit_tests/mocks/mock_csr.h +++ b/unit_tests/mocks/mock_csr.h @@ -231,7 +231,7 @@ class MockCommandStreamReceiver : public CommandStreamReceiver { std::unique_ptr mockExecutionEnvironment; - MockCommandStreamReceiver() : CommandStreamReceiver(*(new ExecutionEnvironment), defaultHeapSize) { + MockCommandStreamReceiver() : CommandStreamReceiver(*(new ExecutionEnvironment)) { mockExecutionEnvironment.reset(&this->executionEnvironment); }