Skip to content

Commit 830bca1

Browse files
[SYCL] Add feature macro for the matrix extension (#3564)
Add feature macro for the matrix interface and its first implementation for AMX
1 parent e4c82cc commit 830bca1

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
#pragma once
1616

17+
#include <CL/sycl/feature_test.hpp>
18+
19+
#if (SYCL_EXT_ONEAPI_MATRIX == 1)
1720
#if defined(__AMXTILE__) && defined(__AMXINT8__) && defined(__AMXBF16__)
1821
#include <CL/sycl/ONEAPI/intel_matrix/matrix-amx.hpp>
1922
#endif
23+
#endif

sycl/include/CL/sycl/feature_test.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ namespace sycl {
1212

1313
// Feature test macro definitions
1414

15+
// TODO: Move these feature-test macros to compiler driver.
1516
#define SYCL_EXT_INTEL_DEVICE_INFO 1
17+
#define SYCL_EXT_ONEAPI_MATRIX 1
1618

1719
} // namespace sycl
1820
} // __SYCL_INLINE_NAMESPACE(cl)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clangxx -march=sapphirerapids -fsycl -O2 %s -o %t.out
22
#include <CL/sycl.hpp>
3+
#if (SYCL_EXT_ONEAPI_MATRIX == 1)
34
#include <iostream>
45

56
using namespace cl::sycl;
@@ -182,3 +183,4 @@ int main() {
182183
std::cout << "\n";
183184
}
184185
}
186+
#endif

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clangxx -march=sapphirerapids -fsycl -O2 %s -o %t.out
22
#include <CL/sycl.hpp>
3+
#if (SYCL_EXT_ONEAPI_MATRIX == 1)
34
#include <iostream>
45

56
using namespace cl::sycl;
@@ -167,3 +168,4 @@ int main() {
167168
std::cout << "\n";
168169
}
169170
}
171+
#endif

0 commit comments

Comments
 (0)