mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
Grf configuration
Change-Id: I3741f53a38c6707b0c8ad82ae553ea65ae6917e4 Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "runtime/helpers/completion_stamp.h"
|
||||
#include "runtime/helpers/flat_batch_buffer_helper.h"
|
||||
#include "runtime/helpers/options.h"
|
||||
#include "runtime/kernel/grf_config.h"
|
||||
#include "runtime/indirect_heap/indirect_heap.h"
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
@@ -179,6 +180,7 @@ class CommandStreamReceiver {
|
||||
int8_t lastMediaSamplerConfig = -1;
|
||||
PreemptionMode lastPreemptionMode = PreemptionMode::Initial;
|
||||
uint32_t latestSentStatelessMocsConfig = 0;
|
||||
uint32_t lastSentNumGrfRequired = GrfConfig::DefaultGrfNumber;
|
||||
|
||||
LinearStream commandStream;
|
||||
|
||||
|
||||
@@ -50,9 +50,9 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
|
||||
size_t getCmdSizeForPreemption(const DispatchFlags &dispatchFlags) const;
|
||||
size_t getCmdSizeForL3Config() const;
|
||||
size_t getCmdSizeForPipelineSelect() const;
|
||||
size_t getCmdSizeForCoherency();
|
||||
size_t getCmdSizeForComputeMode();
|
||||
size_t getCmdSizeForMediaSampler(bool mediaSamplerRequired) const;
|
||||
void programCoherency(LinearStream &csr, DispatchFlags &dispatchFlags);
|
||||
void programComputeMode(LinearStream &csr, DispatchFlags &dispatchFlags);
|
||||
|
||||
void waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, OsContext &osContext) override;
|
||||
const HardwareInfo &peekHwInfo() const { return hwInfo; }
|
||||
|
||||
@@ -228,6 +228,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
csrSizeRequestFlags.coherencyRequestChanged = this->lastSentCoherencyRequest != static_cast<int8_t>(dispatchFlags.requiresCoherency);
|
||||
csrSizeRequestFlags.preemptionRequestChanged = this->lastPreemptionMode != dispatchFlags.preemptionMode;
|
||||
csrSizeRequestFlags.mediaSamplerConfigChanged = this->lastMediaSamplerConfig != static_cast<int8_t>(dispatchFlags.mediaSamplerRequired);
|
||||
csrSizeRequestFlags.numGrfRequiredChanged = this->lastSentNumGrfRequired != dispatchFlags.numGrfRequired;
|
||||
|
||||
size_t requiredScratchSizeInBytes = requiredScratchSize * device.getDeviceInfo().computeUnitsUsedForScratch;
|
||||
|
||||
@@ -255,7 +256,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
}
|
||||
initPageTableManagerRegisters(commandStreamCSR);
|
||||
programPreemption(commandStreamCSR, device, dispatchFlags);
|
||||
programCoherency(commandStreamCSR, dispatchFlags);
|
||||
programComputeMode(commandStreamCSR, dispatchFlags);
|
||||
programL3(commandStreamCSR, dispatchFlags, newL3Config);
|
||||
programPipelineSelect(commandStreamCSR, dispatchFlags);
|
||||
programPreamble(commandStreamCSR, device, dispatchFlags, newL3Config);
|
||||
@@ -628,7 +629,7 @@ size_t CommandStreamReceiverHw<GfxFamily>::getRequiredCmdStreamSize(const Dispat
|
||||
size += sizeof(typename GfxFamily::MI_BATCH_BUFFER_START);
|
||||
|
||||
size += getCmdSizeForL3Config();
|
||||
size += getCmdSizeForCoherency();
|
||||
size += getCmdSizeForComputeMode();
|
||||
size += getCmdSizeForMediaSampler(dispatchFlags.mediaSamplerRequired);
|
||||
size += getCmdSizeForPipelineSelect();
|
||||
size += getCmdSizeForPreemption(dispatchFlags);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "runtime/memory_manager/memory_constants.h"
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/helpers/properties_helper.h"
|
||||
#include "runtime/kernel/grf_config.h"
|
||||
#include <limits>
|
||||
|
||||
namespace OCLRT {
|
||||
@@ -43,6 +44,7 @@ struct DispatchFlags {
|
||||
FlushStampTrackingObj *flushStampReference = nullptr;
|
||||
PreemptionMode preemptionMode = PreemptionMode::Disabled;
|
||||
EventsRequest *outOfDeviceDependencies = nullptr;
|
||||
uint32_t numGrfRequired = GrfConfig::DefaultGrfNumber;
|
||||
};
|
||||
|
||||
struct CsrSizeRequestFlags {
|
||||
@@ -51,5 +53,6 @@ struct CsrSizeRequestFlags {
|
||||
bool preemptionRequestChanged = false;
|
||||
bool mediaSamplerConfigChanged = false;
|
||||
bool hasSharedHandles = false;
|
||||
bool numGrfRequiredChanged = false;
|
||||
};
|
||||
} // namespace OCLRT
|
||||
|
||||
Reference in New Issue
Block a user