Skip to content

Commit

Permalink
kokkos#5635: Move some tests for parallel_scan to TestTeamScan
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable authored and cz4rs committed Sep 27, 2023
1 parent 190bfe4 commit 4f6ddd1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions core/unit_test/TestTeamScan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ TEST(TEST_CATEGORY, team_scan) {
// Temporary: This condition will progressively be reduced when parallel_scan
// with return value will be implemented for more backends.
#if !defined(KOKKOS_ENABLE_OPENACC) && !defined(KOKKOS_ENABLE_SYCL) && \
!defined(KOKKOS_ENABLE_THREADS) && !defined(KOKKOS_ENABLE_OPENMPTARGET) && \
!defined(KOKKOS_ENABLE_HPX)
!defined(KOKKOS_ENABLE_OPENMPTARGET) && !defined(KOKKOS_ENABLE_HPX)
template <class ExecutionSpace, class DataType>
struct TestTeamScanRetVal {
using execution_space = ExecutionSpace;
Expand Down Expand Up @@ -186,10 +185,16 @@ struct TestTeamScanRetVal {
a_r = view_2d_type("a_r", M, N);
a_s = view_1d_type("a_s", M);

// Execute calculations
Kokkos::parallel_for(policy_type(M, Kokkos::AUTO), *this);

// Set team size explicitly to check whether non-power-of-two team sizes can
// be used.
if (ExecutionSpace().concurrency() > 10000)
Kokkos::parallel_for(policy_type(M, 127), *this);
else if (ExecutionSpace().concurrency() > 2)
Kokkos::parallel_for(policy_type(M, 3), *this);
else
Kokkos::parallel_for(policy_type(M, 1), *this);
Kokkos::fence();

auto a_i = Kokkos::create_mirror_view(a_d);
auto a_o = Kokkos::create_mirror_view(a_r);
auto a_os = Kokkos::create_mirror_view(a_s);
Expand Down

0 comments on commit 4f6ddd1

Please sign in to comment.