KFDTest: Make shader compatiable for gfx9 and gfx10

Remove the CHIP name from the shader ISA and add wave_size(32) to make the same
shader can be  used for both  GFX9 and GFX10

Change-Id: I16ea72f87980c3d9c11298e20c06a0a073fe9a28
Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
This commit is contained in:
shaoyunl
2019-07-25 12:02:46 -04:00
committed by Shaoyun Liu
parent b6f6d9da1c
commit 78e754ca5b
4 changed files with 18 additions and 149 deletions
+2 -29
View File
@@ -52,35 +52,10 @@ LOOP:\n\
end\n\
";
//This shader can be used by gfx9 and gfx10
static const char* iterate_isa_gfx9 = \
"\
shader iterate_isa\n\
asic(GFX9)\n\
type(CS)\n\
/*copy the parameters from scalar registers to vector registers*/\n\
v_mov_b32 v0, s0\n\
v_mov_b32 v1, s1\n\
v_mov_b32 v2, s2\n\
v_mov_b32 v3, s3\n\
flat_load_dword v4, v[0:1] slc /*load target iteration value*/\n\
s_waitcnt vmcnt(0)&lgkmcnt(0)\n\
v_mov_b32 v5, 0\n\
LOOP:\n\
v_add_co_u32 v5, vcc, 1, v5\n\
s_waitcnt vmcnt(0)&lgkmcnt(0)\n\
/*compare the result value (v5) to iteration value (v4), and jump if equal (i.e. if VCC is not zero after the comparison)*/\n\
v_cmp_lt_u32 vcc, v5, v4\n\
s_cbranch_vccnz LOOP\n\
flat_store_dword v[2,3], v5\n\
s_waitcnt vmcnt(0)&lgkmcnt(0)\n\
s_endpgm\n\
end\n\
";
static const char* iterate_isa_gfx10 = \
"\
shader iterate_isa\n\
asic(GFX10)\n\
wave_size(32)\n\
type(CS)\n\
/*copy the parameters from scalar registers to vector registers*/\n\
@@ -160,10 +135,8 @@ TEST_F(KFDCWSRTest, BasicTest) {
if (m_FamilyId < FAMILY_AI)
pIterateIsa = iterate_isa_gfx8;
else if (m_FamilyId < FAMILY_NV)
pIterateIsa = iterate_isa_gfx9;
else
pIterateIsa = iterate_isa_gfx10;
pIterateIsa = iterate_isa_gfx9;
m_pIsaGen->CompileShader(pIterateIsa, "iterate_isa", isaBuffer);