From cc3bd31591689a1e68ef1218a51e8d10ac4db7ec Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Fri, 21 Jan 2022 07:51:52 -0500 Subject: [PATCH] Add gfx1102 support Change-Id: I39cbda81a7a999aa2ecfad7a3e720000f7ca3408 Signed-off-by: David Yat Sin --- rocrtst/suites/test_common/CMakeLists.txt | 2 +- runtime/hsa-runtime/core/runtime/isa.cpp | 1 + runtime/hsa-runtime/image/blit_kernel.cpp | 3 +++ runtime/hsa-runtime/image/blit_src/CMakeLists.txt | 2 +- runtime/hsa-runtime/inc/amd_hsa_elf.h | 1 + runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp | 3 +++ 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rocrtst/suites/test_common/CMakeLists.txt b/rocrtst/suites/test_common/CMakeLists.txt index a7b4df6008..5e257a4299 100755 --- a/rocrtst/suites/test_common/CMakeLists.txt +++ b/rocrtst/suites/test_common/CMakeLists.txt @@ -49,7 +49,7 @@ set ( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/RadeonOpenCompute/ROCR-R set ( CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/RadeonOpenCompute/ROCR-Runtime" ) -set(DEFAULT_TARGETS "gfx700;gfx701;gfx702;gfx801;gfx802;gfx803;gfx805;gfx810;gfx900;gfx902;gfx904;gfx906;gfx908;gfx909;gfx90a;gfx90c;gfx1010;gfx1011;gfx1012;gfx1013;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100") +set(DEFAULT_TARGETS "gfx700;gfx701;gfx702;gfx801;gfx802;gfx803;gfx805;gfx810;gfx900;gfx902;gfx904;gfx906;gfx908;gfx909;gfx90a;gfx90c;gfx1010;gfx1011;gfx1012;gfx1013;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1102") # # Currently support for Windows platform is not present diff --git a/runtime/hsa-runtime/core/runtime/isa.cpp b/runtime/hsa-runtime/core/runtime/isa.cpp index ed61eccca8..65b35d72db 100755 --- a/runtime/hsa-runtime/core/runtime/isa.cpp +++ b/runtime/hsa-runtime/core/runtime/isa.cpp @@ -316,6 +316,7 @@ constexpr size_t hsa_name_size = 63; ISAREG_ENTRY_GEN("gfx1035", 10, 3, 5, unsupported, unsupported) ISAREG_ENTRY_GEN("gfx1036", 10, 3, 6, unsupported, unsupported) ISAREG_ENTRY_GEN("gfx1100", 11, 0, 0, unsupported, unsupported) + ISAREG_ENTRY_GEN("gfx1102", 11, 0, 2, unsupported, unsupported) #undef ISAREG_ENTRY_GEN return supported_isas; } diff --git a/runtime/hsa-runtime/image/blit_kernel.cpp b/runtime/hsa-runtime/image/blit_kernel.cpp index 62d6f01f32..2b9daaf8f5 100644 --- a/runtime/hsa-runtime/image/blit_kernel.cpp +++ b/runtime/hsa-runtime/image/blit_kernel.cpp @@ -97,6 +97,7 @@ extern uint8_t ocl_blit_object_gfx1034[]; extern uint8_t ocl_blit_object_gfx1035[]; extern uint8_t ocl_blit_object_gfx1036[]; extern uint8_t ocl_blit_object_gfx1100[]; +extern uint8_t ocl_blit_object_gfx1102[]; // Arguments inserted by OCL compiler, all zero here. struct OCLHiddenArgs { @@ -1028,6 +1029,8 @@ hsa_status_t BlitKernel::GetPatchedBlitObject(const char* agent_name, *blit_code_object = ocl_blit_object_gfx1036; } else if (sname == "gfx1100") { *blit_code_object = ocl_blit_object_gfx1100; + } else if (sname == "gfx1102") { + *blit_code_object = ocl_blit_object_gfx1102; } else { return HSA_STATUS_ERROR_INVALID_ISA_NAME; } diff --git a/runtime/hsa-runtime/image/blit_src/CMakeLists.txt b/runtime/hsa-runtime/image/blit_src/CMakeLists.txt index d8135d9606..b308e1414e 100644 --- a/runtime/hsa-runtime/image/blit_src/CMakeLists.txt +++ b/runtime/hsa-runtime/image/blit_src/CMakeLists.txt @@ -47,7 +47,7 @@ find_package(Clang REQUIRED HINTS ${CMAKE_PREFIX_PATH}/llvm PATHS /opt/rocm/llvm # Determine the target devices if not specified if (NOT DEFINED TARGET_DEVICES) - set (TARGET_DEVICES "gfx700;gfx701;gfx702;gfx801;gfx802;gfx803;gfx805;gfx810;gfx900;gfx902;gfx904;gfx906;gfx908;gfx909;gfx90a;gfx90c;gfx1010;gfx1011;gfx1012;gfx1013;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100") + set (TARGET_DEVICES "gfx700;gfx701;gfx702;gfx801;gfx802;gfx803;gfx805;gfx810;gfx900;gfx902;gfx904;gfx906;gfx908;gfx909;gfx90a;gfx90c;gfx1010;gfx1011;gfx1012;gfx1013;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1102") endif() set( TARGET_DEVICES ${TARGET_DEVICES} CACHE STRING "Build targets" FORCE ) diff --git a/runtime/hsa-runtime/inc/amd_hsa_elf.h b/runtime/hsa-runtime/inc/amd_hsa_elf.h index f9ad738fe5..a5c75498c6 100644 --- a/runtime/hsa-runtime/inc/amd_hsa_elf.h +++ b/runtime/hsa-runtime/inc/amd_hsa_elf.h @@ -123,6 +123,7 @@ enum : unsigned { EF_AMDGPU_MACH_AMDGCN_GFX1100 = 0x041, EF_AMDGPU_MACH_AMDGCN_GFX1013 = 0x042, EF_AMDGPU_MACH_AMDGCN_GFX1036 = 0x045, + EF_AMDGPU_MACH_AMDGCN_GFX1102 = 0x047, // First/last AMDGCN-based processors. EF_AMDGPU_MACH_AMDGCN_FIRST = EF_AMDGPU_MACH_AMDGCN_GFX600, diff --git a/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp b/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp index d405030bca..60c78453f1 100644 --- a/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp +++ b/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp @@ -586,6 +586,7 @@ namespace code { case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1035: name = "gfx1035"; xnack_supported = false; sramecc_supported = false; break; case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1036: name = "gfx1036"; xnack_supported = false; sramecc_supported = false; break; case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1100: name = "gfx1100"; xnack_supported = false; sramecc_supported = false; break; + case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1102: name = "gfx1102"; xnack_supported = false; sramecc_supported = false; break; default: return false; } return true; @@ -636,6 +637,8 @@ namespace code { mach = ELF::EF_AMDGPU_MACH_AMDGCN_GFX90C; else if (old_name == "AMD:AMDGPU:11:0:0") mach = ELF::EF_AMDGPU_MACH_AMDGCN_GFX1100; + else if (old_name == "AMD:AMDGPU:11:0:2") + mach = ELF::EF_AMDGPU_MACH_AMDGCN_GFX1102; else { // Code object v2 only supports asics up to gfx906 plus gfx90c. Do NOT // add handling of new asics into this if-else-if* block.