alpaka-group / alpaka

Abstraction Library for Parallel Kernel Acceleration :llama:
https://alpaka.readthedocs.io
Mozilla Public License 2.0
358 stars 74 forks source link

Use `if constexpr` #1500

Closed j-stephan closed 2 years ago

j-stephan commented 3 years ago

Since we heavily rely on template metaprogramming we should investigate where we can (sensibly) use if constexpr instead of std::enable_if and friends.

psychocoderHPC commented 2 years ago

Note: For such a refactoring keep the design principles of alpaka in mind. std::enable_if is mostly used together with SFINAE to keep alpaka extendable from the user/thrid-party code outside of alpaka. Never the less I thing we have some places where if constexpr would make the implementation much easier because such parts are not extendable or exposed to the user of alpaka.