From a2b006e769b7b1c40643643c83be015f59e8df81 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 26 Jul 2018 18:27:12 -0400
Subject: [PATCH] P4 to Git Change 1586165 by gandryey@gera-w8 on 2018/07/26
18:11:39
SWDEV-79445 - OCL generic changes and code clean-up
- Make sure RAVEN2 uses PAL path for offline devices
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#597 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#167 edit
[ROCm/clr commit: 2544968e15826022e88b8cd6701b1a1d4d82f052]
---
projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp | 12 ++++--------
projects/clr/rocclr/runtime/device/gpu/gpudevice.hpp | 10 +++++++---
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
index 53185f9106..2d95f4eae7 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
@@ -135,12 +135,10 @@ bool NullDevice::create(CALtarget target) {
assert((target >= CAL_TARGET_TAHITI) && (target != CAL_TARGET_SCRAPPER) &&
(target != CAL_TARGET_DEVASTATOR));
-
- if ((GPU_ENABLE_PAL == 2) &&
- (calTarget_ == CAL_TARGET_GREENLAND || calTarget_ == CAL_TARGET_RAVEN ||
- calTarget_ >= CAL_TARGET_VEGA12)) {
- return false;
+ if ((GPU_ENABLE_PAL == 2) && usePal()) {
+ return false;
}
+
// Force double if it could be supported
switch (target) {
case CAL_TARGET_PITCAIRN:
@@ -862,9 +860,7 @@ bool Device::create(CALuint ordinal, CALuint numOfDevices) {
calTarget_ = getAttribs().target;
hwInfo_ = &DeviceInfo[calTarget_];
- if ((GPU_ENABLE_PAL == 2) &&
- (calTarget_ == CAL_TARGET_GREENLAND || calTarget_ == CAL_TARGET_RAVEN ||
- calTarget_ == CAL_TARGET_RAVEN2 || calTarget_ >= CAL_TARGET_VEGA12)) {
+ if ((GPU_ENABLE_PAL == 2) && usePal()) {
return false;
}
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudevice.hpp b/projects/clr/rocclr/runtime/device/gpu/gpudevice.hpp
index e24e60f863..468dd7d6a4 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpudevice.hpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpudevice.hpp
@@ -42,7 +42,6 @@ class NullDevice : public amd::Device {
aclCompiler* compiler() const { return compiler_; }
aclCompiler* hsaCompiler() const { return hsaCompiler_; }
- public:
static bool init(void);
//! Construct a new identifier
@@ -111,8 +110,10 @@ class NullDevice : public amd::Device {
virtual void svmFree(void* ptr) const { return; }
protected:
- CALtarget calTarget_; //!< GPU device identifier
- const AMDDeviceInfo* hwInfo_; //!< Device HW info structure
+ bool usePal() const {
+ return (calTarget_ == CAL_TARGET_GREENLAND || calTarget_ == CAL_TARGET_RAVEN ||
+ calTarget_ == CAL_TARGET_RAVEN2 || calTarget_ >= CAL_TARGET_VEGA12);
+ }
//! Answer the question: "Should HSAIL Program be created?",
//! based on the given options.
@@ -125,6 +126,9 @@ class NullDevice : public amd::Device {
uint numComputeRings, //!< Number of compute rings
uint numComputeRingsRT //!< Number of RT compute rings
);
+
+ CALtarget calTarget_; //!< GPU device identifier
+ const AMDDeviceInfo* hwInfo_; //!< Device HW info structure
};
//! Forward declarations