Skip to content

Commit 8478af2

Browse files
authored
Merge branch 'intel:sycl' into sycl-hostpipe-runtime
2 parents 15136a6 + 21afc0c commit 8478af2

File tree

16 files changed

+76
-70
lines changed

16 files changed

+76
-70
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ To contribute:
6969
can be reviewed, tested and merged independently.
7070
- For changes which require modification in tests outside of the current repository
7171
the commit message should contain the link to corresponding test PR.
72-
For example: intel/llvm-test-suite#88 or KhronosGroup/SYCL-CTS#65. (see
72+
For example: KhronosGroup/SYCL-CTS#65. (see
7373
[Autolinked references and URLs](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls)
7474
for more details). The same message should be present both in commit
7575
message and in PR description.

llvm/test/Transforms/SPIRITTAnnotations/itt_atomic_load.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
;; The test serves a purpose to check if Atomic load instruction is being
22
;; annotated by SPIRITTAnnotations pass
33
;;
4-
;; Compiled from https://github.com/intel/llvm-test-suite/blob/intel/SYCL/AtomicRef/load.cpp
4+
;; Compiled from https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/AtomicRef/load.cpp
55
;; with following commands:
66
;; clang++ -fsycl -fsycl-device-only load.cpp -o load.bc
77

llvm/test/Transforms/SPIRITTAnnotations/itt_atomic_store.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
;; The test serves a purpose to check if Atomic store instruction is being
22
;; annotated by SPIRITTAnnotations pass
33
;;
4-
;; Compiled from https://github.com/intel/llvm-test-suite/blob/intel/SYCL/AtomicRef/load.cpp
4+
;; Compiled from https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/AtomicRef/load.cpp
55
;; with following commands:
66
;; clang++ -fsycl -fsycl-device-only load.cpp -o load.bc
77

llvm/test/Transforms/SPIRITTAnnotations/itt_barrier.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
;; The test serves a purpose to check if barrier instruction is being annotated
22
;; by SPIRITTAnnotations pass
33
;;
4-
;; Compiled from https://github.com/intel/llvm-test-suite/blob/intel/SYCL/KernelAndProgram/kernel-and-program.cpp
4+
;; Compiled from the SYCL End-to-End test KernelAndProgram/kernel-and-program.cpp last available in
5+
;; https://github.com/intel/llvm-test-suite/blob/3be0c4dae326f187664cdaa1b9730b446ec4ae29/SYCL/KernelAndProgram/kernel-and-program.cpp
56
;; with following commands:
67
;; clang++ -fsycl -fsycl-device-only kernel-and-program.cpp -o kernel_and_program_optimized.bc
78

