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