From 9b85e9375798cf997d3e48f3a551534384f245be Mon Sep 17 00:00:00 2001 From: Krzysztof Gibala Date: Thu, 16 Apr 2020 16:53:09 +0200 Subject: [PATCH] Add reg key to disable caching for stateful buffer Change-Id: I7d70fa6f1ef869588f9a19c9dc43f49d531bf814 Signed-off-by: Krzysztof Gibala --- Jenkinsfile | 2 +- opencl/source/mem_obj/buffer_base.inl | 7 +++++++ opencl/test/unit_test/test_files/igdrcl.config | 1 + shared/source/debug_settings/debug_variables_base.inl | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d6a73c835b..2388f29aee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ #!groovy dependenciesRevision='3232e5d67b5c3dd2323f13bede3ab1558b5aa4b9-1401' strategy='EQUAL' -allowedCD=246 +allowedCD=247 allowedF=20 diff --git a/opencl/source/mem_obj/buffer_base.inl b/opencl/source/mem_obj/buffer_base.inl index e2bf2b9884..6a9e449020 100644 --- a/opencl/source/mem_obj/buffer_base.inl +++ b/opencl/source/mem_obj/buffer_base.inl @@ -6,7 +6,9 @@ */ #include "shared/source/execution_environment/execution_environment.h" +#include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gmm_helper/gmm.h" +#include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/gmm_helper/resource_info.h" #include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/bit_helpers.h" @@ -81,6 +83,11 @@ void BufferHw::setArgStateful(void *memory, bool forceNonAuxMode, boo appendBufferState(memory, context, getGraphicsAllocation(), isReadOnlyArgument); appendSurfaceStateExt(memory); + + auto gmmHelper = rootDeviceEnvironment->getGmmHelper(); + if (DebugManager.flags.DisableCachingForStatefulBufferAccess.get()) { + gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED); + } } } // namespace NEO diff --git a/opencl/test/unit_test/test_files/igdrcl.config b/opencl/test/unit_test/test_files/igdrcl.config index 5b4bc9ccf2..6ac7dd4831 100644 --- a/opencl/test/unit_test/test_files/igdrcl.config +++ b/opencl/test/unit_test/test_files/igdrcl.config @@ -129,6 +129,7 @@ PrintProgramBinaryProcessingTime = 0 OverrideGpuAddressSpace = -1 OverrideMaxWorkgroupSize = -1 DisableTimestampPacketOptimizations = 0 +DisableCachingForStatefulBufferAccess = 0 MakeAllBuffersResident = 0 EnableDirectSubmission = -1 DirectSubmissionBufferPlacement = -1 diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 39656dfb67..f57939c3b5 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -57,6 +57,7 @@ DECLARE_DEBUG_VARIABLE(bool, DoNotRegisterTrimCallback, false, "When set to true 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, DisableTimestampPacketOptimizations, false, "Allocate new allocation per node + dont reuse old nodes") +DECLARE_DEBUG_VARIABLE(bool, DisableCachingForStatefulBufferAccess, false, "Disable caching for stateful buffer access") /*LOGGING FLAGS*/ DECLARE_DEBUG_VARIABLE(bool, PrintDebugSettings, false, "Dump all debug variables settings to text file. Print to stdout if value is different than default.")