From fd2ff06502ed282a879ef6461702e42d4b7d8a52 Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 30 Aug 2016 19:13:14 -0400
Subject: [PATCH] P4 to Git Change 1308933 by gandryey@gera-w8 on 2016/08/30
18:42:21
SWDEV-86035 - Enable PAL for GFX9 by default
- GPU_ENABLE_PAL=0 will force GSL backend for GFX9
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#550 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#19 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#256 edit
[ROCm/clr commit: e0f15c2613d25fbb9bf173e40a744faf1864884e]
---
.../clr/rocclr/runtime/device/gpu/gpudevice.cpp | 4 ++++
.../clr/rocclr/runtime/device/pal/paldevice.cpp | 16 +++++++++++-----
projects/clr/rocclr/runtime/utils/flags.hpp | 2 +-
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
index c0a25bf260..e6eaf5decf 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
@@ -851,6 +851,10 @@ Device::create(CALuint ordinal, CALuint numOfDevices)
calTarget_ = getAttribs().target;
hwInfo_ = &DeviceInfo[calTarget_];
+ if ((GPU_ENABLE_PAL == 2) && (calTarget_ > CAL_TARGET_STONEY)) {
+ return false;
+ }
+
// Creates device settings
settings_ = new gpu::Settings();
gpu::Settings* gpuSettings = reinterpret_cast(settings_);
diff --git a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp
index f1ddd90fd9..9aad82d063 100644
--- a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp
@@ -160,12 +160,15 @@ NullDevice::create(Pal::AsicRevision asicRevision, Pal::GfxIpLevel ipLevel)
properties.gfxLevel = ipLevel;
// Update HW info for the device
- if (ipLevel == Pal::GfxIpLevel::_None) {
+ if ((GPU_ENABLE_PAL == 1) && (ipLevel == Pal::GfxIpLevel::_None)) {
hwInfo_ = &DeviceInfo[static_cast(asicRevision)];
}
- else {
+ else if (ipLevel >= Pal::GfxIpLevel::GfxIp9) {
hwInfo_ = &GfxIpDeviceInfo[static_cast(ipLevel)];
}
+ else {
+ return false;
+ }
settings_ = new pal::Settings();
pal::Settings* palSettings = reinterpret_cast(settings_);
@@ -686,11 +689,14 @@ Device::create(Pal::IDevice* device)
asicRevision_ = properties().revision;
// Update HW info for the device
- if (properties().revision == Pal::AsicRevision::Unknown) {
- hwInfo_ = &GfxIpDeviceInfo[static_cast(properties().gfxLevel)];
+ if ((GPU_ENABLE_PAL == 1) && (properties().revision != Pal::AsicRevision::Unknown)) {
+ hwInfo_ = &DeviceInfo[static_cast(properties().revision)];
+ }
+ else if (ipLevel_ >= Pal::GfxIpLevel::GfxIp9) {
+ hwInfo_ = &GfxIpDeviceInfo[static_cast(ipLevel_)];
}
else {
- hwInfo_ = &DeviceInfo[static_cast(properties().revision)];
+ return false;
}
diff --git a/projects/clr/rocclr/runtime/utils/flags.hpp b/projects/clr/rocclr/runtime/utils/flags.hpp
index 280f090b7a..4ba6b781dd 100644
--- a/projects/clr/rocclr/runtime/utils/flags.hpp
+++ b/projects/clr/rocclr/runtime/utils/flags.hpp
@@ -163,7 +163,7 @@ 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, \
+release(uint, GPU_ENABLE_PAL, 2, \
"Enables PAL backend. 0 - GSL(default), 1 - PAL, 2 - GSL and PAL") \
release(bool, DISABLE_DEFERRED_ALLOC, false, \
"Disables deferred memory allocation on device") \