Skip to content

Commit

Permalink
fixes for CUDA 11 (#1519)
Browse files Browse the repository at this point in the history
Required fixes to compile CUDA 11.
  • Loading branch information
lukasm91 authored Jun 17, 2020
1 parent f114e74 commit 1d4a744
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/gridtools/common/tuple_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@ namespace gridtools {
Fun m_fun;

template <size_t I, class... Args>
GT_TARGET GT_FORCE_INLINE GT_CONSTEXPR decltype(auto) operator()(Args &&... args) const {
GT_TARGET GT_FORCE_INLINE GT_CONSTEXPR auto operator()(Args &&... args) const
-> decltype(m_fun(wstd::forward<Args>(args)...)) {
return m_fun(wstd::forward<Args>(args)...);
}
};
Expand Down
2 changes: 1 addition & 1 deletion include/gridtools/meta/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* NVCC bug workaround: sizeof... works incorrectly within template alias context.
*/
#if defined(__CUDACC_VER_MAJOR__) && \
(__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 3))
(__CUDACC_VER_MAJOR__ < 11 || (__CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ < 1))

namespace gridtools {
namespace meta {
Expand Down
3 changes: 3 additions & 0 deletions include/gridtools/sid/composite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ namespace gridtools {
template <class... Sids>
class values {
static_assert(sizeof...(Keys) == sizeof...(Sids), GT_INTERNAL_ERROR);
#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ < 1
#else
static_assert(conjunction<is_sid<Sids>...>::value, GT_INTERNAL_ERROR);
#endif

typename hymap::keys<Keys...>::template values<Sids...> m_sids;

Expand Down

0 comments on commit 1d4a744

Please sign in to comment.