Remove LSH from CommandQueue

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2022-07-04 14:16:44 +00:00
committed by Compute-Runtime-Automation
parent 7b2960f891
commit 52b00a11b0
23 changed files with 27 additions and 46 deletions

View File

@ -144,7 +144,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
}
}
this->logicalStateHelper.reset(NEO::LogicalStateHelper::create<GfxFamily>(true));
this->logicalStateHelper.reset(NEO::LogicalStateHelper::create<GfxFamily>());
return returnType;
}

View File

@ -377,7 +377,7 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandLists(
frontEndStateDirty = false;
}
csr->getLogicalStateHelper()->writeStreamInline(child);
csr->getLogicalStateHelper()->writeStreamInline(child, false);
}
for (auto i = 0u; i < numCommandLists; ++i) {

View File

@ -12,7 +12,6 @@
#include "shared/source/helpers/array_count.h"
#include "shared/source/helpers/engine_node_helper.h"
#include "shared/source/helpers/get_info.h"
#include "shared/source/helpers/logical_state_helper.h"
#include "shared/source/helpers/ptr_math.h"
#include "shared/source/helpers/string.h"
#include "shared/source/helpers/timestamp_packet.h"
@ -1230,8 +1229,4 @@ void CommandQueue::clearLastBcsPackets() {
}
}
LogicalStateHelper *CommandQueue::getLogicalStateHelper() const {
return logicalStateHelper.get();
}
} // namespace NEO

View File

