From 7e5541e29ad7fa2d1aefd7beceddfd8b1fd60a30 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 21 Jul 2016 18:22:08 -0400
Subject: [PATCH] P4 to Git Change 1294145 by gandryey@gera-w8 on 2016/07/21
17:55:27
SWDEV-95007 - OpenCL on PAL (Windows)
- Enable PAL backend compilation by default
- Add GPU_ENABLE_PAL to control PAL backend
Affected files ...
... //depot/stg/opencl/drivers/opencl/opencldefs#173 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#198 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#255 edit
[ROCm/clr commit: 93b6223470206e4f230a4a8fed4751adf5ad8091]
---
projects/clr/rocclr/runtime/device/device.cpp | 20 +++++++++++++------
projects/clr/rocclr/runtime/utils/flags.hpp | 2 ++
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/device.cpp b/projects/clr/rocclr/runtime/device/device.cpp
index 2d00917be8..b34a04e60a 100644
--- a/projects/clr/rocclr/runtime/device/device.cpp
+++ b/projects/clr/rocclr/runtime/device/device.cpp
@@ -184,11 +184,15 @@ Device::init()
ret |= roc::NullDevice::init();
}
#endif // WITH_HSA_DEVICE
-#if defined(WITH_GPU_DEVICE) && !defined(WITH_PAL_DEVICE)
- ret |= DeviceLoad();
+#if defined(WITH_GPU_DEVICE)
+ if (GPU_ENABLE_PAL != 1) {
+ ret |= DeviceLoad();
+ }
#endif // WITH_GPU_DEVICE
#if defined(WITH_PAL_DEVICE)
- ret |= PalDeviceLoad();
+ if (GPU_ENABLE_PAL != 0) {
+ ret |= PalDeviceLoad();
+ }
#endif // WITH_PAL_DEVICE
#if defined(WITH_CPU_DEVICE)
ret |= cpu::Device::init();
@@ -213,11 +217,15 @@ Device::tearDown()
rocAppProfile_ = NULL;
}
#endif // WITH_HSA_DEVICE
-#if defined(WITH_GPU_DEVICE) && !defined(WITH_PAL_DEVICE)
- DeviceUnload();
+#if defined(WITH_GPU_DEVICE)
+ if (GPU_ENABLE_PAL != 1) {
+ DeviceUnload();
+ }
#endif // WITH_GPU_DEVICE
#if defined(WITH_PAL_DEVICE)
- PalDeviceUnload();
+ if (GPU_ENABLE_PAL != 0) {
+ PalDeviceUnload();
+ }
#endif // WITH_PAL_DEVICE
#if defined(WITH_CPU_DEVICE)
cpu::Device::tearDown();
diff --git a/projects/clr/rocclr/runtime/utils/flags.hpp b/projects/clr/rocclr/runtime/utils/flags.hpp
index cd1b77bd6a..280f090b7a 100644
--- a/projects/clr/rocclr/runtime/utils/flags.hpp
+++ b/projects/clr/rocclr/runtime/utils/flags.hpp
@@ -163,6 +163,8 @@ release(bool, GPU_IFH_MODE, false, \
"1 = Enable GPU IFH (infinitely fast hardware) mode. Any other value keeps setting disabled.") \
release(bool, GPU_MIPMAP, true, \
"Enables GPU mipmap extension") \
+release(uint, GPU_ENABLE_PAL, 0, \
+ "Enables PAL backend. 0 - GSL(default), 1 - PAL, 2 - GSL and PAL") \
release(bool, DISABLE_DEFERRED_ALLOC, false, \
"Disables deferred memory allocation on device") \
release(int, AMD_GPU_FORCE_SINGLE_FP_DENORM, -1, \