From 633ed0a02da7e880fe33b0fd1f89359a98eafe5b Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 22 Feb 2018 12:09:33 -0500
Subject: [PATCH] P4 to Git Change 1518288 by rili@rili-new-stg-pal-opencl on
2018/02/22 11:48:27
SWDEV-145977 - Add RV2 support
Code Review: http://ocltc.amd.com/reviews/r/14280/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudefs.hpp#151 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#584 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#359 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#182 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/caltarget.h#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldefs.hpp#32 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#44 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/binary/BIFEnumCheck.cpp#29 edit
---
rocclr/runtime/device/gpu/gpudefs.hpp | 6 ++++--
rocclr/runtime/device/gpu/gpudevice.cpp | 5 +++--
rocclr/runtime/device/gpu/gpusettings.cpp | 1 +
rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp | 4 ++++
rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h | 1 +
rocclr/runtime/device/pal/paldefs.hpp | 5 +++--
rocclr/runtime/device/pal/palsettings.cpp | 1 +
7 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/rocclr/runtime/device/gpu/gpudefs.hpp b/rocclr/runtime/device/gpu/gpudefs.hpp
index 925dd327ff..2317c0302a 100644
--- a/rocclr/runtime/device/gpu/gpudefs.hpp
+++ b/rocclr/runtime/device/gpu/gpudefs.hpp
@@ -153,8 +153,10 @@ static const AMDDeviceInfo DeviceInfo[] = {
64 * Ki, 32, 800},
/* CAL_TARGET_LEXA */ {ED_ATI_CAL_MACHINE_LEXA_ISA, "gfx804", "gfx804", 4, 16, 1, 256, 64 * Ki,
32, 800},
- /* CAL_TARGET_RAVEN */ {ED_ATI_CAL_MACHINE_RAVEN_ISA, IF(IS_BRAHMA, "", "gfx901"),
- IF(IS_BRAHMA, "", "gfx901"), 4, 16, 1, 256, 64 * Ki, 32, 900},
+ /* CAL_TARGET_RAVEN */ {ED_ATI_CAL_MACHINE_RAVEN_ISA, IF(IS_BRAHMA, "", "gfx902"),
+ IF(IS_BRAHMA, "", "gfx902"), 4, 16, 1, 256, 64 * Ki, 32, 900},
+ /* CAL_TARGET_RAVEN2 */ {ED_ATI_CAL_MACHINE_RAVEN2_ISA, IF(IS_BRAHMA, "", "gfx902"),
+ IF(IS_BRAHMA, "", "gfx902"), 4, 16, 1, 256, 64 * Ki, 32, 900},
/* CAL_TARGET_POLARIS22 */ {ED_ATI_CAL_MACHINE_POLARIS22_ISA, IF(IS_BRAHMA, "", "gfx804"),
IF(IS_BRAHMA, "", "gfx804"), 4, 16, 1, 256, 64 * Ki, 32, 800},
/* CAL_TARGET_VEGA12 */{ ED_ATI_CAL_MACHINE_VEGA12_ISA, IF(IS_BRAHMA, "", "gfx904"),
diff --git a/rocclr/runtime/device/gpu/gpudevice.cpp b/rocclr/runtime/device/gpu/gpudevice.cpp
index 686d4a714b..da7e871bf8 100644
--- a/rocclr/runtime/device/gpu/gpudevice.cpp
+++ b/rocclr/runtime/device/gpu/gpudevice.cpp
@@ -166,6 +166,7 @@ bool NullDevice::create(CALtarget target) {
case CAL_TARGET_STONEY:
case CAL_TARGET_LEXA:
case CAL_TARGET_RAVEN:
+ case CAL_TARGET_RAVEN2:
case CAL_TARGET_POLARIS22:
case CAL_TARGET_VEGA12:
case CAL_TARGET_VEGA20:
@@ -854,13 +855,13 @@ bool Device::create(CALuint ordinal, CALuint numOfDevices) {
if ((GPU_ENABLE_PAL == 2) &&
(calTarget_ == CAL_TARGET_GREENLAND || calTarget_ == CAL_TARGET_RAVEN ||
- calTarget_ >= CAL_TARGET_VEGA12)) {
+ calTarget_ == CAL_TARGET_RAVEN2 || calTarget_ >= CAL_TARGET_VEGA12)) {
return false;
}
#if defined(BRAHMA)
if (calTarget_ == CAL_TARGET_GREENLAND || calTarget_ == CAL_TARGET_RAVEN ||
- calTarget_ == CAL_TARGET_POLARIS22) {
+ calTarget_ == CAL_TARGET_RAVEN2 || calTarget_ == CAL_TARGET_POLARIS22) {
return false;
}
#endif
diff --git a/rocclr/runtime/device/gpu/gpusettings.cpp b/rocclr/runtime/device/gpu/gpusettings.cpp
index 0890463b81..9505a0aea3 100644
--- a/rocclr/runtime/device/gpu/gpusettings.cpp
+++ b/rocclr/runtime/device/gpu/gpusettings.cpp
@@ -161,6 +161,7 @@ bool Settings::create(const CALdeviceattribs& calAttr, bool reportAsOCL12Device,
switch (target) {
case CAL_TARGET_RAVEN:
+ case CAL_TARGET_RAVEN2:
// APU systems for AI
apuSystem_ = true;
case CAL_TARGET_GREENLAND:
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
index e903a16244..c6b0bac6f9 100644
--- a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
@@ -511,6 +511,10 @@ CALGSLDevice::SetupContext(int32 &asic_id)
m_target = CAL_TARGET_RAVEN;
m_elfmachine = ED_ATI_CAL_MACHINE_RAVEN_ISA;
break;
+ case GSL_ATIASIC_ID_RAVEN2:
+ m_target = CAL_TARGET_RAVEN2;
+ m_elfmachine = ED_ATI_CAL_MACHINE_RAVEN2_ISA;
+ break;
case GSL_ATIASIC_ID_POLARIS22:
m_target = CAL_TARGET_POLARIS22;
m_elfmachine = ED_ATI_CAL_MACHINE_POLARIS22_ISA;
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h b/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h
index 7f127fc18a..0e8a6a0a81 100644
--- a/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h
@@ -47,6 +47,7 @@ typedef enum CALtargetEnum {
CAL_TARGET_STONEY, /**< STONEY GPU ISA*/
CAL_TARGET_LEXA, /**< LEXA GPU ISA*/
CAL_TARGET_RAVEN, /**< RAVEN GPU ISA*/
+ CAL_TARGET_RAVEN2, /**< RAVEN2 GPU ISA*/
CAL_TARGET_POLARIS22, /**< POLARIS22 GPU ISA*/
CAL_TARGET_VEGA12, /**< VEGA12 GPU ISA*/
CAL_TARGET_VEGA20, /**< VEGA20 GPU ISA*/
diff --git a/rocclr/runtime/device/pal/paldefs.hpp b/rocclr/runtime/device/pal/paldefs.hpp
index 69d79d13ed..7a21fb6852 100644
--- a/rocclr/runtime/device/pal/paldefs.hpp
+++ b/rocclr/runtime/device/pal/paldefs.hpp
@@ -163,8 +163,9 @@ static const AMDDeviceInfo Gfx9PlusSubDeviceInfo[] = {
/* Raven */{"gfx902", "gfx902", 4, 16, 1, 256, 64 * Ki, 32, 902},
/* Raven XNACK */{ LIGHTNING_SWITCH("gfx902","gfx903"), LIGHTNING_SWITCH("gfx902","gfx903"),
4, 16, 1, 256, 64 * Ki, 32, LIGHTNING_SWITCH(902, 903)},
- /* Raven2 */{"" , "" , 0, 0 , 0, 0 , 0 , 0 , 0},
- /* Raven2 XNACK */{"" , "" , 0, 0 , 0, 0 , 0 , 0 , 0},
+ /* Raven2 */{"gfx902", "gfx902", 4, 16, 1, 256, 64 * Ki, 32, 902},
+ /* Raven2 XNACK */{ LIGHTNING_SWITCH("gfx902","gfx903"), LIGHTNING_SWITCH("gfx902","gfx903"),
+ 4, 16, 1, 256, 64 * Ki, 32, LIGHTNING_SWITCH(902, 903)},
/* Navi10 */{ "", "", 4, 16, 1, 256, 64 * Ki, 32, 1000},
/* Navi10 XNACK */{ "", "", 4, 16, 1, 256, 64 * Ki, 32, 1001},
};
diff --git a/rocclr/runtime/device/pal/palsettings.cpp b/rocclr/runtime/device/pal/palsettings.cpp
index 680d16e1fe..a0b20f21ea 100644
--- a/rocclr/runtime/device/pal/palsettings.cpp
+++ b/rocclr/runtime/device/pal/palsettings.cpp
@@ -186,6 +186,7 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
case Pal::AsicRevision::Vega12:
case Pal::AsicRevision::Vega10:
case Pal::AsicRevision::Raven:
+ case Pal::AsicRevision::Raven2:
aiPlus_ = true;
// Fall through to VI ...
case Pal::AsicRevision::Carrizo: