Skip to content

[SYCL] Prohibit usage of <sycl/sycl.hpp> in E2E tests #13875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "math_utils.hpp"
#include <iostream>
#include <math.h>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

namespace s = sycl;
constexpr s::access::mode sycl_read = s::access::mode::read;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/DeviceLib/math_windows_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "math_utils.hpp"
#include <iostream>
#include <math.h>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

namespace s = sycl;
constexpr s::access::mode sycl_read = s::access::mode::read;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/QueueFlushing/queue_flushing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %t.out

#include <stdlib.h>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>
#include <vector>

using namespace sycl;
Expand Down
17 changes: 10 additions & 7 deletions sycl/test-e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,13 @@ llvm-lit --param dpcpp_compiler=path/to/clang++ --param dump_ir=True \
While SYCL specification dictates that the only user-visible interface is
`<sycl/sycl.hpp>` header file we found out that as the implementation and
multiple extensions grew, the compile time was getting worse and worse,
negatively affecting our CI turnaround time. We are just starting some efforts
to create a much smaller set of basic feature needed for every SYCL end-to-end
test/program so that this issue could be somewhat mitigated. This activity is in
its early stage and NO production code should rely on it. It WILL be changed as
we go with our experiments. For any code outside of this project only the
`<sycl/sycl.hpp>` must be used until we feel confident to propose an extension
that can provide an alternative.
negatively affecting our CI turnaround time. As such, we decided to use
finer-grained includes for the end-to-end tests used in this project (under
`sycl/test-e2e/` folder).

At this moment all the tests have been updated to include a limited set of
headers only. However, the work of eliminating unnecessary dependencies between
implementation header files is still in progress and the final set of these
"fine-grained" includes that might be officially documented and suggested for
customers to use isn't determined yet. **Until then, code outside of this project
must keep using `<sycl/sycl.hpp>` provided by the SYCL2020 specification.**
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/compile_on_win_with_mdd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// the compile line. In that case, user application will crash during launching
// with abort() message.

#include <sycl/sycl.hpp>
#include <sycl/queue.hpp>

#include <iostream>

Expand Down
3 changes: 2 additions & 1 deletion sycl/test-e2e/SubGroup/generic_reduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

#include "helper.hpp"
#include <complex>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>
#include <sycl/group_algorithm.hpp>

using namespace sycl;

Expand Down
14 changes: 14 additions & 0 deletions sycl/test-e2e/no_sycl_hpp_in_e2e_tests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// REQUIRES: linux
//
// RUN: grep -r -l 'sycl.hpp' %S | FileCheck %s
// RUN: grep -r -l 'sycl.hpp' %S | wc -l | FileCheck %s --check-prefix CHECK-NUM-MATCHES
//
// CHECK-DAG: README.md
// CHECK-DAG: no_sycl_hpp_in_e2e_tests.cpp
// CHECK-DAG: lit.cfg.py
//
// CHECK-NUM-MATCHES: 3
//
// This test verifies that `<sycl/sycl.hpp>` isn't used in E2E tests. Instead,
// fine-grained includes should used, see
// https://github.com/intel/llvm/tree/sycl/sycl/test-e2e#sycldetailcorehpp
Loading