@ -35,7 +35,6 @@ class IndirectHeap;
class Kernel;
class MemObj;
class PerformanceCounters;
class LogicalStateHelper;
struct CompletionStamp;
struct MultiDispatchInfo;
@ -359,8 +358,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
bool isTextureCacheFlushNeeded(uint32_t commandType) const;
LogicalStateHelper *getLogicalStateHelper() const;
protected:
void *enqueueReadMemObjForMap(TransferProperties &transferProperties, EventsRequest &eventsRequest, cl_int &errcodeRet);
cl_int enqueueWriteMemObjForUnmap(MemObj *memObj, void *mappedPtr, EventsRequest &eventsRequest);
@ -428,7 +425,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
std::unique_ptr<TimestampPacketContainer> deferredTimestampPackets;
std::unique_ptr<TimestampPacketContainer> timestampPacketContainer;
std::unique_ptr<LogicalStateHelper> logicalStateHelper;
struct BcsTimestampPacketContainers {
TimestampPacketContainer lastBarrierToWaitFor;

View File

@ -10,7 +10,6 @@
#include "shared/source/command_stream/preemption.h"
#include "shared/source/helpers/engine_control.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/logical_state_helper.h"
#include "shared/source/memory_manager/graphics_allocation.h"
#include "opencl/source/cl_device/cl_device.h"
@ -38,8 +37,6 @@ class CommandQueueHw : public CommandQueue {
const cl_queue_properties *properties,
bool internalUsage) : BaseClass(context, device, properties, internalUsage) {
logicalStateHelper.reset(LogicalStateHelper::create<GfxFamily>(true));
auto clPriority = getCmdQueueProperties<cl_queue_priority_khr>(properties, CL_QUEUE_PRIORITY_KHR);
if (clPriority & static_cast<cl_queue_priority_khr>(CL_QUEUE_PRIORITY_LOW_KHR)) {

View File

@ -10,7 +10,6 @@
#include "shared/source/helpers/array_count.h"
#include "shared/source/helpers/basic_math.h"
#include "shared/source/helpers/engine_node_helper.h"
#include "shared/source/helpers/logical_state_helper.h"
#include "shared/source/helpers/timestamp_packet.h"
#include "shared/source/memory_manager/internal_allocation_storage.h"
#include "shared/source/memory_manager/memory_manager.h"
@ -415,15 +414,6 @@ HWTEST_F(CommandQueueCommandStreamTest, givenCommandQueueThatWaitsOnAbortedUserE
EXPECT_EQ(100u, cmdQ.taskLevel);
}
HWTEST_F(CommandQueueCommandStreamTest, whenCreatingThenDontCreateLogicalStateHelper) {
MockContext context;
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockCommandQueueHw<FamilyType> cmdQ(&context, mockDevice.get(), nullptr);
EXPECT_EQ(nullptr, cmdQ.logicalStateHelper.get());
}
HWTEST_F(CommandQueueCommandStreamTest, WhenCheckIsTextureCacheFlushNeededThenReturnProperValue) {
MockContext context;
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));

View File

@ -66,7 +66,7 @@ HWTEST_F(EnqueueHandlerTest, givenLogicalStateHelperWhenDispatchingCommandsThenA
using MI_NOOP = typename FamilyType::MI_NOOP;
auto mockCmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(context, pClDevice, nullptr);
auto logicalStateHelper = new LogicalStateHelperMock<FamilyType>(false);
auto logicalStateHelper = new LogicalStateHelperMock<FamilyType>();
auto &ultCsr = static_cast<UltCommandStreamReceiver<FamilyType> &>(mockCmdQ->getGpgpuCommandStreamReceiver());
ultCsr.logicalStateHelper.reset(logicalStateHelper);

View File

@ -1479,6 +1479,5 @@ HWTEST_F(HwHelperTest, givenHwHelperWhenPassingComputeEngineTypeThenItsNotCopyOn
using LogicalStateHelperTest = ::testing::Test;
HWTEST_F(LogicalStateHelperTest, whenCreatingLogicalStateHelperThenReturnNullptr) {
EXPECT_EQ(nullptr, LogicalStateHelper::create<FamilyType>(true));
EXPECT_EQ(nullptr, LogicalStateHelper::create<FamilyType>(false));
EXPECT_EQ(nullptr, LogicalStateHelper::create<FamilyType>());
}

View File

@ -243,7 +243,6 @@ class MockCommandQueueHw : public CommandQueueHw<GfxFamily> {
using BaseClass::gpgpuEngine;
using BaseClass::isBlitAuxTranslationRequired;
using BaseClass::latestSentEnqueueType;
using BaseClass::logicalStateHelper;
using BaseClass::obtainCommandStream;
using BaseClass::obtainNewTimestampPacketNodes;
using BaseClass::requiresCacheFlushAfterWalker;

View File

@ -12,6 +12,7 @@
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/constants.h"
#include "shared/source/helpers/logical_state_helper.h"
#include "shared/source/helpers/ptr_math.h"
#include "shared/source/helpers/timestamp_packet.h"
#include "shared/source/os_interface/linux/allocator_helper.h"
@ -30,6 +31,7 @@
#include "shared/test/common/test_macros/hw_test.h"
#include "shared/test/unit_test/helpers/gtest_helpers.h"
#include "opencl/source/command_queue/command_queue.h"
#include "opencl/source/event/event.h"
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
#include "opencl/source/mem_obj/buffer.h"
@ -483,6 +485,9 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreat
MockContext context(pClDevice);
auto testedCsr = static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(context.getSpecialQueue(rootDeviceIndex)->getGpgpuEngine().commandStreamReceiver);
testedCsr->logicalStateHelper.reset(LogicalStateHelper::create<FamilyType>());
cl_image_format imageFormat;
imageFormat.image_channel_data_type = CL_UNORM_INT8;
imageFormat.image_channel_order = CL_R;

View File

@ -75,7 +75,7 @@ CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiverHw(ExecutionEnvironment
timestampPacketWriteEnabled = !!DebugManager.flags.EnableTimestampPacket.get();
}
logicalStateHelper.reset(LogicalStateHelper::create<GfxFamily>(false));
logicalStateHelper.reset(LogicalStateHelper::create<GfxFamily>());
createScratchSpaceController();
configurePostSyncWriteOffset();
@ -540,7 +540,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
}
if (logicalStateHelper) {
logicalStateHelper->writeStreamInline(commandStreamCSR);
logicalStateHelper->writeStreamInline(commandStreamCSR, false);
}
// If the CSR has work in its CS, flush it before the task
@ -1069,7 +1069,7 @@ std::optional<uint32_t> CommandStreamReceiverHw<GfxFamily>::flushBcsTask(const B
}
if (logicalStateHelper) {
logicalStateHelper->writeStreamInline(commandStream);
logicalStateHelper->writeStreamInline(commandStream, false);
}
for (auto &blitProperties : blitPropertiesContainer) {

View File

@ -646,7 +646,7 @@ void DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchSystemMemoryFenceAddress
EncodeMemoryFence<GfxFamily>::encodeSystemMemoryFence(ringCommandStream, this->globalFenceAllocation, this->logicalStateHelper);
if (logicalStateHelper) {
logicalStateHelper->writeStreamInline(ringCommandStream);
logicalStateHelper->writeStreamInline(ringCommandStream, false);
}
}

View File

@ -41,5 +41,5 @@ template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;
template struct LriHelper<Family>;
template LogicalStateHelper *LogicalStateHelper::create<Family>(bool pipelinedState);
template LogicalStateHelper *LogicalStateHelper::create<Family>();
} // namespace NEO

View File

@ -214,5 +214,5 @@ template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;
template struct LriHelper<Family>;
template LogicalStateHelper *LogicalStateHelper::create<Family>(bool pipelinedState);
template LogicalStateHelper *LogicalStateHelper::create<Family>();
} // namespace NEO

View File

@ -82,5 +82,5 @@ template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;
template struct LriHelper<Family>;
template LogicalStateHelper *LogicalStateHelper::create<Family>(bool pipelinedState);
template LogicalStateHelper *LogicalStateHelper::create<Family>();
} // namespace NEO

View File

@ -52,5 +52,5 @@ template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;
template struct LriHelper<Family>;
template LogicalStateHelper *LogicalStateHelper::create<Family>(bool pipelinedState);
template LogicalStateHelper *LogicalStateHelper::create<Family>();
} // namespace NEO

