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

[SYCL] Reenable reduction tests and reinforce coverage #1659

Open
wants to merge 2 commits into
base: intel
Choose a base branch
from
Open
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
23 changes: 21 additions & 2 deletions SYCL/Reduction/reduction_range_3d_rw.cpp
Original file line number Diff line number Diff line change
@@ -67,14 +67,12 @@ int main() {
tests<class D2, int>(Q, 99, PlusWithoutIdentity<int>{}, range<3>{2, 2, 2});
tests<class D3, int>(Q, 99, PlusWithoutIdentity<int>{}, range<3>{2, 3, 4});

/* Temporarily disabled
tests<class D4, int64_t>(Q, 99, PlusWithoutIdentity<int64_t>{},
range<3>{1, 1, MaxWGSize + 1});
tests<class D5, int64_t>(Q, 99, PlusWithoutIdentity<int64_t>{},
range<3>{1, MaxWGSize + 1, 1});
tests<class D6, int64_t>(Q, 99, PlusWithoutIdentity<int64_t>{},
range<3>{MaxWGSize + 1, 1, 1});
*/

tests<class D7, int64_t>(Q, 99, PlusWithoutIdentity<int64_t>{},
range<3>{2, 5, MaxWGSize * 2});
@@ -83,6 +81,27 @@ int main() {
tests<class D9, int64_t>(Q, 99, PlusWithoutIdentity<int64_t>{},
range<3>{MaxWGSize * 3, 8, 4});

tests<class E1, int>(Q, 99, MultipliesWithoutIdentity<int>{},
range<3>{1, 1, 1});
tests<class E2, int>(Q, 99, MultipliesWithoutIdentity<int>{},
range<3>{2, 2, 2});
tests<class E3, int>(Q, 99, MultipliesWithoutIdentity<int>{},
range<3>{2, 3, 4});

tests<class E4, int64_t>(Q, 99, MultipliesWithoutIdentity<int64_t>{},
range<3>{1, 1, MaxWGSize + 1});
tests<class E5, int64_t>(Q, 99, MultipliesWithoutIdentity<int64_t>{},
range<3>{1, MaxWGSize + 1, 1});
tests<class E6, int64_t>(Q, 99, MultipliesWithoutIdentity<int64_t>{},
range<3>{MaxWGSize + 1, 1, 1});

tests<class E7, int64_t>(Q, 99, MultipliesWithoutIdentity<int64_t>{},
range<3>{2, 5, MaxWGSize * 2});
tests<class E8, int64_t>(Q, 99, MultipliesWithoutIdentity<int64_t>{},
range<3>{3, MaxWGSize * 3, 2});
tests<class E9, int64_t>(Q, 99, MultipliesWithoutIdentity<int64_t>{},
range<3>{MaxWGSize * 3, 8, 4});

printFinalStatus(NumErrors);
return NumErrors;
}
4 changes: 4 additions & 0 deletions SYCL/Reduction/reduction_utils.hpp
Original file line number Diff line number Diff line change
@@ -141,6 +141,10 @@ template <class T> struct PlusWithoutIdentity {
T operator()(const T &A, const T &B) const { return A + B; }
};

template <class T> struct MultipliesWithoutIdentity {
T operator()(const T &A, const T &B) const { return A * B; }
};

template <typename T> T getMinimumFPValue() {
return std::numeric_limits<T>::has_infinity
? static_cast<T>(-std::numeric_limits<T>::infinity())