Add method and debug flag to obtain aux translation mode

Change-Id: I86ab1f7847ce61bf653e6be2affd5dafb4f8b211
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-10-31 10:19:52 +01:00
committed by sys_ocldev
parent fed673861f
commit 63f177e9dc
7 changed files with 21 additions and 5 deletions

View File

@@ -104,7 +104,7 @@ cl_int CommandQueueHw<Family>::enqueueMarkerForReadWriteOperation(MemObj *memObj
template <typename Family>
void CommandQueueHw<Family>::dispatchAuxTranslationBuiltin(MultiDispatchInfo &multiDispatchInfo,
AuxTranslationDirection auxTranslationDirection) {
if (DebugManager.flags.DisableAuxTranslationBuiltinDispatch.get()) {
if (HwHelperHw<Family>::getAuxTranslationMode() != AuxTranslationMode::Builtin) {
return;
}

View File

@@ -170,6 +170,8 @@ class HwHelperHw : public HwHelper {
bool tilingAllowed(bool isSharedContext, const cl_image_desc &imgDesc, bool forceLinearStorage) override;
static AuxTranslationMode getAuxTranslationMode();
protected:
HwHelperHw() = default;
};

View File

@@ -151,6 +151,15 @@ bool HwHelperHw<Family>::getEnableLocalMemory(const HardwareInfo &hwInfo) const
return OSInterface::osEnableLocalMemory && isLocalMemoryEnabled(hwInfo);
}
template <typename Family>
AuxTranslationMode HwHelperHw<Family>::getAuxTranslationMode() {
if (DebugManager.flags.ForceAuxTranslationMode.get() != -1) {
return static_cast<AuxTranslationMode>(DebugManager.flags.ForceAuxTranslationMode.get());
}
return AuxTranslationMode::Builtin;
}
template <typename Family>
typename Family::PIPE_CONTROL *PipeControlHelper<Family>::obtainPipeControlAndProgramPostSyncOperation(LinearStream &commandStream,
POST_SYNC_OPERATION operation,

View File

@@ -44,6 +44,11 @@ enum class AuxTranslationDirection {
NonAuxToAux
};
enum class AuxTranslationMode : int32_t {
Builtin = 0,
Blit = 1
};
struct TransferProperties {
TransferProperties() = delete;

View File

@@ -40,6 +40,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, SchedulerGWS, 0, "Forces gws of scheduler kernel
DECLARE_DEBUG_VARIABLE(int32_t, EnableExperimentalCommandBuffer, 0, "Enables injection of experimental command buffer")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideStatelessMocsIndex, -1, "-1: feature inactive, >=0 : following MOCS index will be programmed for stateless accesses in state base address")
DECLARE_DEBUG_VARIABLE(int32_t, CFEFusedEUDispatch, -1, "Set Fused EU dispatch in FrontEnd State command. -1 - do not set")
DECLARE_DEBUG_VARIABLE(int32_t, ForceAuxTranslationMode, -1, "-1: Default, 0: Builtin, 1: Blit")
DECLARE_DEBUG_VARIABLE(bool, EnableDebugBreak, true, "Enable DEBUG_BREAKs")
DECLARE_DEBUG_VARIABLE(bool, FlushAllCaches, false, "pipe controls between enqueues flush all possible caches")
DECLARE_DEBUG_VARIABLE(bool, MakeEachEnqueueBlocking, false, "equivalent of finish after each enqueue")
@@ -53,7 +54,6 @@ DECLARE_DEBUG_VARIABLE(bool, LoopAtPlatformInitialize, false, "Adds endless loop
DECLARE_DEBUG_VARIABLE(bool, DoNotRegisterTrimCallback, false, "When set to true driver is not registering trim callback.")
DECLARE_DEBUG_VARIABLE(bool, OverrideInvalidEngineWithDefault, false, "When set to true driver chooses engine 0 if no engine is found.")
DECLARE_DEBUG_VARIABLE(bool, DisableAuxTranslation, false, "Disable aux translation when required by Kernel.")
DECLARE_DEBUG_VARIABLE(bool, DisableAuxTranslationBuiltinDispatch, false, "Disable aux translation builtin dispatch when required.")
/*LOGGING FLAGS*/
DECLARE_DEBUG_VARIABLE(bool, PrintDebugSettings, false, "Enables dumping debug variables settings to text file")

View File

@@ -804,9 +804,9 @@ HWTEST_F(EnqueueAuxKernelTests, givenKernelWithRequiredAuxTranslationWhenEnqueue
EXPECT_TRUE(kernelAfter->isBuiltIn);
}
HWTEST_F(EnqueueAuxKernelTests, givenDebugVariableSetWhenDispatchingKernelWithRequiredAuxTranslationThenDontDispatch) {
HWTEST_F(EnqueueAuxKernelTests, givenDebugVariableDisablingBuiltinTranslationWhenDispatchingKernelWithRequiredAuxTranslationThenDontDispatch) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.DisableAuxTranslationBuiltinDispatch.set(true);
DebugManager.flags.ForceAuxTranslationMode.set(static_cast<int32_t>(AuxTranslationMode::Blit));
MockKernelWithInternals mockKernel(*pDevice, context);
MyCmdQ<FamilyType> cmdQ(context, pDevice);

View File

@@ -116,7 +116,7 @@ AllowOpenFdOperations = 0
EnableBlitterOperationsSupport = -1
EnableBlitterOperationsForReadWriteBuffers = -1
DisableAuxTranslation = 0
DisableAuxTranslationBuiltinDispatch = 0
ForceAuxTranslationMode = -1
EnableFreeMemory = 0
OverrideStatelessMocsIndex = -1
CFEFusedEUDispatch = -1