diff --git a/sycl/test-e2e/GroupAlgorithm/exclusive_scan_sycl2020.cpp b/sycl/test-e2e/GroupAlgorithm/exclusive_scan_sycl2020.cpp index 8d60cea9a377d..cff6376edb723 100644 --- a/sycl/test-e2e/GroupAlgorithm/exclusive_scan_sycl2020.cpp +++ b/sycl/test-e2e/GroupAlgorithm/exclusive_scan_sycl2020.cpp @@ -1,9 +1,6 @@ // RUN: %{build} -Wno-error=deprecated-declarations -fsycl-device-code-split=per_kernel -I . -o %t.out // RUN: %{run} %t.out -// XFAIL: preview-mode -// XFAIL-TRACKER: https://github.com/intel/llvm/issues/18390 - #include "../helpers.hpp" #include "support.h" #include @@ -173,14 +170,9 @@ int main() { test(input, sycl::bit_xor(), 0); test(input_small, sycl::bit_and(), ~0); - test(input, sycl::logical_or(), 0); - test(input, sycl::logical_and(), 1); - std::array bool_input = {}; test(bool_input, sycl::logical_or(), false); - test(bool_input, sycl::logical_or<>(), false); test(bool_input, sycl::logical_and(), true); - test(bool_input, sycl::logical_and<>(), true); std::array int2_input = {}; std::iota(int2_input.begin(), int2_input.end(), 0); diff --git a/sycl/test-e2e/GroupAlgorithm/inclusive_scan_sycl2020.cpp b/sycl/test-e2e/GroupAlgorithm/inclusive_scan_sycl2020.cpp index 73fd739b23a6a..7e0d6aeb509f4 100644 --- a/sycl/test-e2e/GroupAlgorithm/inclusive_scan_sycl2020.cpp +++ b/sycl/test-e2e/GroupAlgorithm/inclusive_scan_sycl2020.cpp @@ -1,9 +1,6 @@ // RUN: %{build} -Wno-error=deprecated-declarations -fsycl-device-code-split=per_kernel -I . -o %t.out // RUN: %{run} %t.out -// XFAIL: preview-mode -// XFAIL-TRACKER: https://github.com/intel/llvm/issues/18390 - #include "../helpers.hpp" #include "support.h" #include @@ -169,21 +166,10 @@ int main() { test(input_small, sycl::multiplies(), 1); test(input, sycl::bit_or(), 0); test(input, sycl::bit_xor(), 0); - test(input_small, sycl::bit_and(), ~0); - - test(input, sycl::logical_or(), 0); - test(input, sycl::logical_and(), 1); std::array bool_input = {}; test(bool_input, sycl::logical_or(), false); - test(bool_input, sycl::logical_or<>(), false); - test(bool_input, sycl::logical_and(), true); - test(bool_input, sycl::logical_and<>(), true); - - test(bool_input, sycl::logical_or(), false); - test(bool_input, sycl::logical_or<>(), false); test(bool_input, sycl::logical_and(), true); - test(bool_input, sycl::logical_and<>(), true); std::array int2_input = {}; std::iota(int2_input.begin(), int2_input.end(), 0); diff --git a/sycl/test-e2e/GroupAlgorithm/reduce_sycl2020.cpp b/sycl/test-e2e/GroupAlgorithm/reduce_sycl2020.cpp index ec12db383c8c1..9bc40d9a2c909 100644 --- a/sycl/test-e2e/GroupAlgorithm/reduce_sycl2020.cpp +++ b/sycl/test-e2e/GroupAlgorithm/reduce_sycl2020.cpp @@ -1,9 +1,6 @@ // RUN: %{build} -fsycl-device-code-split=per_kernel -I . -o %t.out // RUN: %{run} %t.out -// XFAIL: preview-mode -// XFAIL-TRACKER: https://github.com/intel/llvm/issues/18390 - #include "support.h" #include @@ -100,14 +97,9 @@ int main() { test(input, sycl::bit_xor(), 0); test(input, sycl::bit_and(), ~0); - test(input, sycl::logical_or(), 0); - test(input, sycl::logical_and(), 1); - std::array bool_input = {}; test(bool_input, sycl::logical_or(), false); - test(bool_input, sycl::logical_or<>(), false); test(bool_input, sycl::logical_and(), true); - test(bool_input, sycl::logical_and<>(), true); std::array int2_input = {}; std::iota(int2_input.begin(), int2_input.end(), 0); diff --git a/sycl/test/group_algorithms/logical_or_and_group_algorithms.cpp b/sycl/test/group_algorithms/logical_or_and_group_algorithms.cpp new file mode 100644 index 0000000000000..5553efe364fbc --- /dev/null +++ b/sycl/test/group_algorithms/logical_or_and_group_algorithms.cpp @@ -0,0 +1,77 @@ +// RUN: %clangxx -fsycl -Xclang -verify=expected -Xclang -verify-ignore-unexpected=note -fpreview-breaking-changes -fsyntax-only -fsycl-device-only -ferror-limit=0 %s + +#include + +using namespace sycl; + +constexpr size_t N = 8; +range<2> global{16, 32}; +range<2> local{4, 8}; +id<2> groupId{1, 2}; +group<2> g = detail::Builder::createGroup(global, local, groupId); +int *rawIn = nullptr; +int *rawOut = nullptr; + +void ExclusiveScanOverGroup() { + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + exclusive_scan_over_group(g, 0, sycl::logical_and{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + exclusive_scan_over_group(g, 0, 0, sycl::logical_and{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + exclusive_scan_over_group(g, 0, sycl::logical_or{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + exclusive_scan_over_group(g, 0, 0, sycl::logical_or{}); +} + +void JointExclusiveScan() { + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + joint_exclusive_scan(g, rawIn, rawIn + N, rawOut, sycl::logical_and{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + joint_exclusive_scan(g, rawIn, rawIn + N, rawOut, sycl::logical_or{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + joint_exclusive_scan(g, rawIn, rawIn + N, rawOut, 0, + sycl::logical_and{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + joint_exclusive_scan(g, rawIn, rawIn + N, rawOut, 0, sycl::logical_or{}); +} + +void InclusiveScanOverGroup() { + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + inclusive_scan_over_group(g, 0, sycl::logical_and{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + inclusive_scan_over_group(g, 0, sycl::logical_and{}, 0); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + inclusive_scan_over_group(g, 0, sycl::logical_or{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + inclusive_scan_over_group(g, 0, sycl::logical_or{}, 0); +} + +void JointInclusiveScan() { + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + joint_inclusive_scan(g, rawIn, rawIn + N, rawOut, sycl::logical_and{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + joint_inclusive_scan(g, rawIn, rawIn + N, rawOut, sycl::logical_or{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + joint_inclusive_scan(g, rawIn, rawIn + N, rawOut, sycl::logical_and{}, + 0); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match scan accumulation type}} + joint_inclusive_scan(g, rawIn, rawIn + N, rawOut, sycl::logical_or{}, 0); +} + +void ReduceOverGroup() { + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match reduction accumulation type}} + reduce_over_group(g, 0, sycl::logical_and{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match reduction accumulation type}} + reduce_over_group(g, 0, 0, sycl::logical_and{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match reduction accumulation type}} + reduce_over_group(g, 0, sycl::logical_or{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match reduction accumulation type}} + reduce_over_group(g, 0, 0, sycl::logical_or{}); +} + +void JointReduce() { + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match reduction accumulation type}} + joint_reduce(g, rawIn, rawIn + N, 0, sycl::logical_and{}); + // expected-error@sycl/group_algorithm.hpp:* {{Result type of binary_op must match reduction accumulation type}} + joint_reduce(g, rawIn, rawIn + N, 0, sycl::logical_or{}); +}