From 088aa4a5180cc2cc44a4e6b1d90a59b94065d2ba Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 25 Jul 2016 16:20:18 -0400
Subject: [PATCH] P4 to Git Change 1295087 by asalmanp@asalmanp-opencl-stg on
2016/07/25 16:08:34
SWDEV-98211 - [Lexa][OCL] Add Lexa Support
ReviewBoardURL = http://ocltc.amd.com/reviews/r/10900/
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/gpu/scwrapper/devState.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/gpu/scwrapper/scCompileBase.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/loaders/bif/amuabi/amuABI.h#3 edit
... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/loaders/bif/amuabi/amuABIMultiBinary.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/utils/v0_8/target_mappings.h#10 edit
... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/utils/v0_8/target_mappings_amdil.h#10 edit
... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/utils/v0_8/target_mappings_amdil64.h#9 edit
... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/utils/v0_8/target_mappings_hsail.h#9 edit
... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/utils/v0_8/target_mappings_hsail64.h#9 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/bif/amuabi/amuABI.h#18 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/bif/amuabi/amuABIMultiBinary.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings.h#43 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings_amdil.h#37 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings_amdil64.h#33 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings_hsail.h#33 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings_hsail64.h#28 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/AMDIL.h#6 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/AMDILSubtarget.cpp#9 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/Internal/AMDILInternalDeviceFlags.h#5 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/Internal/InternalProcessors.td#9 edit
... //depot/stg/opencl/drivers/opencl/compiler/tools/driver/driver.cpp#62 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudefs.hpp#137 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#549 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#228 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#347 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#170 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/caltarget.h#3 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/binary/BIFEnumCheck.cpp#25 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/math/OCLMathFunc.cpp#23 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/runtime/OCLDeviceQueries.cpp#36 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/runtime/OCLPerfCounters.cpp#28 edit
[ROCm/clr commit: 8f5943e292b03d4f734c28212769da1b80198cb8]
---
projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings.h | 1 +
.../rocclr/compiler/lib/utils/v0_8/target_mappings_amdil.h | 1 +
.../rocclr/compiler/lib/utils/v0_8/target_mappings_amdil64.h | 1 +
.../rocclr/compiler/lib/utils/v0_8/target_mappings_hsail.h | 1 +
.../rocclr/compiler/lib/utils/v0_8/target_mappings_hsail64.h | 1 +
projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp | 1 +
projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp | 1 +
projects/clr/rocclr/runtime/device/gpu/gpuprogram.cpp | 1 +
projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp | 1 +
.../clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp | 4 ++++
.../clr/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h | 3 ++-
11 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings.h b/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings.h
index 75ca45c11d..0e5f941b1e 100644
--- a/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings.h
+++ b/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings.h
@@ -207,6 +207,7 @@ static const char* calTargetMapping[] = {
"Iceland", "Tonga", "Mullins", "Fiji",
"Carrizo", "Ellesmere", "Baffin",
"", "Stoney",
+ "Bee",
};
#include "utils/v0_8/target_mappings_amdil.h"
diff --git a/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_amdil.h b/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_amdil.h
index ac985ad73f..f7a5e363db 100644
--- a/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_amdil.h
+++ b/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_amdil.h
@@ -88,6 +88,7 @@ static const TargetMapping AMDILTargetMapping_0_8[] = {
UnknownTarget,
UnknownTarget,
UnknownTarget,
+ { "VI", "Bee", "bee", amd::GPU_Library_CI, VI_LEXA_V_A0, F_SI_BASE, true, true, FAMILY_VI },
{ "CZ", "Carrizo", "carrizo", amd::GPU_Library_CI, CARRIZO_A0, F_SI_BASE, true, true, FAMILY_CZ },
{ "TN", "Devastator", "trinity", amd::GPU_Library_Evergreen, TN_DEVASTATOR_W_A0, F_NI_EXT, false, false, FAMILY_TN },
{ "TN", "Devastator", "trinity", amd::GPU_Library_Evergreen, TN_DEVASTATOR_W_A1, F_NI_EXT, false, false, FAMILY_TN },
diff --git a/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_amdil64.h b/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_amdil64.h
index a6a476c453..994762343c 100644
--- a/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_amdil64.h
+++ b/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_amdil64.h
@@ -39,6 +39,7 @@ static const TargetMapping AMDIL64TargetMapping_0_8[] = {
UnknownTarget,
UnknownTarget,
UnknownTarget,
+ { "VI", "Bee", "bee", amd::GPU64_Library_CI, VI_LEXA_V_A0, F_SI_64BIT_PTR, true, true, FAMILY_VI },
{ "CZ", "Carrizo", "carrizo", amd::GPU64_Library_CI, CARRIZO_A0, F_SI_64BIT_PTR, true, true, FAMILY_CZ },
{ "VI", "Iceland", "iceland", amd::GPU64_Library_CI, VI_ICELAND_M_A0, F_SI_64BIT_PTR, true, true, FAMILY_VI },
{ "VI", "Tonga", "tonga", amd::GPU64_Library_CI, VI_TONGA_P_A0, F_SI_64BIT_PTR, true, true, FAMILY_VI },
diff --git a/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_hsail.h b/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_hsail.h
index 434e5c17e3..eda7e5b734 100644
--- a/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_hsail.h
+++ b/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_hsail.h
@@ -26,6 +26,7 @@ static const TargetMapping HSAILTargetMapping_0_8[] = {
UnknownTarget,
UnknownTarget,
UnknownTarget,
+ { "VI", "Bee", "VI", amd::GPU_Library_HSAIL, VI_LEXA_V_A0, F_VI_BASE, true, true, FAMILY_VI },
{ "CZ", "Carrizo", "VI", amd::GPU_Library_HSAIL, CARRIZO_A0, F_VI_BASE, true, true, FAMILY_CZ },
{ "VI", "Fiji", "VI", amd::GPU_Library_HSAIL, VI_FIJI_P_A0, F_VI_BASE, true, true, FAMILY_VI },
{ "CZ", "Stoney", "VI", amd::GPU_Library_HSAIL, STONEY_A0, F_VI_BASE, true, true, FAMILY_CZ },
diff --git a/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_hsail64.h b/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_hsail64.h
index 9eb2f1e9e9..485a3b4e5b 100644
--- a/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_hsail64.h
+++ b/projects/clr/rocclr/compiler/lib/utils/v0_8/target_mappings_hsail64.h
@@ -25,6 +25,7 @@ static const TargetMapping HSAIL64TargetMapping_0_8[] = {
UnknownTarget,
UnknownTarget,
UnknownTarget,
+ { "VI", "Bee", "VI", amd::GPU_Library_HSAIL, VI_LEXA_V_A0, F_VI_BASE, true, true, FAMILY_VI },
{ "CZ", "Carrizo", "VI", amd::GPU_Library_HSAIL, CARRIZO_A0, F_VI_BASE, true, true, FAMILY_CZ },
{ "VI", "Fiji", "VI", amd::GPU_Library_HSAIL, VI_FIJI_P_A0, F_VI_BASE, true, true, FAMILY_VI },
{ "CZ", "Stoney", "VI", amd::GPU_Library_HSAIL, STONEY_A0, F_VI_BASE, true, true, FAMILY_CZ },
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp b/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp
index 1dffd50ff5..6c66ff4ff2 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp
@@ -127,6 +127,7 @@ static const AMDDeviceInfo DeviceInfo[] = {
/* CAL_TARGET_BAFFIN */ { ED_ATI_CAL_MACHINE_BAFFIN_ISA, "Baffin", "baffin", 4, 16, 1, 256, 64 * Ki, 32, 800 },
/* CAL_TARGET_GREENLAND */ { ED_ATI_CAL_MACHINE_GREENLAND_ISA, "", "", 4, 16, 1, 256, 64 * Ki, 32, 900 },
/* CAL_TARGET_STONEY */ { ED_ATI_CAL_MACHINE_STONEY_ISA, "Stoney", "stoney", 4, 16, 1, 256, 64 * Ki, 32, 800 },
+/* CAL_TARGET_LEXA */ { ED_ATI_CAL_MACHINE_LEXA_ISA, "Bee", "bee", 4, 16, 1, 256, 64 * Ki, 32, 800 },
};
enum gfx_handle {
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
index aeef022c3e..c0a25bf260 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp
@@ -154,6 +154,7 @@ NullDevice::create(CALtarget target)
case CAL_TARGET_BAFFIN:
case CAL_TARGET_GREENLAND:
case CAL_TARGET_STONEY:
+ case CAL_TARGET_LEXA:
calAttr.doublePrecision = CAL_TRUE;
calAttr.isOpenCL200Device = CAL_TRUE;
break;
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpuprogram.cpp b/projects/clr/rocclr/runtime/device/gpu/gpuprogram.cpp
index fe774f2d25..76b7a159e4 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpuprogram.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpuprogram.cpp
@@ -2390,6 +2390,7 @@ bool ORCAHSALoaderContext::IsaSupportedByAgent(hsa_agent_t agent, hsa_isa_t isa)
case ED_ATI_CAL_MACHINE_FIJI_ISA:
case ED_ATI_CAL_MACHINE_ELLESMERE_ISA:
case ED_ATI_CAL_MACHINE_BAFFIN_ISA:
+ case ED_ATI_CAL_MACHINE_LEXA_ISA:
// gfx800 ISA has only sgrps limited and can be loaded.
// gfx801 ISA has XNACK limitations and can be loaded.
return isa.handle == gfx800 || isa.handle == gfx801 || isa.handle == gfx804;
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp b/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp
index 2e38003502..caba9cf5cc 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp
@@ -191,6 +191,7 @@ Settings::create(
case CAL_TARGET_FIJI:
case CAL_TARGET_ELLESMERE:
case CAL_TARGET_BAFFIN:
+ case CAL_TARGET_LEXA:
// Disable tiling aperture on VI+
linearPersistentImage_ = true;
// Keep this false even though we have support
diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
index 711135c9f0..68994f1492 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
@@ -493,6 +493,10 @@ CALGSLDevice::SetupContext(int32 &asic_id)
m_target = CAL_TARGET_STONEY;
m_elfmachine = ED_ATI_CAL_MACHINE_STONEY_ISA;
break;
+ case GSL_ATIASIC_ID_LEXA:
+ m_target = CAL_TARGET_LEXA;
+ m_elfmachine = ED_ATI_CAL_MACHINE_LEXA_ISA;
+ break;
default:
// 6XX is not supported
m_adp->deleteContext(temp_cs);
diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h
index e6acd3b1e6..c6053e258a 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h
+++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h
@@ -45,7 +45,8 @@ typedef enum CALtargetEnum {
CAL_TARGET_BAFFIN, /**< BAFFIN GPU ISA*/
CAL_TARGET_GREENLAND, /**< GREENLAND GPU ISA*/
CAL_TARGET_STONEY, /**< STONEY GPU ISA*/
- CAL_TARGET_LAST = CAL_TARGET_STONEY, /**< last */
+ CAL_TARGET_LEXA, /**< LEXA GPU ISA*/
+ CAL_TARGET_LAST = CAL_TARGET_LEXA, /**< last */
//##END_PRIVATE##
} CALtarget;