-
Notifications
You must be signed in to change notification settings - Fork 0
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
Replace SFINAE by if constexpr
for create_mirror*
#6
base: refactor/create-mirror/variables
Are you sure you want to change the base?
Replace SFINAE by if constexpr
for create_mirror*
#6
Conversation
Typo in loop indices, from wrong copy-paste.
Disabling call to value checker as it is not supported by the backend.
Co-authored-by: Damien L-G <dalg24@gmail.com>
if constexpr
if constexpr
for create_mirror*
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.
Please try to run on most of the backends and with Kokkos testing configuration.
I had some weird behavior with constexpr
on some architectures.
* Fix bug in Makefile when using AMD GPU architectures * Fix indentation * Fix documentation of the architecture to match the code
Ok, will try the different compilers. |
* Cuda: Fix configuring with CMake 3.29.0 * CMake 3.28.4 is also affected
Fix Makefile.kokkos for Threads
* Update Intel GPU architectures in Makefile * Add some comments
Don't use Fedora development version in GitHub CI
* Move Kokkos::Array tests to a more suitable place * Workaround bogous(?) compile error with Array::operator[] not being constexpr
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.
Looks good to me. I wonder if we could also if constexpr
-ise the create_mirror_view
between lines 3575 and 3599 in the new version ?
core/src/Kokkos_CopyViews.hpp
Outdated
create_mirror_view(const Kokkos::View<T, P...>& src, | ||
const Impl::ViewCtorProp<ViewCtorArgs...>& arg_prop) { | ||
return Kokkos::Impl::create_mirror(src, arg_prop); | ||
auto create_mirror_view(const Kokkos::View<T, P...>& src, |
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 notice two changes:
- the use of
auto
, - some functions were marked
inline
.
I would suggest to mention these changes when you open a PR.
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.
The inline
functions were also templated, so I wonder if the keyword was necessary.
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.
Well the keyword is primarily a hint for the compiler to actually inline a function call before avoiding an ODR violation.
Personally I would remove the keyword in this case.
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 changed my mind about the inline
keyword, and let its use unaltered. According to this SO answer, function templates are not inlined by default. This change was outside the scope of this PR.
The logic of the public |
Enable deprecated code and deprecated warnings in nightly CI
DESUL: Use builtin atomics in the HIP backend
…e_cuda_hip_w_omp Fix use of OpenMP with Cuda or HIP as compile language
…ed_element_type Fix support for `Kokkos::Array` of const-qualified element type
Fix Copyright file
Fix fedora CI builds with flang-new
…okkos#6983) * Also use is_nothrow_swappable workaround for Intel Classic Compilers * Use template parameter U directly in kokkos_swap overload
* Add thread-safety tests * Disable thread-safety tests for Serial and OpenMP for now * Cleanup include and namespace * Skip tests for OpenACC in CMakeLists.txt * Avoid std::move * Comment on tests * Use more atomics * Simplify test
Co-Authored-By: Andrey Prokopenko <prokopenkoav@ornl.gov>
…rison_operators_pair_t1_void Fix deprecation warnings with GCC for `pair<T1,void>` comparison operators
…y_path Fix TPL_LIBRARY_SUFFIXES for 32-bit build
…ement types (kokkos#6993) * Add few missing constexpr for alloc_prop_input Co-authored-by: Daniel Arndt <arndtd@ornl.gov> * Update tests * Fix DualView * Address review comments * Add missing decorators * Move NoDefaultConstructor out of function --------- Co-authored-by: Daniel Arndt <arndtd@ornl.gov>
* SYCL: Make Parallel* copyable * Address review comments * Refactor Team policies further * Fix alias for SYCL TeamPolicy ParallelReduce * Improve const-correctness in Kokkos_SYCL_ParallelReduce_Team * Fix up Kokkos_SYCL_ParallelReduce_Team.hpp
* [ci skip] update changelog for 4.3.1 * changelog: fixup
OpenMPTarget: Use mutex lock for parallel scan.
…llel_for_range_deprecations SYCL: Fix deprecation in custom parallel_for RangePolicy implementation
It looks like an oversight. It is unused. Example code that referred to it was removed in kokkos#2688 because it was just sitting there, i.e. not built nor tested. KokkosKernels has its own CMake logic to find it and link against it.
Remove cuSPARSE TPL
* SYCL: Print submission command queue property * Also print SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS if set * Reword printout for environment variable Co-authored-by: Damien L-G <dalg24+github@gmail.com> --------- Co-authored-by: Damien L-G <dalg24+github@gmail.com>
…#6999) * Introduce `KOKKOS_IMPL_DISABLE_DEPRECATED_WARNINGS_{PUSH,POP} macros to suppress diagnostics when appropriate * Suppress all deprecated warnings I can see in tests * Update EDG diag suppress to fix the Intel Compiler Classic and provide a fallback empty definition for the macros
This PR is a refactor without side effects.
The idea is to simplify the code of
create_mirror*
functions by applying techniques of the C++ 17 standard. A refactor with the similar approach was drafted by @masterleinad in kokkos#5533.The multiple overloaded functions of
Impl::create_mirror
,Impl::create_mirror_view
, andImpl::create_mirror_view_and_copy
that use SFINAE are replaced by one function that usesif constexpr
instead (for Kokkos views, offset views, dynamic views and dynamic rank views). Eventually, the return type of these functions is replaced byauto
, and decided depending on which branch of theif constexpr
is used.The logic of the public
create_mirror*
functions (which is sometimes redundant with the logic of the private functions) is not altered in this PR and will be assessed in an upcoming one.This PR is part of a of a larger effort which aims to assess kokkos#6842.
Built and tested successfully for:
8.2.08.4.0 with OpenMP;8.2.08.4.0 with CUDA11.011.4;19.0.52023.2.1 with OpenMP;2022.0.02024.0.2 with SYCL;2021.1.12023.2.1 with OpenMP;