MCPcopy Create free account
hub / github.com/KnowingNothing/MatmulTutorial / copy_to_gpu_async

Function copy_to_gpu_async

include/common.h:339–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337
338template <class DType>
339void copy_to_gpu_async(DType* hptr, DType* dptr, std::vector<int> shape,
340 cudaStream_t stream = 0) {
341 CUDA_CHECK(cudaMemcpyAsync(
342 dptr, hptr,
343 std::accumulate(shape.begin(), shape.end(), 1, std::multiplies<int>()) *
344 sizeof(DType),
345 cudaMemcpyHostToDevice, stream));
346}
347
348template <class DType>
349void copy_to_cpu(DType* hptr, DType* dptr, std::vector<int> shape) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected