diff --git a/SYCL/OptionalKernelFeatures/is_compatible.cpp b/SYCL/OptionalKernelFeatures/is_compatible.cpp index 62e8aa6cb67de..91e8d89afbeb3 100644 --- a/SYCL/OptionalKernelFeatures/is_compatible.cpp +++ b/SYCL/OptionalKernelFeatures/is_compatible.cpp @@ -13,6 +13,10 @@ class KernelCPU; class KernelGPU; class KernelACC; +class GoodWGSize; +class WrongReqWGSize; + +constexpr int SIZE = 2; int main() { bool Compatible = true; @@ -42,5 +46,29 @@ int main() { Called = true; } + if (sycl::is_compatible(Dev)) { + Q.submit([&](sycl::handler &h) { + h.parallel_for( + sycl::range<2>(4, 2), + [=](sycl::item<2> it) [[sycl::reqd_work_group_size(SIZE, SIZE)]] {}); + }); + Q.wait(); + Compatible &= (Dev.get_info() > + (SIZE * SIZE)); + Called = true; + } + + if (Dev.get_info() > INT_MAX) { + Compatible &= true; + } + if (sycl::is_compatible(Dev)) { + assert(false && "sycl::is_compatible must be false"); + Q.submit([&](sycl::handler &h) { + h.parallel_for( + sycl::range<1>(2), + [=](sycl::item<1> it) [[sycl::reqd_work_group_size(INT_MAX)]] {}); + }); + } + return (Compatible && Called) ? 0 : 1; }