Add DeviceBitfield argument to CSR constructor

Related-To: NEO-5225

Change-Id: I8cf0aef3ec16314cfb1a787852b6c20ce0f65955
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2020-10-28 16:08:37 +01:00
parent 609f97d752
commit 30a67618f8
115 changed files with 841 additions and 708 deletions

View File

@@ -32,8 +32,8 @@ namespace NEO {
// Global table of CommandStreamReceiver factories for HW and tests
CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE] = {};
CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex)
: executionEnvironment(executionEnvironment), rootDeviceIndex(rootDeviceIndex) {
CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield)
: executionEnvironment(executionEnvironment), rootDeviceIndex(rootDeviceIndex), deviceBitfield(deviceBitfield) {
residencyAllocations.reserve(20);
latestSentStatelessMocsConfig = CacheSettings::unknownMocs;

View File

@@ -13,6 +13,7 @@
#include "shared/source/command_stream/thread_arbitration_policy.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/blit_commands_helper.h"
#include "shared/source/helpers/common_types.h"
#include "shared/source/helpers/completion_stamp.h"
#include "shared/source/helpers/flat_batch_buffer_helper.h"
#include "shared/source/helpers/options.h"
@@ -64,7 +65,7 @@ class CommandStreamReceiver {
};
using MutexType = std::recursive_mutex;
CommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
CommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield);
virtual ~CommandStreamReceiver();
virtual bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) = 0;
@@ -234,6 +235,7 @@ class CommandStreamReceiver {
std::unique_ptr<TagAllocator<HwTimeStamps>> profilingTimeStampAllocator;
std::unique_ptr<TagAllocator<HwPerfCounter>> perfCounterAllocator;
std::unique_ptr<TagAllocator<TimestampPacketStorage>> timestampPacketAllocator;
std::unique_ptr<Thread> userPauseConfirmation;
ResidencyContainer residencyAllocations;
ResidencyContainer evictionAllocations;
@@ -242,14 +244,13 @@ class CommandStreamReceiver {
LinearStream commandStream;
volatile uint32_t *tagAddress = nullptr;
volatile DebugPauseState *debugPauseStateAddress = nullptr;
// offset for debug state must be 8 bytes, if only 4 bytes are used tag writes overwrite it
const uint64_t debugPauseStateAddressOffset = 8;
uint64_t totalMemoryUsed = 0u;
volatile uint32_t *tagAddress = nullptr;
volatile DebugPauseState *debugPauseStateAddress = nullptr;
static void *asyncDebugBreakConfirmation(void *arg);
std::unique_ptr<Thread> userPauseConfirmation;
std::function<void()> debugConfirmationFunction = []() { std::cin.get(); };
GraphicsAllocation *tagAllocation = nullptr;
@@ -259,20 +260,18 @@ class CommandStreamReceiver {
GraphicsAllocation *perDssBackedBuffer = nullptr;
IndirectHeap *indirectHeap[IndirectHeap::NUM_TYPES];
OsContext *osContext = nullptr;
// current taskLevel. Used for determining if a PIPE_CONTROL is needed.
std::atomic<uint32_t> taskLevel{0};
std::atomic<uint32_t> latestSentTaskCount{0};
std::atomic<uint32_t> latestFlushedTaskCount{0};
// taskCount - # of tasks submitted
std::atomic<uint32_t> taskCount{0};
OsContext *osContext = nullptr;
DispatchMode dispatchMode = DispatchMode::ImmediateDispatch;
SamplerCacheFlushState samplerCacheFlushRequired = SamplerCacheFlushState::samplerCacheFlushNotRequired;
PreemptionMode lastPreemptionMode = PreemptionMode::Initial;
uint64_t totalMemoryUsed = 0u;
// taskCount - # of tasks submitted
std::atomic<uint32_t> taskCount{0};
uint32_t lastSentL3Config = 0;
uint32_t latestSentStatelessMocsConfig = 0;
@@ -283,8 +282,10 @@ class CommandStreamReceiver {
uint32_t requiredScratchSize = 0;
uint32_t requiredPrivateScratchSize = 0;
uint32_t lastAdditionalKernelExecInfo = AdditionalKernelExecInfo::NotSet;
const uint32_t rootDeviceIndex;
DeviceBitfield deviceBitfield;
int8_t lastSentCoherencyRequest = -1;
int8_t lastMediaSamplerConfig = -1;
@@ -304,12 +305,11 @@ class CommandStreamReceiver {
bool localMemoryEnabled = false;
bool pageTableManagerInitialized = false;
uint32_t lastAdditionalKernelExecInfo = AdditionalKernelExecInfo::NotSet;
bool useNewResourceImplicitFlush = false;
bool newResources = false;
bool useGpuIdleImplicitFlush = false;
};
typedef CommandStreamReceiver *(*CommandStreamReceiverCreateFunc)(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
typedef CommandStreamReceiver *(*CommandStreamReceiverCreateFunc)(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield);
} // namespace NEO

View File

@@ -27,11 +27,11 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
typedef typename GfxFamily::PIPE_CONTROL PIPE_CONTROL;
public:
static CommandStreamReceiver *create(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) {
return new CommandStreamReceiverHw<GfxFamily>(executionEnvironment, rootDeviceIndex);
static CommandStreamReceiver *create(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) {
return new CommandStreamReceiverHw<GfxFamily>(executionEnvironment, rootDeviceIndex, deviceBitfield);
}
CommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
CommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield);
~CommandStreamReceiverHw() override;
bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override;

View File

@@ -40,8 +40,10 @@ template <typename GfxFamily>
CommandStreamReceiverHw<GfxFamily>::~CommandStreamReceiverHw() = default;
template <typename GfxFamily>
CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex)
: CommandStreamReceiver(executionEnvironment, rootDeviceIndex) {
CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment,
uint32_t rootDeviceIndex,
DeviceBitfield deviceBitfield)
: CommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield) {
auto &hwHelper = HwHelper::get(peekHwInfo().platform.eRenderCoreFamily);
localMemoryEnabled = hwHelper.getEnableLocalMemory(peekHwInfo());

View File

@@ -15,11 +15,11 @@ class DeviceCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily> {
typedef CommandStreamReceiverHw<GfxFamily> BaseClass;
protected:
DeviceCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex)
: BaseClass(executionEnvironment, rootDeviceIndex) {
DeviceCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield)
: BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield) {
}
public:
static CommandStreamReceiver *create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
static CommandStreamReceiver *create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield);
};
} // namespace NEO