Skip to content

Commit

Permalink
This PR contains minor code changes and bug fixes needed for LLVM-Clacc
Browse files Browse the repository at this point in the history
compiler to compile the OpenACC backend.
  • Loading branch information
seyonglee committed Jun 23, 2023
1 parent 5b6cb80 commit 016d5d7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions core/src/OpenACC/Kokkos_OpenACC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ static_assert(false,

// FIXME_OPENACC: Below macro is temporarily enabled to avoid issues on existing
// OpenACC compilers not supporting lambda with parallel loops.
// LLVM/Clacc compiler does not need this.
#ifndef KOKKOS_COMPILER_CLANG
#define KOKKOS_ENABLE_OPENACC_COLLAPSE_HIERARCHICAL_CONSTRUCTS
#endif

namespace Kokkos::Experimental::Impl {
class OpenACCInternal;
Expand Down
2 changes: 1 addition & 1 deletion core/src/OpenACC/Kokkos_OpenACC_FunctorAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class FunctorAdapter;
public: \
FunctorAdapter(Functor const &functor) : m_functor(functor) {} \
\
KOKKOS_IMPL_ACC_PRAGMA_HELPER(routine CLAUSE) \
KOKKOS_IMPL_ACC_PRAGMA(routine CLAUSE) \
template <class... Args> \
KOKKOS_FUNCTION void operator()(Args &&... args) const { \
if constexpr (std::is_void_v<WorkTag>) { \
Expand Down
3 changes: 2 additions & 1 deletion core/src/OpenACC/Kokkos_OpenACC_ParallelFor_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ class Kokkos::Impl::ParallelFor<FunctorType, Kokkos::TeamPolicy<Properties...>,
private:
using Policy = Kokkos::Impl::TeamPolicyInternal<Kokkos::Experimental::OpenACC,
Properties...>;
Kokkos::Experimental::Impl::FunctorAdapter<FunctorType, Policy, worker>
Kokkos::Experimental::Impl::FunctorAdapter<
FunctorType, Policy, Kokkos::Experimental::Impl::RoutineClause::worker>
m_functor;
using Member = typename Policy::member_type;

Expand Down
4 changes: 2 additions & 2 deletions core/src/OpenACC/Kokkos_OpenACC_ParallelScan_Range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class Kokkos::Impl::ParallelScan<Functor, Kokkos::RangePolicy<Traits...>,

int const async_arg = base_t::m_policy.space().acc_async_queue();

OpenACCParallelScanRangePolicy(begin, end, chunk_size, async_arg);
base_t::OpenACCParallelScanRangePolicy(begin, end, chunk_size, async_arg);
}

ParallelScan(const Functor& arg_functor,
Expand Down Expand Up @@ -272,7 +272,7 @@ class Kokkos::Impl::ParallelScanWithTotal<

int const async_arg = base_t::m_policy.space().acc_async_queue();

OpenACCParallelScanRangePolicy(begin, end, chunk_size, async_arg);
base_t::OpenACCParallelScanRangePolicy(begin, end, chunk_size, async_arg);
}

template <class ViewType>
Expand Down

0 comments on commit 016d5d7

Please sign in to comment.