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

Function copy_to_cpu

include/common.h:349–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347
348template <class DType>
349void copy_to_cpu(DType* hptr, DType* dptr, std::vector<int> shape) {
350 CUDA_CHECK(cudaMemcpy(
351 hptr, dptr,
352 std::accumulate(shape.begin(), shape.end(), 1, std::multiplies<int>()) *
353 sizeof(DType),
354 cudaMemcpyDeviceToHost));
355}
356
357template <class DType>
358void copy_to_cpu_async(DType* hptr, DType* dptr, std::vector<int> shape,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected