Skip to content

Commit c957c7b

Browse files
[SYCL][Matrix] Move joint_matrix to experimental::matrix namespace (#3584)
1 parent 3acd27b commit c957c7b

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

sycl/include/CL/sycl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <CL/sycl/ONEAPI/filter_selector.hpp>
1414
#include <CL/sycl/ONEAPI/function_pointer.hpp>
1515
#include <CL/sycl/ONEAPI/group_algorithm.hpp>
16-
#include <CL/sycl/ONEAPI/intel_matrix/matrix.hpp>
16+
#include <CL/sycl/ONEAPI/matrix/matrix.hpp>
1717
#include <CL/sycl/ONEAPI/reduction.hpp>
1818
#include <CL/sycl/ONEAPI/sub_group.hpp>
1919
#include <CL/sycl/accessor.hpp>

sycl/include/CL/sycl/ONEAPI/intel_matrix/matrix-amx.hpp renamed to sycl/include/CL/sycl/ONEAPI/matrix/matrix-amx.hpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ template <typename T> class submatrix {
4646
short rows, cols;
4747
};
4848

49+
// TODO: we are adding it this way until sycl::dynamic_extent gets implemented.
4950
constexpr size_t dynamic_extent = std::numeric_limits<size_t>::max();
5051

5152
template <typename T> struct elems_per_dword {
@@ -62,7 +63,7 @@ ELEMS_PER_DWORD(unsigned short, 2)
6263

6364
} // namespace detail
6465

65-
namespace matrix {
66+
namespace experimental::matrix {
6667
using namespace cl::sycl;
6768
using namespace cl::sycl::ONEAPI;
6869

@@ -196,10 +197,12 @@ struct joint_matrix<
196197
joint_matrix(Group sg) {}
197198
};
198199

199-
} // namespace matrix
200+
} // namespace experimental::matrix
200201

201202
namespace detail {
202203

204+
using namespace experimental;
205+
203206
template <typename Group, typename T, size_t NumRows, size_t NumCols,
204207
matrix::matrix_layout Layout>
205208
inline __SYCL_ALWAYS_INLINE static
@@ -231,7 +234,8 @@ inline __SYCL_ALWAYS_INLINE static
231234
uint32_t row, uint32_t col, size_t stride,
232235
matrix::matrix_layout layout, bool shouldreload) {
233236
if (shouldreload) {
234-
// Force sub_m.tile's shape to be matrix::tile_size * matrix::tile_size * 4
237+
// Force sub_m.tile's shape to be matrix::tile_size *
238+
// matrix::tile_size * 4
235239
int8_t NewjmC[matrix::tile_size * matrix::tile_size * 4];
236240
matrix::tilestored64_internal(NumRows, NumCols * sizeof(T),
237241
reinterpret_cast<char *>(NewjmC),
@@ -309,7 +313,7 @@ inline __SYCL_ALWAYS_INLINE static
309313

310314
} // namespace detail
311315

312-
namespace matrix {
316+
namespace experimental::matrix {
313317

314318
// This handles cases where matrix can't be accommodated by a tile
315319
template <typename Group, typename T, size_t NumRows, size_t NumCols,
@@ -439,7 +443,7 @@ joint_matrix_mad(Group sg,
439443
return;
440444
}
441445

442-
} // namespace matrix
446+
} // namespace experimental::matrix
443447
} // namespace intel
444448
} // namespace ext
445449
} // namespace sycl

sycl/include/CL/sycl/ONEAPI/intel_matrix/matrix.hpp renamed to sycl/include/CL/sycl/ONEAPI/matrix/matrix.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818

1919
#if (SYCL_EXT_ONEAPI_MATRIX == 1)
2020
#if defined(__AMXTILE__) && defined(__AMXINT8__) && defined(__AMXBF16__)
21-
#include <CL/sycl/ONEAPI/intel_matrix/matrix-amx.hpp>
21+
#include <CL/sycl/ONEAPI/matrix/matrix-amx.hpp>
2222
#endif
2323
#endif

sycl/test/on-device/extensions/matrix-amx-bf16-test.cpp renamed to sycl/test/matrix/matrix-amx-bf16-test.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
#if (SYCL_EXT_ONEAPI_MATRIX == 1)
44
#include <iostream>
55

6-
using namespace cl::sycl;
7-
using namespace cl::sycl::intel;
8-
using namespace cl::sycl::ext::intel::matrix;
6+
using namespace sycl::intel;
7+
using namespace sycl::ext::intel::experimental::matrix;
98

109
#define TILE_SZ 16
1110
#define TM (3 * TILE_SZ-1)

sycl/test/on-device/extensions/matrix-amx-int8-test.cpp renamed to sycl/test/matrix/matrix-amx-int8-test.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
#if (SYCL_EXT_ONEAPI_MATRIX == 1)
44
#include <iostream>
55

6-
using namespace cl::sycl;
7-
using namespace cl::sycl::intel;
8-
using namespace cl::sycl::ext::intel::matrix;
6+
using namespace sycl::intel;
7+
using namespace sycl::ext::intel::experimental::matrix;
98

109
#define TILE_SZ 16
1110
#define TM (4 * TILE_SZ-4)

0 commit comments

Comments
 (0)