Skip to content

Commit

Permalink
Fixes #687: Unified interface of regular and async variants of `memor…
Browse files Browse the repository at this point in the history
…y::copy_single<T>()`
  • Loading branch information
eyalroz committed Oct 28, 2024
1 parent af2e447 commit 3a3ac9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/cuda/api/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1094,9 +1094,9 @@ void copy(const array_t<T, NumDimensions>& destination, const T* source, stream
* @param stream_handle A stream on which to enqueue the copy operation
*/
template <typename T>
void copy_single(T& destination, const T& source, stream::handle_t stream_handle)
void copy_single(T* destination, const T* source, stream::handle_t stream_handle)
{
copy(&destination, &source, sizeof(T), stream_handle);
copy(destination, source, sizeof(T), stream_handle);
}

} // namespace detail_
Expand Down Expand Up @@ -1364,7 +1364,7 @@ inline void copy(T(&destination)[N], const_region_t source, const stream_t& stre
* @param stream The CUDA command queue on which this copying will be enqueued
*/
template <typename T>
void copy_single(T& destination, const T& source, const stream_t& stream);
void copy_single(T* destination, const T* source, const stream_t& stream);

} // namespace async

Expand Down
4 changes: 2 additions & 2 deletions src/cuda/api/multi_wrapper_impls/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ inline void copy(span<T> destination, const array_t<T, NumDimensions>& source, c
}

template <typename T>
inline void copy_single(T& destination, const T& source, const stream_t& stream)
inline void copy_single(T* destination, const T* source, const stream_t& stream)
{
detail_::copy_single(&destination, &source, sizeof(T), stream.handle());
detail_::copy_single(destination, source, sizeof(T), stream.handle());
}

} // namespace async
Expand Down

0 comments on commit 3a3ac9d

Please sign in to comment.