forked from kokkos/kokkos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CTAD (deduction guides) for RangePolicy (kokkos#6850)
* Removed the check for NVCC compiler version when testing CTAD, as decltype(RangePolicy(...)) isn't compiling under any version of Cuda. * Added in the explicit deduction guides for RangePolicy: • Correctness when passing in an execution space • Workaround for nvcc as RangePolicy<...> doesn't have any template parameters that can be deduced, so gcc/clang assume that a matching ctor in the primary template deduces to RangePolicy<> while nvcc assumes it is a bug. Rewrote the tests to be of the form: [[maybe_unused]] static inline auto rpxy = RangePolicy(x, y); static_assert(is_same_v<RangePolicy<WhatShouldBeHere>, decltype(rpxy)>); This form avoids the most vexing parse.o, and seems to pass on all compilers. Added tests for SomeExecutionSpace which is guaranteed not to be DefaultExecutionSpace. Added calls to ImplicitlyConvertibleToDefaultExecutionSpace::operator DefaultExecutionSpace() and SomeExecutionSpace::concurrency() to avoid maybe_unused errors under some compilers. Notes: The default constructed CTAD RangePolicy uses list initialization syntax (curlies) instead of parentheses to get around a gcc 8.2 compiler bug. nestodes uses "Kokkos::DefaultExecutionSpace" instead of "auto" in order to trigger the implicit conversion.
- Loading branch information
Showing
2 changed files
with
116 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters