Skip to content

Commit

Permalink
[SYCL][E2E] Make layout_array.cpp use specific headers (intel#16822)
Browse files Browse the repository at this point in the history
The layout_array test is currently prone to failure if any of the types
it checks are instantiated by the headers rather than by the test
itself. This means that unrelated changes to the SYCL headers may make
the test fail due to one of the types being instantiated earlier than
the test instantiates other types that go before it. To avoid this
issue, this commit makes the test use specific headers, reducing the
chance of instantiations.

This commit also fixes a faulty expectation in the `nd_item` test case.

---------

Signed-off-by: Larsen, Steffen <[email protected]>
Co-authored-by: Daniel Skrobot <[email protected]>
  • Loading branch information
steffenlarsen and dyniols authored Jan 30, 2025
1 parent adeaea8 commit 20d4bec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sycl/test/abi/layout_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

// clang-format off

// TODO fix individual headers and include them instead of sycl.hpp
#include <sycl/sycl.hpp>
#include <sycl/id.hpp>
#include <sycl/nd_item.hpp>
#include <sycl/nd_range.hpp>


SYCL_EXTERNAL void id(sycl::id<2>) {}
Expand All @@ -30,7 +31,7 @@ SYCL_EXTERNAL void range(sycl::range<2>) {}
//----------------------------

SYCL_EXTERNAL void nd_item(sycl::nd_item<2>) {}
// CHECK: 0 | class sycl::nd_item<> (empty)
// CHECK: 0 | class sycl::nd_item<2> (empty)
// CHECK-NEXT: | [sizeof=1, dsize=0, align=1,
// CHECK-NEXT: | nvsize=0, nvalign=1]

Expand Down

0 comments on commit 20d4bec

Please sign in to comment.