Skip to content

Commit

Permalink
Bug: storage/gpu.h functions within __CUDA_ARCH__ (#1778)
Browse files Browse the repository at this point in the history
Move gpu target_view functions inside GT_CUDACC instead of GT_CUDA_ARCH
  • Loading branch information
havogt authored Jun 4, 2024
1 parent c60293c commit 0f3df93
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/gridtools/storage/gpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace gridtools {
T *m_ptr;
Info m_info;

#if defined(GT_CUDA_ARCH) or (defined(GT_CUDACC) and defined(__clang__))
#ifdef GT_CUDACC
GT_FUNCTION_DEVICE auto *data() const { return m_ptr; }
GT_FUNCTION_DEVICE auto const &info() const { return m_info; }

Expand All @@ -53,7 +53,6 @@ namespace gridtools {
GT_FUNCTION_DEVICE decltype(auto) strides() const { return m_info.strides(); }
GT_FUNCTION_DEVICE decltype(auto) native_lengths() const { return m_info.native_lengths(); }
GT_FUNCTION_DEVICE decltype(auto) native_strides() const { return m_info.native_strides(); }

template <class... Args>
GT_FUNCTION_DEVICE auto operator()(Args &&...args) const
-> decltype(m_ptr[m_info.index(std::forward<Args>(args)...)]) {
Expand Down

0 comments on commit 0f3df93

Please sign in to comment.