From e9a25151fa90c0b100cda695b1d142c3ee8d4dbb Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 1 May 2024 19:41:58 +0100 Subject: [PATCH] aco/tests: support GFX12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Georg Lehmann Acked-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_ir.cpp | 1 + src/amd/compiler/tests/framework.h | 10 +++++++--- src/amd/compiler/tests/helpers.cpp | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/amd/compiler/aco_ir.cpp b/src/amd/compiler/aco_ir.cpp index 153bc84e7f9..3a0db771a05 100644 --- a/src/amd/compiler/aco_ir.cpp +++ b/src/amd/compiler/aco_ir.cpp @@ -75,6 +75,7 @@ init_program(Program* program, Stage stage, const struct aco_shader_info* info, case GFX10: program->family = CHIP_NAVI10; break; case GFX10_3: program->family = CHIP_NAVI21; break; case GFX11: program->family = CHIP_NAVI31; break; + case GFX12: program->family = CHIP_GFX1200; break; default: program->family = CHIP_UNKNOWN; break; } } else { diff --git a/src/amd/compiler/tests/framework.h b/src/amd/compiler/tests/framework.h index 33180c4f775..71c4169be8b 100644 --- a/src/amd/compiler/tests/framework.h +++ b/src/amd/compiler/tests/framework.h @@ -31,10 +31,14 @@ inline bool set_variant(amd_gfx_level cls, const char* rest = "") { char buf[8 + strlen(rest)]; - if (cls != GFX10_3) { - snprintf(buf, sizeof(buf), "gfx%d%s", cls - GFX6 + 6 - (cls > GFX10_3), rest); - } else { + if (cls == GFX10_3) { snprintf(buf, sizeof(buf), "gfx10_3%s", rest); + } else if (cls == GFX11_5) { + snprintf(buf, sizeof(buf), "gfx11_5%s", rest); + } else { + unsigned num = cls - GFX6 + 6; + num -= (cls > GFX10_3) + (cls > GFX11_5); + snprintf(buf, sizeof(buf), "gfx%d%s", num, rest); } return set_variant(buf); } diff --git a/src/amd/compiler/tests/helpers.cpp b/src/amd/compiler/tests/helpers.cpp index 5a2b1b2999b..c93ecf3e717 100644 --- a/src/amd/compiler/tests/helpers.cpp +++ b/src/amd/compiler/tests/helpers.cpp @@ -623,6 +623,7 @@ get_vk_device(enum amd_gfx_level gfx_level) case GFX10: family = CHIP_NAVI10; break; case GFX10_3: family = CHIP_NAVI21; break; case GFX11: family = CHIP_NAVI31; break; + case GFX12: family = CHIP_GFX1200; break; default: family = CHIP_UNKNOWN; break; } return get_vk_device(family);