thirdparty/cuda/api/memory.hpp
inline void copy(void *destination, const void *source, size_t num_bytes, stream::id_t stream_id)
{
	auto result = cudaMemcpyAsync(destination, source, num_bytes, cudaMemcpyDefault, stream_id);
	if (is_failure(result)) {
		std::string error_message("Scheduling a memory copy on stream " + cuda::detail::ptr_as_hex(stream_id));
		// TODO: Determine whether it was from host to device, device to host etc and
		// add this information to the error string
		throw_if_error(result, error_message);
	}
}
/**
 * Asynchronously copies data between memory spaces or within a memory space.
 *
 * @note Since we assume Compute Capability >= 2.0, all devices support the
 * Unified Virtual Address Space, so the CUDA driver can determine, for each pointer,
 * where the data is located, and one does not have to specify this.
 *
 * @note asynchronous version of @ref memory::copy
 *
 * @param destination A pointer to a memory region of size @p num_bytes, either in
 * host memory or on any CUDA device's global memory
 * @param source A pointer to a a memory region of size @p num_bytes, either in
 * host memory or on any CUDA device's global memory
 * @param num_bytes The number of bytes to copy from @p source to @p destination
 */
Asynchronously copies data between memory spaces or within a memory space.
@note Since we assume Compute Capability >= 2.0, all devices support the
Unified Virtual Address Space, so the CUDA driver can determine, for each pointer,
where the data is located, and one does not have to specify this.

@note asynchronous version of @ref memory::copy


Asynchronously copies data between memory spaces or within a memory space . @note Since we assume Compute Capability > = 2 . 0 all devices support the Unified Virtual Address Space so the CUDA driver can determine for each pointer where the data is located and one does not have to specify this . @note asynchronous version of @ref memory :: copy
inline void copy(void *destination, const void *source, size_t num_bytes, stream::id_t stream_id)
{
	auto result = cudaMemcpyAsync(destination, source, num_bytes, cudaMemcpyDefault, stream_id);
	if (is_failure(result)) {
		std::string error_message("Scheduling a memory copy on stream " + cuda::detail::ptr_as_hex(stream_id));
		throw_if_error(result, error_message);
	}
}
inline void copy ( void * destination , const void * source , size_t num_bytes , stream :: id_t stream_id ) { auto result = cudaMemcpyAsync ( destination , source , num_bytes , cudaMemcpyDefault , stream_id ) ; if ( is_failure ( result ) ) { std :: string error_message ( " " + cuda :: detail :: ptr_as_hex ( stream_id ) ) ; throw_if_error ( result , error_message ) ; } }
Asynchronously copies data between memory spaces or within a memory space.
Asynchronously copies data between memory spaces or within a memory space .
// TODO: Determine whether it was from host to device, device to host etc and // add this information to the error string