View File

@ -13,15 +13,14 @@ class LinearStream;
class LogicalStateHelper {
public:
template <typename Family>
static LogicalStateHelper *create(bool pipelinedState);
static LogicalStateHelper *create();
virtual ~LogicalStateHelper() = default;
virtual void writeStreamInline(LinearStream &linearStream) = 0;
virtual void writeStreamInline(LinearStream &linearStream, bool pipelinedState) = 0;
protected:
LogicalStateHelper(bool pipelinedState){};
LogicalStateHelper() = delete;
LogicalStateHelper() = default;
};
} // namespace NEO

View File

@ -10,7 +10,7 @@
namespace NEO {
template <typename GfxFamily>
LogicalStateHelper *LogicalStateHelper::create(bool pipelinedState) {
LogicalStateHelper *LogicalStateHelper::create() {
return nullptr;
}

View File

@ -157,5 +157,5 @@ template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;
template struct LriHelper<Family>;
template LogicalStateHelper *LogicalStateHelper::create<Family>(bool pipelinedState);
template LogicalStateHelper *LogicalStateHelper::create<Family>();
} // namespace NEO

View File

@ -460,5 +460,5 @@ template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;
template struct LriHelper<Family>;
template LogicalStateHelper *LogicalStateHelper::create<Family>(bool pipelinedState);
template LogicalStateHelper *LogicalStateHelper::create<Family>();
} // namespace NEO

View File

@ -153,5 +153,5 @@ template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;
template struct LriHelper<Family>;
template LogicalStateHelper *LogicalStateHelper::create<Family>(bool pipelinedState);
template LogicalStateHelper *LogicalStateHelper::create<Family>();
} // namespace NEO

View File

@ -24,6 +24,7 @@ class TestedDrmCommandStreamReceiver : public DrmCommandStreamReceiver<GfxFamily
using CommandStreamReceiver::getTagAllocation;
using CommandStreamReceiver::globalFenceAllocation;
using CommandStreamReceiver::latestSentTaskCount;
using CommandStreamReceiver::logicalStateHelper;
using CommandStreamReceiver::makeResident;
using CommandStreamReceiver::postSyncWriteOffset;
using CommandStreamReceiver::tagAddress;

View File

@ -15,10 +15,10 @@ namespace NEO {
template <typename GfxFamily>
class LogicalStateHelperMock : public GfxFamily::LogicalStateHelperHw {
public:
LogicalStateHelperMock(bool pipelinedState) : GfxFamily::LogicalStateHelperHw(pipelinedState) {
LogicalStateHelperMock() : GfxFamily::LogicalStateHelperHw() {
}
void writeStreamInline(LinearStream &linearStream) override {
void writeStreamInline(LinearStream &linearStream, bool pipelinedState) override {
writeStreamInlineCalledCounter++;
auto cmd = linearStream.getSpaceForCmd<typename GfxFamily::MI_NOOP>();