diff --git a/sycl/include/CL/sycl/ONEAPI/intel_matrix/matrix.hpp b/sycl/include/CL/sycl/ONEAPI/intel_matrix/matrix.hpp index eff1b805cdb9c..ec19a7c87459a 100644 --- a/sycl/include/CL/sycl/ONEAPI/intel_matrix/matrix.hpp +++ b/sycl/include/CL/sycl/ONEAPI/intel_matrix/matrix.hpp @@ -14,6 +14,10 @@ #pragma once +#include + +#if (SYCL_EXT_ONEAPI_MATRIX == 1) #if defined(__AMXTILE__) && defined(__AMXINT8__) && defined(__AMXBF16__) #include #endif +#endif diff --git a/sycl/include/CL/sycl/feature_test.hpp b/sycl/include/CL/sycl/feature_test.hpp index 71d69136d9783..ea3f7f2e264a9 100644 --- a/sycl/include/CL/sycl/feature_test.hpp +++ b/sycl/include/CL/sycl/feature_test.hpp @@ -12,7 +12,9 @@ namespace sycl { // Feature test macro definitions +// TODO: Move these feature-test macros to compiler driver. #define SYCL_EXT_INTEL_DEVICE_INFO 1 +#define SYCL_EXT_ONEAPI_MATRIX 1 } // namespace sycl } // __SYCL_INLINE_NAMESPACE(cl) diff --git a/sycl/test/on-device/extensions/matrix-amx-bf16-test.cpp b/sycl/test/on-device/extensions/matrix-amx-bf16-test.cpp index e3f94ab1273c1..d36dc334bf074 100644 --- a/sycl/test/on-device/extensions/matrix-amx-bf16-test.cpp +++ b/sycl/test/on-device/extensions/matrix-amx-bf16-test.cpp @@ -1,5 +1,6 @@ // RUN: %clangxx -march=sapphirerapids -fsycl -O2 %s -o %t.out #include +#if (SYCL_EXT_ONEAPI_MATRIX == 1) #include using namespace cl::sycl; @@ -182,3 +183,4 @@ int main() { std::cout << "\n"; } } +#endif diff --git a/sycl/test/on-device/extensions/matrix-amx-int8-test.cpp b/sycl/test/on-device/extensions/matrix-amx-int8-test.cpp index 62e6a90eb8ed8..5cf5c90e1eeaa 100644 --- a/sycl/test/on-device/extensions/matrix-amx-int8-test.cpp +++ b/sycl/test/on-device/extensions/matrix-amx-int8-test.cpp @@ -1,5 +1,6 @@ // RUN: %clangxx -march=sapphirerapids -fsycl -O2 %s -o %t.out #include +#if (SYCL_EXT_ONEAPI_MATRIX == 1) #include using namespace cl::sycl; @@ -167,3 +168,4 @@ int main() { std::cout << "\n"; } } +#endif