From bd54838ca79b7ec2d79c190f2c44c51b6c742c2e Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 2 Feb 2016 20:52:50 -0500
Subject: [PATCH] P4 to Git Change 1233743 by bcrane@MSDNBCRANE99-OCL on
2016/02/02 20:45:13
SWDEV-86253 - [QR] 6 to 7% performance drop is observed in BasemarkCL test
CL1226184 adds serialization to LHIO, because pxproxy accesses global state, without locks, leading to crash, etc.
To fix OpenCL perf regressions, allow unserialized access to pxproxy. It may be that OpenCL design leads away from racy behavior, so it may be safe. This was checked in to gather information. What software gets perf drops? Does any software get fixed?
The dangerous functions are CreateDevice, CreateContext, because the handles from the OS are saved in global caches, and if those global caches are modified in one thread, while other threads are looking-up from the caches - that is a problem.
TC: http://ocltc:8111/viewModification.html?modId=66278&personal=true
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#158 edit
---
rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
index 026be11da7..8fd9a954f3 100644
--- a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
@@ -200,6 +200,9 @@ CALGSLDevice::open(uint32 gpuIndex, bool enableHighPerformanceState, bool report
m_dcfg.nPatchDumpLevel.value |= NPATCHDUMPLEVEL_BITS_HW_DEBUG;
}
+ // disable serialization in LHIO to get perf gains
+ m_dcfg.nPatchDumpLevel.value |= NPATCHDUMPLEVEL_FEATURE_ALLOWUNSERIALIZEDPXPROXY;
+
//we can use environment variable CAL_ENABLE_ASYNC_DMA to force dma on or off when we need it
char *s = NULL;
if((s = getenv("CAL_ENABLE_ASYNC_DMA")))