Skip to content

Commit

Permalink
Add default ParallelFor copy constructor for HIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Rombur committed Jul 6, 2023
1 parent 0db68e4 commit 47f9cee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions core/src/HIP/Kokkos_HIP_Parallel_MDRange.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ class ParallelFor<FunctorType, Kokkos::MDRangePolicy<Traits...>, HIP> {
const FunctorType m_functor;
const Policy m_policy;

ParallelFor() = delete;
public:
ParallelFor() = delete;
ParallelFor(ParallelFor const&) = default;
ParallelFor& operator=(ParallelFor const&) = delete;

public:
inline __device__ void operator()() const {
Kokkos::Impl::DeviceIterateTile<Policy::rank, Policy, FunctorType,
typename Policy::work_tag>(m_policy,
Expand Down
7 changes: 4 additions & 3 deletions core/src/HIP/Kokkos_HIP_Parallel_Range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class ParallelFor<FunctorType, Kokkos::RangePolicy<Traits...>, Kokkos::HIP> {
const FunctorType m_functor;
const Policy m_policy;

ParallelFor() = delete;
ParallelFor& operator=(const ParallelFor&) = delete;

template <class TagType>
inline __device__ std::enable_if_t<std::is_void<TagType>::value> exec_range(
const Member i) const {
Expand All @@ -61,6 +58,10 @@ class ParallelFor<FunctorType, Kokkos::RangePolicy<Traits...>, Kokkos::HIP> {
public:
using functor_type = FunctorType;

ParallelFor() = delete;
ParallelFor(ParallelFor const&) = default;
ParallelFor& operator=(ParallelFor const&) = delete;

inline __device__ void operator()() const {
const Member work_stride = blockDim.y * gridDim.x;
const Member work_end = m_policy.end();
Expand Down
4 changes: 4 additions & 0 deletions core/src/HIP/Kokkos_HIP_Parallel_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ class ParallelFor<FunctorType, Kokkos::TeamPolicy<Properties...>, HIP> {
}

public:
ParallelFor() = delete;
ParallelFor(ParallelFor const&) = default;
ParallelFor& operator=(ParallelFor const&) = delete;

__device__ inline void operator()() const {
// Iterate this block through the league
int64_t threadid = 0;
Expand Down

0 comments on commit 47f9cee

Please sign in to comment.