Skip to content

Commit e9a8cee

Browse files
authored
spirv-val: add positive test for FP8 cooperative matrices (KhronosGroup#6175)
The headers need updating to pick up KhronosGroup/SPIRV-Headers#519 which this test uncovered as an issue. Change-Id: I79c292db6d2fbff6e31a7ccc9dfd4d65f4f49ab2 Signed-off-by: Kevin Petit <[email protected]>
1 parent 90cfb3e commit e9a8cee

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ vars = {
1414

1515
're2_revision': 'c84a140c93352cdabbfb547c531be34515b12228',
1616

17-
'spirv_headers_revision': 'fd96661925488574fe247a779babe5d380b63635',
17+
'spirv_headers_revision': '3b9447dc98371e96b59a6225bd062a9867e1d203',
1818
}
1919

2020
deps = {

test/val/val_data_test.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,21 @@ TEST_F(ValidateData, cooperative_matrix_bfloat16_good) {
400400
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
401401
}
402402

403+
TEST_F(ValidateData, cooperative_matrix_float8_good) {
404+
std::string str = header_with_float8 + R"(
405+
%u32 = OpTypeInt 32 0
406+
%u32_16 = OpConstant %u32 16
407+
%useA = OpConstant %u32 0
408+
%subgroup = OpConstant %u32 3
409+
%fp8e4m3 = OpTypeFloat 8 Float8E4M3EXT
410+
%fp8e5m2 = OpTypeFloat 8 Float8E5M2EXT
411+
%fp8e4m3_matA = OpTypeCooperativeMatrixKHR %fp8e4m3 %subgroup %u32_16 %u32_16 %useA
412+
%fp8e5m2_matA = OpTypeCooperativeMatrixKHR %fp8e5m2 %subgroup %u32_16 %u32_16 %useA
413+
)";
414+
CompileSuccessfully(str.c_str());
415+
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
416+
}
417+
403418
TEST_F(ValidateData, cooperative_matrix_float8_no_capability_bad) {
404419
std::string str = header_with_float8_no_coop_matrix + R"(
405420
%u32 = OpTypeInt 32 0

0 commit comments

Comments
 (0)