From 3a3ac9def04100733f69aafe3dab060c99d752f7 Mon Sep 17 00:00:00 2001 From: Eyal Rozenberg Date: Sun, 20 Oct 2024 22:20:29 +0300 Subject: [PATCH] Fixes #687: Unified interface of regular and async variants of `memory::copy_single()` --- src/cuda/api/memory.hpp | 6 +++--- src/cuda/api/multi_wrapper_impls/memory.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cuda/api/memory.hpp b/src/cuda/api/memory.hpp index 766d2209..cd8e9dd7 100644 --- a/src/cuda/api/memory.hpp +++ b/src/cuda/api/memory.hpp @@ -1094,9 +1094,9 @@ void copy(const array_t& destination, const T* source, stream * @param stream_handle A stream on which to enqueue the copy operation */ template -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_ @@ -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 -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 diff --git a/src/cuda/api/multi_wrapper_impls/memory.hpp b/src/cuda/api/multi_wrapper_impls/memory.hpp index 8e18ae9e..f9b80c65 100644 --- a/src/cuda/api/multi_wrapper_impls/memory.hpp +++ b/src/cuda/api/multi_wrapper_impls/memory.hpp @@ -81,9 +81,9 @@ inline void copy(span destination, const array_t& source, c } template -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