feature: Add heapless mode programming in ocl

Related-To: NEO-7621
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-11-23 13:58:58 +00:00
committed by Compute-Runtime-Automation
parent c35b13ccae
commit ce7298d512
82 changed files with 1927 additions and 1224 deletions

View File

@@ -25,6 +25,7 @@
#include "shared/source/gmm_helper/page_table_mngr.h"
#include "shared/source/helpers/api_specific_config.h"
#include "shared/source/helpers/array_count.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/flat_batch_buffer_helper.h"
#include "shared/source/helpers/flush_stamp.h"
#include "shared/source/helpers/gfx_core_helper.h"
@@ -96,6 +97,9 @@ CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvi
this->l1CachePolicyData.init(productHelper);
registeredClients.reserve(16);
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled();
}
CommandStreamReceiver::~CommandStreamReceiver() {

View File

@@ -573,6 +573,7 @@ class CommandStreamReceiver {
volatile bool resourcesInitialized = false;
bool doubleSbaWa = false;
bool dshSupported = false;
bool heaplessModeEnabled = false;
};
typedef CommandStreamReceiver *(*CommandStreamReceiverCreateFunc)(bool withAubDump,

View File

@@ -20,8 +20,9 @@ struct PipeControlArgs;
template <typename GfxFamily>
class CommandStreamReceiverHw : public CommandStreamReceiver {
typedef typename GfxFamily::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START;
typedef typename GfxFamily::PIPE_CONTROL PIPE_CONTROL;
using MI_BATCH_BUFFER_START = typename GfxFamily::MI_BATCH_BUFFER_START;
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS;
struct ImmediateFlushData {
PipelineSelectArgs pipelineSelectArgs{};
@@ -176,6 +177,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
}
void dispatchRayTracingStateCommand(LinearStream &cmdStream, Device &device);
uint64_t getScratchPatchAddress();
protected:
void programPreemption(LinearStream &csr, DispatchFlags &dispatchFlags);
@@ -202,7 +204,6 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
void addPipeControlBefore3dState(LinearStream &commandStream, DispatchFlags &dispatchFlags);
bool are4GbHeapsAvailable() const;
uint64_t getScratchPatchAddress();
void createScratchSpaceController();
bool detectInitProgrammingFlagsRequired(const DispatchFlags &dispatchFlags) const;

View File

@@ -27,6 +27,7 @@
#include "shared/source/gmm_helper/page_table_mngr.h"
#include "shared/source/helpers/blit_commands_helper.h"
#include "shared/source/helpers/blit_properties.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/definitions/command_encoder_args.h"
#include "shared/source/helpers/engine_node_helper.h"
#include "shared/source/helpers/flat_batch_buffer_helper_hw.h"
@@ -505,7 +506,9 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
dispatchRayTracingStateCommand(commandStreamCSR, device);
}
programVFEState(commandStreamCSR, dispatchFlags, device.getDeviceInfo().maxFrontEndThreads);
if (this->heaplessModeEnabled == false) {
programVFEState(commandStreamCSR, dispatchFlags, device.getDeviceInfo().maxFrontEndThreads);
}
programPreemption(commandStreamCSR, dispatchFlags);

View File

@@ -78,8 +78,8 @@ class PreemptionHelper {
static PreemptionMode getDefaultPreemptionMode(const HardwareInfo &hwInfo);
template <typename GfxFamily>
static void programInterfaceDescriptorDataPreemption(INTERFACE_DESCRIPTOR_DATA<GfxFamily> *idd, PreemptionMode preemptionMode);
template <typename GfxFamily, typename InterfaceDescriptorType>
static void programInterfaceDescriptorDataPreemption(InterfaceDescriptorType *idd, PreemptionMode preemptionMode);
protected:
template <typename GfxFamily>

View File

@@ -118,8 +118,8 @@ template <typename GfxFamily>
void PreemptionHelper::applyPreemptionWaCmdsEnd(LinearStream *pCommandStream, const Device &device) {
}
template <typename GfxFamily>
void PreemptionHelper::programInterfaceDescriptorDataPreemption(INTERFACE_DESCRIPTOR_DATA<GfxFamily> *idd, PreemptionMode preemptionMode) {
template <typename GfxFamily, typename InterfaceDescriptorType>
void PreemptionHelper::programInterfaceDescriptorDataPreemption(InterfaceDescriptorType *idd, PreemptionMode preemptionMode) {
using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA;
if (preemptionMode == PreemptionMode::MidThread) {
idd->setThreadPreemptionDisable(INTERFACE_DESCRIPTOR_DATA::THREAD_PREEMPTION_DISABLE_DISABLE);