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

Function copy_to_cpu_async

include/common.h:358–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356
357template <class DType>
358void copy_to_cpu_async(DType* hptr, DType* dptr, std::vector<int> shape,
359 cudaStream_t stream = 0) {
360 CUDA_CHECK(cudaMemcpyAsync(
361 hptr, dptr,
362 std::accumulate(shape.begin(), shape.end(), 1, std::multiplies<int>()) *
363 sizeof(DType),
364 cudaMemcpyDeviceToHost, stream));
365}
366
367template <class DType>
368void assert_allclose(DType* res_ptr, DType* golden_ptr, std::vector<int> shape,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected