Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit d6f261d

Browse files
committed
updating tests to reflect new support of std::complex by joint_reduce and reduce_over_group
Signed-off-by: Chris Perkins <[email protected]>
1 parent 351f216 commit d6f261d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

SYCL/GroupAlgorithm/reduce_sycl2020.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <CL/sycl.hpp>
1111
#include <algorithm>
1212
#include <cassert>
13+
#include <complex>
1314
#include <limits>
1415
#include <numeric>
1516
using namespace sycl;
@@ -89,5 +90,16 @@ int main() {
8990
test<class KernelNameBitAndI>(q, input, output, sycl::bit_and<int>(), ~0);
9091
#endif // SPIRV_1_3
9192

93+
// as part of SYCL_EXT_ONEAPI_COMPLEX_ALGORITHMS (
94+
// https://github.com/intel/llvm/pull/5108/ ) joint_reduce and
95+
// reduce_over_group now operate on std::complex limited to using the
96+
// sycl::plus binary operation.
97+
std::array<std::complex<float>, N> input_cd;
98+
std::array<std::complex<float>, 4> output_cd;
99+
std::iota(input_cd.begin(), input_cd.end(), 0);
100+
std::fill(output_cd.begin(), output_cd.end(), 0);
101+
test<class KernelNamePlusComplexD>(q, input_cd, output_cd,
102+
sycl::plus<std::complex<float>>(), 0);
103+
92104
std::cout << "Test passed." << std::endl;
93105
}

0 commit comments

Comments
 (0)