Skip to content

Commit

Permalink
DELME
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalroz committed Nov 17, 2024
1 parent b9cef21 commit 8b61289
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/cuda/api/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,33 @@ inline void copy(span<T> destination, const T(&source)[N], optional_ref<const st
return copy(destination.data(), source, sizeof(T) * N);
}

template <typename T, size_t N>
void foo(T(&destination)[N])
{
(void) destination;
return;
}

template <>
void foo<int, 10>(int(&destination)[10]);

template <typename T, size_t N>
void foo2(span<T const> source) { }

template<>
void foo2<int, 10>(span<int const> source);

template <typename T, size_t N>
void foo3(T(&destination)[N], span<T const> source) {}

template <>
void foo3<int, 10>(int(&destination)[10], span<int const> source);

#ifdef _MSC_VER
template <typename T, size_t N>
using c_array = T[N];
#endif

/**
* Copy the contents of a span into a C-style array
*
Expand All @@ -641,8 +668,13 @@ inline void copy(span<T> destination, const T(&source)[N], optional_ref<const st
* @param source A span of the same element type as the destination array,
* containing the data to be copied
*/
#ifndef _MSC_VER
template <typename T, size_t N>
void copy(T(&destination)[N], span<T const> source, optional_ref<const stream_t> stream = {})
#else
template <typename T, size_t N>
void copy(c_array<T,N>& destination, span<T const> source, optional_ref<const stream_t> stream = {})
#endif
{
#ifndef NDEBUG
if (source.size() > N) {
Expand Down

0 comments on commit 8b61289

Please sign in to comment.