sycl/doc/GetStartedGuide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,10 @@ architecture. It is possible to change it by adding
533533
`-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=<target>` to the CMake
534534
variable `SYCL_CLANG_EXTRA_FLAGS`.
535535
536-
#### Run DPC++ E2E test suite
536+
#### Run DPC++ E2E tests
537537
538538
Follow instructions from the link below to build and run tests:
539-
[README](https://github.com/intel/llvm-test-suite/tree/intel/SYCL#execution)
539+
[README](https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/README.md#build-and-run-tests)
540540
541541
#### Run Khronos\* SYCL\* conformance test suite (optional)
542542

sycl/doc/design/SharedLibraries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,4 +607,4 @@ same name as one of the explicitly linked libraries.
607607
## Related links
608608
609609
1. Test plan for this feature
610-
https://github.com/intel/llvm-test-suite/blob/intel/SYCL/TestPlans/DynamicLinkingTestPlan.md
610+
https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/TestPlans/DynamicLinkingTestPlan.md

sycl/doc/developer/ContributeToDPCPP.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ Every product change should be accompanied with corresponding test modification
4949
(adding new test(s), extending, removing or modifying existing test(s)).
5050

5151
There are 3 types of tests which are used for DPC++ toolchain validation:
52-
* DPC++ in-tree tests
52+
* DPC++ device-independent tests
5353
* DPC++ end-to-end (E2E) tests
5454
* SYCL Conformance Test Suite (CTS)
5555

56-
### DPC++ in-tree tests
56+
### DPC++ device-independent tests
5757

58-
DPC++ in-tree tests are hosted in this repository. They can be run by
58+
DPC++ device-independent tests are hosted in this repository. They can be run by
5959
[check-llvm](/llvm/test), [check-clang](/clang/test),
6060
[check-llvm-spirv](/llvm-spirv/test) and [check-sycl](/sycl/test) targets.
6161
These tests are expected not to have hardware (e.g. GPU, FPGA, etc.) or
@@ -144,12 +144,13 @@ When adding new test to `check-sycl`, please consider the following:
144144
145145
### DPC++ end-to-end (E2E) tests
146146
147-
These tests are extension to
148-
[LLVM test suite](https://github.com/intel/llvm-test-suite/tree/intel/SYCL)
149-
and hosted at separate repository.
147+
These tests are located in [/sycl/test-e2e](/sycl/test-e2e) directory and are not
148+
configured to be run by default. See
149+
[End-to-End tests documentation](/sycl/test-e2e/README.md)
150+
for instructions on how to run them.
151+
150152
A test which requires full stack including backend runtimes (e.g. OpenCL,
151-
Level Zero or CUDA) should be added to DPC++ E2E test suite following
152-
[CONTRIBUTING](https://github.com/intel/llvm-test-suite/blob/intel/CONTRIBUTING.md).
153+
Level Zero or CUDA) should be added to DPC++ E2E tests.
153154
154155
### SYCL Conformance Test Suite (CTS)
155156

sycl/doc/extensions/deprecated/sycl_ext_oneapi_spec_constants.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ Here the values of specialization constants `SC0` and `SC1` are changed on
5555
every loop iteration. All what's needed is re-creating a `program` class
5656
instance, setting new values and rebuilding it via
5757
`program::build_with_kernel_type`. JIT compiler will effectively replace
58-
`sc0.get()` and `sc1.get()` within thhe device code with the corresponding
59-
constant values (`sc_vals[i][0]` and `sc_vals[i][1]`). Full runnable example
58+
`sc0.get()` and `sc1.get()` within the device code with the corresponding
59+
constant values (`sc_vals[i][0]` and `sc_vals[i][1]`). Full runnable examples
6060
can be found on
61-
[github](https://github.com/intel/llvm-test-suite/blob/intel/SYCL/SpecConstants/1.2.1/spec_const_redefine.cpp).
61+
[github](https://github.com/intel/llvm/tree/sycl/sycl/test-e2e/SpecConstants/2020/).
6262
6363
Specialization constants can be used in programs compiled Ahead-Of-Time, in this
6464
case a specialization constant takes default value for its type (as specified by

sycl/doc/extensions/experimental/sycl_ext_intel_esimd/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ yet allows to write explicitly vectorized device code. This helps programmer to
66
have more control over the generated code and depend less on compiler
77
optimizations. The [specification](sycl_ext_intel_esimd.md),
88
[API reference](https://intel.github.io/llvm-docs/doxygen/group__sycl__esimd.html), and
9-
[working code examples](https://github.com/intel/llvm-test-suite/tree/intel/SYCL/ESIMD) are available on the Intel DPC++ project's github.
9+
[working code examples](https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/ESIMD/) are available on the Intel DPC++ project's github.
1010

1111
**_NOTE:_** _Some parts of this extension is under active development and APIs in the
1212
`sycl::ext::intel::experimental::esimd` package are subject to change. There are
@@ -45,7 +45,7 @@ a special attribute - `[[intel::sycl_explicit_simd]]`. This tells the compiler t
4545
this kernel is a ESIMD one and ESIMD APIs can be used inside it. Here the `simd`
4646
objects and `copy_to` intrinsics are used which are avaiable only in the ESIMD extension.
4747
Full runnable code sample can be found on the
48-
[github repo](https://github.com/intel/llvm-test-suite/blob/intel/SYCL/ESIMD/vadd_usm.cpp).
48+
[github repo](https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/ESIMD/vadd_usm.cp).
4949
5050
#### Compiling and running ESIMD code
5151

sycl/doc/extensions/experimental/sycl_ext_intel_esimd/esimd_emulator.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ List of target platforms supported by CM_EMU is as follows
7373
Compilation step for ESIMD kernels prepared for ESIMD_EMULATOR backend
7474
is same as for OpenCL and Level Zero backends. Full runnable code
7575
sample used below can be found on the [github
76-
repo](https://github.com/intel/llvm-test-suite/blob/intel/SYCL/ESIMD/vadd_usm.cpp).
76+
repo](/sycl/test-e2e/ESIMD/vadd_usm.cpp).
7777

7878
To compile using the open-source Intel DPC++ compiler:
7979
> `$ clang++ -fsycl vadd_usm.cpp`
@@ -92,39 +92,35 @@ so they can't be used simultaneously by a SYCL offload application process. On t
9292
hand, it is OK to mix the emulator with non-Intel GPU devices or CPU device in
9393
`ONEAPI_DEVICE_SELECTOR`.
9494

95-
## Running ESIMD examples from [ESIMD test suite](https://github.com/intel/llvm-test-suite/tree/intel/SYCL/ESIMD) on github with ESIMD_EMULATOR backend
95+
## Running ESIMD examples from [ESIMD test suite](/sycl/test-e2e/ESIMD/) on github with ESIMD_EMULATOR backend
9696

9797
```
9898
# Get sources
99-
git clone https://github.com/intel/llvm-test-suite
100-
cd llvm-test-suite
99+
git clone https://github.com/intel/llvm
100+
cd llvm/sycl/test-e2e
101101
mkdir build && cd build
102102
103103
# Configure for make utility with compiler tools available in $PATH
104104
cmake \
105-
-DCMAKE_CXX_COMPILER=clang++ \
106-
-DTEST_SUITE_SUBDIRS=SYCL \
107-
-DSYCL_BE="ext_intel_esimd_emulator" \
108-
-DSYCL_TARGET_DEVICES="gpu" \
105+
-DSYCL_CXX_COMPILER=clang++ \
106+
-DSYCL_TEST_E2E_TARGETS="ext_intel_esimd_emulator:gpu" \
109107
..
110108
111109
# Build and Run
112-
make check
110+
make check-sycl-e2e
113111
114112
# Or, for Ninja utility
115-
cmake -G Ninja \
116-
-DCMAKE_CXX_COMPILER=clang++ \
117-
-DTEST_SUITE_SUBDIRS=SYCL \
118-
-DSYCL_BE="ext_intel_esimd_emulator" \
119-
-DSYCL_TARGET_DEVICES="gpu" \
113+
cmake -G Ninja \
114+
-DSYCL_CXX_COMPILER=clang++ \
115+
-DSYCL_TEST_E2E_TARGETS="ext_intel_esimd_emulator:gpu" \
120116
..
121117
122118
# Build and Run
123-
ninja check
119+
ninja check-sycl-e2e
124120
125121
```
126122

127-
Note that only [ESIMD Kernels](https://github.com/intel/llvm-test-suite/tree/intel/SYCL/ESIMD) are
123+
Note that only [ESIMD Kernels](/sycl/test-e2e/ESIMD/) are
128124
tested with above command examples due to ESIMD_EMULATOR's limitations
129125
below. And, if 'CM_RT_PLATFORM' is not set, 'skl' is set by default.
130126

sycl/doc/extensions/experimental/sycl_ext_intel_esimd/sycl_ext_intel_esimd.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ looks as below if packed as 8x8 matrix with `uint32_t` elements:
668668

669669
and is passed to `xmx::dpas()` as simd<uint32_t, 8*8> {(b0<<16)|a0, | (b1<<16)|a1, ..., (b7<<16)|a7, (d0<<16)|c0, ..., ..., p7<<16\|o7}.
670670

671-
Some more examples can be found in test for `xmx::dpas()` in [LIT tests](https://github.com/intel/llvm-test-suite/tree/intel/SYCL/ESIMD/dpas).
671+
Some more examples can be found in test for `xmx::dpas()` in [LIT tests](https://github.com/intel/llvm/tree/sycl/sycl/test-e2e/ESIMD/dpas).
672672

673673
### Other APIs
674674

@@ -907,4 +907,4 @@ int main(void) {
907907
}
908908
```
909909
more examples can be found in the
910-
[ESIMD test suite](https://github.com/intel/llvm-test-suite/tree/intel/SYCL/ESIMD) on github.
910+
[ESIMD test suite](https://github.com/intel/llvm/tree/sycl/sycl/test-e2e/ESIMD) on github.

sycl/include/sycl/group_algorithm.hpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -315,29 +315,6 @@ reduce_over_group(Group g, V x, T init, BinaryOperation binary_op) {
315315
}
316316

317317
// ---- joint_reduce
318-
template <typename Group, typename Ptr, class BinaryOperation>
319-
detail::enable_if_t<
320-
(is_group_v<std::decay_t<Group>> && detail::is_pointer<Ptr>::value &&
321-
detail::is_arithmetic_or_complex<
322-
typename detail::remove_pointer<Ptr>::type>::value &&
323-
detail::is_plus_or_multiplies_if_complex<
324-
typename detail::remove_pointer<Ptr>::type, BinaryOperation>::value),
325-
typename detail::remove_pointer<Ptr>::type>
326-
joint_reduce(Group g, Ptr first, Ptr last, BinaryOperation binary_op) {
327-
#ifdef __SYCL_DEVICE_ONLY__
328-
using T = typename detail::remove_pointer<Ptr>::type;
329-
T init = detail::identity_for_ga_op<T, BinaryOperation>();
330-
return joint_reduce(g, first, last, init, binary_op);
331-
#else
332-
(void)g;
333-
(void)first;
334-
(void)last;
335-
(void)binary_op;
336-
throw runtime_error("Group algorithms are not supported on host.",
337-
PI_ERROR_INVALID_DEVICE);
338-
#endif
339-
}
340-
341318
template <typename Group, typename Ptr, typename T, class BinaryOperation>
342319
detail::enable_if_t<
343320
(is_group_v<std::decay_t<Group>> && detail::is_pointer<Ptr>::value &&
@@ -373,6 +350,29 @@ joint_reduce(Group g, Ptr first, Ptr last, T init, BinaryOperation binary_op) {
373350
#endif
374351
}
375352

353+
template <typename Group, typename Ptr, class BinaryOperation>
354+
detail::enable_if_t<
355+
(is_group_v<std::decay_t<Group>> && detail::is_pointer<Ptr>::value &&
356+
detail::is_arithmetic_or_complex<
357+
typename detail::remove_pointer<Ptr>::type>::value &&
358+
detail::is_plus_or_multiplies_if_complex<
359+
typename detail::remove_pointer<Ptr>::type, BinaryOperation>::value),
360+
typename detail::remove_pointer<Ptr>::type>
361+
joint_reduce(Group g, Ptr first, Ptr last, BinaryOperation binary_op) {
362+
#ifdef __SYCL_DEVICE_ONLY__
363+
using T = typename detail::remove_pointer<Ptr>::type;
364+
T init = detail::identity_for_ga_op<T, BinaryOperation>();
365+
return joint_reduce(g, first, last, init, binary_op);
366+
#else
367+
(void)g;
368+
(void)first;
369+
(void)last;
370+
(void)binary_op;
371+
throw runtime_error("Group algorithms are not supported on host.",
372+
PI_ERROR_INVALID_DEVICE);
373+
#endif
374+
}
375+
376376
// ---- any_of_group
377377
template <typename Group>
378378
detail::enable_if_t<is_group_v<std::decay_t<Group>>, bool>

sycl/test-e2e/External/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ is specified binaries will be used directly ignoring other parameters.
5656
Get sources
5757

5858
```
59-
git clone https://github.com/intel/llvm-test-suite
60-
cd llvm-test-suite
59+
git clone https://github.com/intel/llvm
60+
cd llvm/sycl/test-e2e
6161
mkdir build
6262
cd build
6363
```
@@ -68,13 +68,12 @@ With compiler tools available in the PATH:
6868
# Configure
6969
cmake \
7070
-DCMAKE_CXX_COMPILER=clang++ \
71-
-DTEST_SUITE_SUBDIRS=SYCL \
72-
-DCHECK_SYCL_ALL="level_zero:gpu" \
71+
-DSYCL_TEST_E2E_TARGETS="level_zero:gpu" \
7372
-DSYCL_EXTERNAL_TESTS="RSBench" \
7473
..
7574
7675
# Build and Run
77-
make check-sycl-all
76+
make check-sycl-e2e
7877
7978
```
8079

sycl/test-e2e/GroupAlgorithm/reduce_sycl2020.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,18 @@ void test(queue q, InputContainer input, OutputContainer output,
3434
cgh.parallel_for<SpecializationKernelName>(
3535
nd_range<1>(G, G), [=](nd_item<1> it) {
3636
group<1> g = it.get_group();
37+
auto sg = it.get_sub_group();
3738
int lid = it.get_local_id(0);
3839
out[0] = reduce_over_group(g, in[lid], binary_op);
3940
out[1] = reduce_over_group(g, in[lid], init, binary_op);
4041
out[2] = joint_reduce(g, in.get_pointer(), in.get_pointer() + N,
4142
binary_op);
4243
out[3] = joint_reduce(g, in.get_pointer(), in.get_pointer() + N,
4344
init, binary_op);
45+
out[4] = joint_reduce(sg, in.get_pointer(), in.get_pointer() + N,
46+
binary_op);
47+
out[5] = joint_reduce(sg, in.get_pointer(), in.get_pointer() + N,
48+
init, binary_op);
4449
});
4550
});
4651
}
@@ -54,6 +59,10 @@ void test(queue q, InputContainer input, OutputContainer output,
5459
std::accumulate(input.begin(), input.end(), identity, binary_op));
5560
assert(output[3] ==
5661
std::accumulate(input.begin(), input.end(), init, binary_op));
62+
assert(output[4] ==
63+
std::accumulate(input.begin(), input.end(), identity, binary_op));
64+
assert(output[5] ==
65+
std::accumulate(input.begin(), input.end(), init, binary_op));
5766
}
5867

5968
int main() {
@@ -65,7 +74,7 @@ int main() {
6574

6675
constexpr int N = 128;
6776
std::array<int, N> input;
68-
std::array<int, 4> output;
77+
std::array<int, 6> output;
6978
std::iota(input.begin(), input.end(), 0);
7079
std::fill(output.begin(), output.end(), 0);
7180

@@ -93,7 +102,7 @@ int main() {
93102
// sycl::plus binary operation.
94103
#ifdef SYCL_EXT_ONEAPI_COMPLEX_ALGORITHMS
95104
std::array<std::complex<float>, N> input_cf;
96-
std::array<std::complex<float>, 4> output_cf;
105+
std::array<std::complex<float>, 6> output_cf;
97106
std::iota(input_cf.begin(), input_cf.end(), 0);
98107
std::fill(output_cf.begin(), output_cf.end(), 0);
99108
test<class KernelNamePlusComplexF>(q, input_cf, output_cf,

sycl/test/extensions/inline_asm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This is a basic acceptance test for inline ASM feature. More tests can be
2-
// found in https://github.com/intel/llvm-test-suite/tree/intel/SYCL/InlineAsm
2+
// found in https://github.com/intel/llvm/tree/sycl/sycl/test-e2e/InlineAsm
33
// RUN: %clangxx -fsycl -fsyntax-only %s
44

55
#include <cmath>

sycl/unittests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ include(AddSYCLUnitTest)
2424

2525
add_custom_target(check-sycl-unittests)
2626

27-
# TODO PI tests require real hardware and must be moved to intel/llvm-test-suite
27+
# TODO PI tests require real hardware and must be moved to sycl/test-e2e.
2828
option(SYCL_PI_TESTS "Enable PI-specific unit tests" ON)
2929

3030
if (SYCL_PI_TESTS)

0 commit comments

Comments
 (0)