Skip to content

Commit

Permalink
Fix ChunkSpan constructor (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau authored Nov 17, 2023
1 parent 08b369e commit a504c0f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/ddc/chunk_span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ class ChunkSpan<ElementType, DiscreteDomain<DDims...>, LayoutStridedPolicy, Memo
/** Constructs a new ChunkSpan from a Chunk, yields a new view to the same data
* @param other the Chunk to view
*/
template <class OElementType, class Allocator>
template <
class OElementType,
class Allocator,
class = std::enable_if_t<std::is_same_v<typename Allocator::memory_space, MemorySpace>>>
KOKKOS_FUNCTION constexpr ChunkSpan(
Chunk<OElementType, mdomain_type, Allocator>& other) noexcept
: base_type(other.m_internal_mdspan, other.m_domain)
Expand All @@ -146,7 +149,8 @@ class ChunkSpan<ElementType, DiscreteDomain<DDims...>, LayoutStridedPolicy, Memo
class OElementType,
class SFINAEElementType = ElementType,
class = std::enable_if_t<std::is_const_v<SFINAEElementType>>,
class Allocator>
class Allocator,
class = std::enable_if_t<std::is_same_v<typename Allocator::memory_space, MemorySpace>>>
KOKKOS_FUNCTION constexpr ChunkSpan(
Chunk<OElementType, mdomain_type, Allocator> const& other) noexcept
: base_type(other.m_internal_mdspan, other.m_domain)
Expand Down

0 comments on commit a504c0f

Please sign in to comment.