Skip to content

Commit fceaf94

Browse files
authored
[NFC][SYCL][SPIR-V] Remove JointMatrixINTEL type W/A (#7081)
It's no longer needed after #6535 Signed-off-by: Sidorov, Dmitry <[email protected]>
1 parent 35f3d54 commit fceaf94

File tree

3 files changed

+8
-29
lines changed

3 files changed

+8
-29
lines changed

sycl/include/CL/__spirv/spirv_types.hpp

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -123,36 +123,15 @@ enum class MatrixUse : uint32_t {
123123
Unnecessary = 3
124124
};
125125

126-
// TODO: replace the following W/A with a better solution when we have it.
127-
// The following structure is used to represent the joint matrix type in the
128-
// LLVM IR. The structure has a pointer to a multidimensional array member which
129-
// makes the encoding of the matrix type information within the LLVM IR looks
130-
// like this:
131-
// %struct.__spirv_JointMatrixINTEL = type { [42 x [6 x [2 x [1 x float]]]]* }
132-
// Note that an array cannot be of zero size but MatrixLayout and Scope
133-
// parameters can; hence '+ 1' is added to the 3rd and 4th dimensions.
134-
// In general, representing a matrix type information like this is a bit odd
135-
// (especially for MatrixLayout and Scope parameters). But with the current
136-
// tools we have in Clang, this is the only way to preserve and communicate this
137-
// information to SPIRV translator.
138-
// The long term solution would be to introduce a matrix type in Clang and use
139-
// it instead of this member.
140126
#if (SYCL_EXT_ONEAPI_MATRIX_VERSION > 1)
141127
template <typename T, std::size_t R, std::size_t C, MatrixLayout L,
142128
Scope::Flag S = Scope::Flag::Subgroup,
143129
MatrixUse U = MatrixUse::Unnecessary>
144-
struct __spirv_JointMatrixINTEL {
145-
T(*Value)
146-
[R][C][static_cast<size_t>(L) + 1][static_cast<size_t>(S) + 1]
147-
[static_cast<size_t>(U) + 1];
148-
};
130+
struct __spirv_JointMatrixINTEL;
149131
#else
150132
template <typename T, std::size_t R, std::size_t C, MatrixLayout L,
151133
Scope::Flag S = Scope::Flag::Subgroup>
152-
struct __spirv_JointMatrixINTEL {
153-
T(*Value)
154-
[R][C][static_cast<size_t>(L) + 1][static_cast<size_t>(S) + 1];
155-
};
134+
struct __spirv_JointMatrixINTEL;
156135
#endif // SYCL_EXT_ONEAPI_MATRIX_VERSION
157136

158137
} // namespace __spv

sycl/test/matrix/matrix-int8-test-use.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clangxx -fsycl -fsycl-device-only -DSYCL_EXT_ONEAPI_MATRIX_VERSION=2 -O2 -S -emit-llvm -o - %s | FileCheck %s
22

3-
// CHECK-DAG: %spirv.JointMatrixINTEL._char_12_48_4_3_0 = type { [12 x [48 x [5 x [4 x [1 x i8]]]]] addrspace(4)* }
4-
// CHECK-DAG: %spirv.JointMatrixINTEL._int_12_12_4_3_2 = type { [12 x [12 x [5 x [4 x [3 x i32]]]]] addrspace(4)* }
5-
// CHECK-DAG: %spirv.JointMatrixINTEL._char_48_12_4_3_1 = type { [48 x [12 x [5 x [4 x [2 x i8]]]]] addrspace(4)* }
3+
// CHECK-DAG: %spirv.JointMatrixINTEL._char_12_48_4_3_0 = type opaque
4+
// CHECK-DAG: %spirv.JointMatrixINTEL._int_12_12_4_3_2 = type opaque
5+
// CHECK-DAG: %spirv.JointMatrixINTEL._char_48_12_4_3_1 = type opaque
66

77
#include <iostream>
88
#include <sycl/sycl.hpp>

sycl/test/matrix/matrix-int8-test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clangxx -fsycl -fsycl-device-only -O2 -S -emit-llvm -o - %s | FileCheck %s
22

3-
// CHECK-DAG: %spirv.JointMatrixINTEL._char_12_48_0_3 = type { [12 x [48 x [1 x [4 x i8]]]] addrspace(4)* }
4-
// CHECK-DAG: %spirv.JointMatrixINTEL._int_12_12_0_3 = type { [12 x [12 x [1 x [4 x i32]]]] addrspace(4)* }
5-
// CHECK-DAG: %spirv.JointMatrixINTEL._char_48_12_3_3 = type { [48 x [12 x [4 x [4 x i8]]]] addrspace(4)* }
3+
// CHECK-DAG: %spirv.JointMatrixINTEL._char_12_48_0_3 = type opaque
4+
// CHECK-DAG: %spirv.JointMatrixINTEL._int_12_12_0_3 = type opaque
5+
// CHECK-DAG: %spirv.JointMatrixINTEL._char_48_12_3_3 = type opaque
66

77
#include <iostream>
88
#include <sycl/sycl.hpp>

0 commit comments

Comments
 (0)