From 73d2e22993f366da2e6b127575b8f36b244d8ff1 Mon Sep 17 00:00:00 2001 From: foreman Date: Thu, 19 Mar 2015 11:10:40 -0400 Subject: [PATCH] P4 to Git Change 1132412 by asalmanp@asalmanp-opencl-stg1 on 2015/03/19 10:25:28 EPR #394115 - [OpenCL][Arctic Islands] Adding support for Greenland (gfx9) ReviewBoardURL = http://ocltc.amd.com/reviews/r/7142/ Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/linker.cpp#121 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/amdil_be.cpp#41 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/hsail_be.cpp#39 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/sclibdefs.opencl#22 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/scwrapper/SI/devStateSI.cpp#19 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/scwrapper/devState.cpp#26 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/scwrapper/scCompileBase.cpp#42 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/bif/amuabi/amuABI.h#16 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/bif/amuabi/amuABIMultiBinary.cpp#16 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings.h#31 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings_amdil.h#26 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings_amdil64.h#23 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings_hsail.h#22 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings_hsail64.h#17 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings.h#26 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings_amdil.h#25 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_9/target_mappings_amdil64.h#27 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/AMDIL.h#3 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/AMDILDeviceInfo.h#2 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/AMDILIOExpansion.cpp#2 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/AMDILPointerManager.cpp#2 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/AMDILSubtarget.cpp#3 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/AMDILSubtarget.h#2 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/Internal/AMDILInternalDeviceFlags.h#3 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Target/AMDIL/Internal/InternalProcessors.td#3 edit ... //depot/stg/opencl/drivers/opencl/compiler/tools/driver/driver.cpp#54 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudefs.hpp#120 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#502 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#306 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/include/cal/cal.h#34 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#112 edit ... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/binary/BIFEnumCheck.cpp#22 edit ... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/complib/CLTargetInfo.cpp#27 edit ... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/math/OCLMathFunc.cpp#20 edit ... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/runtime/OCLDeviceQueries.cpp#25 edit ... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/runtime/OCLPerfCounters.cpp#22 edit [ROCm/clr commit: 3054034af3cd78b1908b7511a87c8806fe7a1110] --- projects/clr/rocclr/compiler/lib/backends/common/linker.cpp | 6 ++++-- .../clr/rocclr/compiler/lib/utils/v0_8/target_mappings.h | 1 + .../rocclr/compiler/lib/utils/v0_8/target_mappings_amdil.h | 2 ++ .../compiler/lib/utils/v0_8/target_mappings_amdil64.h | 1 + .../rocclr/compiler/lib/utils/v0_8/target_mappings_hsail.h | 2 ++ .../compiler/lib/utils/v0_8/target_mappings_hsail64.h | 2 ++ projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp | 1 + projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp | 1 + projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp | 2 ++ .../rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h | 3 ++- .../rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp | 5 ++++- 11 files changed, 22 insertions(+), 4 deletions(-) diff --git a/projects/clr/rocclr/compiler/lib/backends/common/linker.cpp b/projects/clr/rocclr/compiler/lib/backends/common/linker.cpp index 7ec5d5be23..c8e5bc1429 100644 --- a/projects/clr/rocclr/compiler/lib/backends/common/linker.cpp +++ b/projects/clr/rocclr/compiler/lib/backends/common/linker.cpp @@ -227,7 +227,8 @@ void amdcl::OCLLinker::createASICIDFunctions(llvm::Module* module) || family == "KV" || family == "TN" || family == "VI" - || family == "CZ", + || family == "CZ" + || family == "AI", module); createConstIntFunc("__amdil_have_fast_fma32", chip == "Cypress" @@ -247,7 +248,8 @@ void amdcl::OCLLinker::createASICIDFunctions(llvm::Module* module) || family == "CI" || family == "VI" || family == "KV" - || family == "CZ", + || family == "CZ" + || family == "AI", module); } 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 1fd2ab2dc7..c47017a598 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 @@ -193,6 +193,7 @@ static const char* calTargetMapping[] = { "Hainan", "Hawaii", "Iceland", "Tonga", "Mullins", "Fiji", "Carrizo", "", "", + "", }; #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 6cd3764ffb..96713293d3 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 @@ -14,6 +14,7 @@ #include "inc/asic_reg/ci_id.h" #include "inc/asic_reg/vi_id.h" #include "inc/asic_reg/cz_id.h" +#include "inc/asic_reg/ai_id.h" #include "inc/asic_reg/atiid.h" static const TargetMapping AMDILTargetMapping_0_8[] = { @@ -88,6 +89,7 @@ static const TargetMapping AMDILTargetMapping_0_8[] = { UnknownTarget, UnknownTarget, UnknownTarget, + UnknownTarget, { "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, true, false, FAMILY_TN }, { "TN", "Devastator", "trinity", amd::GPU_Library_Evergreen, TN_DEVASTATOR_W_A1, F_NI_EXT, true, 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 f6146e427a..92b4c1573b 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 @@ -40,6 +40,7 @@ static const TargetMapping AMDIL64TargetMapping_0_8[] = { UnknownTarget, UnknownTarget, UnknownTarget, + UnknownTarget, { "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 c32a19860d..fb43af630e 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 @@ -8,6 +8,7 @@ #include "inc/asic_reg/kv_id.h" #include "inc/asic_reg/ci_id.h" #include "inc/asic_reg/cz_id.h" +#include "inc/asic_reg/ai_id.h" #include "inc/asic_reg/atiid.h" static const TargetMapping HSAILTargetMapping_0_8[] = { @@ -26,6 +27,7 @@ static const TargetMapping HSAILTargetMapping_0_8[] = { UnknownTarget, UnknownTarget, UnknownTarget, + UnknownTarget, { "CZ", "Carrizo", "generic", amd::GPU_Library_HSAIL, CARRIZO_A0, 0, true, true, FAMILY_CZ }, { "VI", "Fiji", "generic", amd::GPU_Library_HSAIL, VI_FIJI_P_A0, 0, true, true, FAMILY_VI }, InvalidTarget 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 8c90ee0e30..b21ff5a3bd 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 @@ -7,6 +7,7 @@ #include "inc/asic_reg/si_id.h" #include "inc/asic_reg/kv_id.h" #include "inc/asic_reg/ci_id.h" +#include "inc/asic_reg/ai_id.h" #include "inc/asic_reg/atiid.h" static const TargetMapping HSAIL64TargetMapping_0_8[] = { @@ -25,6 +26,7 @@ static const TargetMapping HSAIL64TargetMapping_0_8[] = { UnknownTarget, UnknownTarget, UnknownTarget, + UnknownTarget, { "CZ", "Carrizo", "generic", amd::GPU_Library_HSAIL, CARRIZO_A0, 0, true, true, FAMILY_CZ }, { "VI", "Fiji", "generic", amd::GPU_Library_HSAIL, VI_FIJI_P_A0, 0, true, true, FAMILY_VI }, InvalidTarget diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp b/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp index 83646246a9..0fb0e9b133 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp +++ b/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp @@ -125,6 +125,7 @@ static const AMDDeviceInfo DeviceInfo[] = { /* CAL_TARGET_CARRIZO */ { ED_ATI_CAL_MACHINE_CARRIZO_ISA, "Carrizo" , "carrizo", 4, 16, 1, 256, 64 * Ki, 32, 800 }, /* CAL_TARGET_ELLESMERE */ { ED_ATI_CAL_MACHINE_ELLESMERE_ISA, "", "", 4, 16, 1, 256, 64 * Ki, 32, 800 }, /* CAL_TARGET_BAFFIN */ { ED_ATI_CAL_MACHINE_BAFFIN_ISA, "", "", 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 }, }; // Supported OpenCL versions diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp index 56f19c7e43..f0c71f9de7 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp @@ -158,6 +158,7 @@ NullDevice::create(CALtarget target) case CAL_TARGET_CARRIZO: case CAL_TARGET_ELLESMERE: case CAL_TARGET_BAFFIN: + case CAL_TARGET_GREENLAND: calAttr.doublePrecision = CAL_TRUE; calAttr.isOpenCL200Device = CAL_TRUE; break; diff --git a/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp b/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp index 848aaf9a61..8d24b098f8 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp @@ -238,6 +238,8 @@ Settings::create( break; case CAL_TARGET_CARRIZO: apuSystem_ = true; + case CAL_TARGET_GREENLAND: + //TODO: specific code for AI case CAL_TARGET_ICELAND: case CAL_TARGET_TONGA: case CAL_TARGET_FIJI: diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h index f7282e3906..5b729f82c9 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h +++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h @@ -178,7 +178,8 @@ typedef enum CALtargetEnum { CAL_TARGET_CARRIZO, /**< CARRIZO GPU ISA*/ CAL_TARGET_ELLESMERE, /**< ELLESMERE GPU ISA*/ CAL_TARGET_BAFFIN, /**< BAFFIN GPU ISA*/ - CAL_TARGET_LAST = CAL_TARGET_BAFFIN, /**< last */ + CAL_TARGET_GREENLAND, /**< GREENLAND GPU ISA*/ + CAL_TARGET_LAST = CAL_TARGET_GREENLAND, /**< last */ //##END_PRIVATE## } CALtarget; 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 0f7c67a8b3..278b92decd 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 @@ -592,7 +592,10 @@ CALGSLDevice::SetupContext(int32 &asic_id) m_target = CAL_TARGET_BAFFIN; m_elfmachine = ED_ATI_CAL_MACHINE_BAFFIN_ISA; break; - + case GSL_ATIASIC_ID_GREENLAND: + m_target = CAL_TARGET_GREENLAND; + m_elfmachine = ED_ATI_CAL_MACHINE_GREENLAND_ISA; + break; default: // 6XX is not supported m_adp->deleteContext(temp_cs);