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") \