@@ -91,7 +91,8 @@ auto exception_handler = [](sycl::exception_list exceptions) {
9191};
9292
9393template <typename F>
94- bool launchInlineASMTestImpl (F &f, bool requires_particular_sg_size = true ) {
94+ bool launchInlineASMTestImpl (F &f, bool requires_particular_sg_size = true ,
95+ std::vector<int > RequiredSGSizes = {}) {
9596 sycl::queue deviceQueue (sycl::gpu_selector_v, exception_handler);
9697 sycl::device device = deviceQueue.get_device ();
9798
@@ -108,6 +109,16 @@ bool launchInlineASMTestImpl(F &f, bool requires_particular_sg_size = true) {
108109 return false ;
109110 }
110111
112+ auto sg_sizes = device.get_info <sycl::info::device::sub_group_sizes>();
113+ if (std::any_of (RequiredSGSizes.begin (), RequiredSGSizes.end (),
114+ [&](size_t RequiredSGSize) {
115+ return std::find (sg_sizes.begin (), sg_sizes.end (),
116+ RequiredSGSize) == sg_sizes.end ();
117+ })) {
118+ std::cout << " Skipping test\n " ;
119+ return false ;
120+ }
121+
111122 deviceQueue.submit (f).wait_and_throw ();
112123
113124 return true ;
@@ -118,10 +129,12 @@ bool launchInlineASMTestImpl(F &f, bool requires_particular_sg_size = true) {
118129// / \returns false if test wasn't launched (i.e.was skipped) and true otherwise
119130template <typename F>
120131bool launchInlineASMTest (F &f, bool requires_particular_sg_size = true ,
121- bool exception_expected = false ) {
132+ bool exception_expected = false ,
133+ std::vector<int > RequiredSGSizes = {}) {
122134 bool result = false ;
123135 try {
124- result = launchInlineASMTestImpl (f, requires_particular_sg_size);
136+ result = launchInlineASMTestImpl (f, requires_particular_sg_size,
137+ RequiredSGSizes);
125138 } catch (sycl::exception &e) {
126139 std::string what = e.what ();
127140 if (exception_expected &&
0 commit comments