Add posibility to modify semaphore delay between waits

Change-Id: Ia44c8ea67ef0bd16436c708d83bda15b4bb77b6e
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska
2020-06-24 14:53:51 +02:00
committed by sys_ocldev
parent c2ebf77e1e
commit 2807dfeae8
9 changed files with 104 additions and 2 deletions

View File

@@ -48,6 +48,7 @@ struct PreambleHelper {
uint32_t requiredThreadArbitrationPolicy, GraphicsAllocation *preemptionCsr, GraphicsAllocation *perDssBackedBuffer);
static void programKernelDebugging(LinearStream *pCommandStream);
static void programPerDssBackedBuffer(LinearStream *pCommandStream, const HardwareInfo &hwInfo, GraphicsAllocation *perDssBackBufferOffset);
static void programSemaphoreDelay(LinearStream *pCommandStream);
static uint32_t getL3Config(const HardwareInfo &hwInfo, bool useSLM);
static bool isL3Configurable(const HardwareInfo &hwInfo);
static size_t getAdditionalCommandsSize(const Device &device);
@@ -58,6 +59,7 @@ struct PreambleHelper {
static uint32_t getUrbEntryAllocationSize();
static size_t getPerDssBackedBufferCommandsSize(const HardwareInfo &hwInfo);
static size_t getCmdSizeForPipelineSelect(const HardwareInfo &hwInfo);
static size_t getSemaphoreDelayCommandSize();
};
template <PRODUCT_FAMILY ProductFamily>

View File

@@ -11,6 +11,7 @@
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/hw_cmds.h"
#include "shared/source/helpers/preamble.h"
#include "shared/source/helpers/register_offsets.h"
#include "opencl/source/helpers/hardware_commands_helper.h"
#include "opencl/source/kernel/kernel.h"
@@ -48,6 +49,22 @@ size_t PreambleHelper<GfxFamily>::getPerDssBackedBufferCommandsSize(const Hardwa
return 0;
}
template <typename GfxFamily>
void PreambleHelper<GfxFamily>::programSemaphoreDelay(LinearStream *pCommandStream) {
if (DebugManager.flags.ForceSemaphoreDelayBetweenWaits.get() > -1) {
uint32_t valueOfNewSemaphoreDelay = DebugManager.flags.ForceSemaphoreDelayBetweenWaits.get();
LriHelper<GfxFamily>::program(pCommandStream,
SEMA_WAIT_POLL,
valueOfNewSemaphoreDelay,
true);
};
}
template <typename GfxFamily>
size_t PreambleHelper<GfxFamily>::getSemaphoreDelayCommandSize() {
return sizeof(MI_LOAD_REGISTER_IMM);
}
template <typename GfxFamily>
size_t PreambleHelper<GfxFamily>::getAdditionalCommandsSize(const Device &device) {
size_t totalSize = PreemptionHelper::getRequiredPreambleSize<GfxFamily>(device);
@@ -79,6 +96,7 @@ void PreambleHelper<GfxFamily>::programPreamble(LinearStream *pCommandStream, De
if (perDssBackedBuffer != nullptr) {
programPerDssBackedBuffer(pCommandStream, device.getHardwareInfo(), perDssBackedBuffer);
}
programSemaphoreDelay(pCommandStream);
}
template <typename GfxFamily>

View File

@@ -40,6 +40,7 @@ constexpr uint32_t CS_GPR_R15 = 0x2678;
constexpr uint32_t CS_PREDICATE_RESULT = 0x2418;
constexpr uint32_t SEMA_WAIT_POLL = 0x0224c;
//Alu opcodes
constexpr uint32_t NUM_ALU_INST_FOR_READ_MODIFY_WRITE = 4;