-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#5635: Serial/OpenMP: Parallel_scan with return value for ThreadVectorRange #6292
#5635: Serial/OpenMP: Parallel_scan with return value for ThreadVectorRange #6292
Conversation
187aa83
to
55f61a0
Compare
55f61a0
to
afbbdcc
Compare
#if defined(KOKKOS_ENABLE_SERIAL) || defined(KOKKOS_ENABLE_OPENMP) | ||
#if !defined(KOKKOS_ENABLE_CUDA) && !defined(KOKKOS_ENABLE_HIP) && \ | ||
!defined(KOKKOS_ENABLE_OPENACC) && !defined(KOKKOS_ENABLE_SYCL) && \ | ||
!defined(KOKKOS_ENABLE_THREADS) && !defined(KOKKOS_ENABLE_OPENMPTARGET) && \ | ||
!defined(KOKKOS_ENABLE_HPX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we not testing if for instance OpenMP+CUDA is enabled?
We can easily do something like
#ifdef KOKKOS_ENABLE_OPENMP
if constexpr (std::is_same_v<TEST_EXECSPACE, OpenMP>)
#endif
#ifdef KOKKOS_ENABLE_SERIAL
if constexpr (std::is_same_v<TEST_EXECSPACE, Serial>)
#endif
ASSERT_TRUE((TestTeamVector::Test<TEST_EXECSPACE>(12)));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all the PRs are ready to introduce this for all backends? So it doesn't seem to matter too much?
[&](int i, Scalar &val, bool final) { | ||
val += i; | ||
|
||
if (final) { | ||
Scalar test = 0; | ||
for (int k = 0; k <= i; k++) test += k; | ||
return_values(team.league_rank(), team.team_rank()) = test; | ||
|
||
if (test != val) { | ||
Kokkos::printf("FAILED vector_par_scan %i %i %lf %lf\n", | ||
team.league_rank(), team.team_rank(), | ||
static_cast<double>(test), | ||
static_cast<double>(val)); | ||
|
||
flag() = 1; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixing computation and checking the result is not good practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw this is following the similar approach used in the other tests here, so if you want to change the overall approach maybe we can do that in a separate PR?
Related to #5635