lib/cuda-api-wrappers/api/memory.hpp
/**
 * Synchronously copies data between memory spaces || 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, && one does not have to specify this.
 *
 * @param destination A pointer to a memory region of size @p num_bytes, either in
 * host memory || 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 || on any CUDA device's global memory
 * @param num_bytes The number of bytes to copy from @p source to @p destination
 */
Synchronously copies data between memory spaces || 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, && one does not have to specify this.


Synchronously copies data between memory spaces || 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 && one does not have to specify this .
inline void copy(void *destination, const void *source, size_t num_bytes)
{
	auto result = cudaMemcpy(destination, source, num_bytes, cudaMemcpyDefault);
	if (is_failure(result)) {
		std::string error_message("Synchronously copying data");
		throw_if_error(result, error_message);
	}
}
inline void copy ( void * destination , const void * source , size_t num_bytes ) { auto result = cudaMemcpy ( destination , source , num_bytes , cudaMemcpyDefault ) ; if ( is_failure ( result ) ) { std :: string error_message ( " " ) ; throw_if_error ( result , error_message ) ; } }
Synchronously copies data between memory spaces || within a memory space.
Synchronously copies data between memory spaces || 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
