1 #ifndef HeterogeneousCore_CUDAUtilities_interface_copyAsync_h
2 #define HeterogeneousCore_CUDAUtilities_interface_copyAsync_h
24 "For array types, use the other overload with the size parameter");
25 cudaCheck(cudaMemcpyAsync(dst.get(), src.get(),
sizeof(
T), cudaMemcpyHostToDevice, stream));
29 inline void copyAsync(device::unique_ptr<T>&
dst,
const host::noncached::unique_ptr<T>&
src, cudaStream_t
stream) {
33 "For array types, use the other overload with the size parameter");
34 cudaCheck(cudaMemcpyAsync(dst.get(), src.get(),
sizeof(
T), cudaMemcpyHostToDevice, stream));
40 "For array types, use the other overload with the size parameter");
41 cudaCheck(cudaMemcpyAsync(dst.get(), src.get(),
sizeof(
T), cudaMemcpyDeviceToHost, stream));
50 cudaStream_t stream) {
51 cudaCheck(cudaMemcpyAsync(dst.get(), src.get(), nelements *
sizeof(
T), cudaMemcpyHostToDevice, stream));
58 cudaStream_t stream) {
59 cudaCheck(cudaMemcpyAsync(dst.get(), src.get(), nelements *
sizeof(
T), cudaMemcpyHostToDevice, stream));
66 cudaStream_t stream) {
67 cudaCheck(cudaMemcpyAsync(dst.get(), src.get(), nelements *
sizeof(
T), cudaMemcpyDeviceToHost, stream));
74 cudaStream_t stream) {
75 cudaCheck(cudaMemcpyAsync(dst.get(), src.data(), src.size() *
sizeof(
T), cudaMemcpyHostToDevice, stream));
82 cudaStream_t stream) {
84 get_underlying(dst).
get(), src.data(), src.size() *
sizeof(
T), cudaMemcpyHostToDevice, stream));
89 #endif // HeterogeneousCore_CUDAUtilities_interface_copyAsync_h
std::unique_ptr< T, impl::HostDeleter > unique_ptr
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
constexpr T & get_underlying(propagate_const< T > &)
std::unique_ptr< T, impl::HostDeleter > unique_ptr
#define cudaCheck(ARG,...)