MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / writeHostDataArray

Function writeHostDataArray

src/backend/cuda/Array.cpp:430–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428
429template<typename T>
430void writeHostDataArray(Array<T> &arr, const T *const data,
431 const size_t bytes) {
432 if (!arr.isOwner()) { arr = copyArray<T>(arr); }
433
434 T *ptr = arr.get();
435
436 CUDA_CHECK(cudaMemcpyAsync(ptr, data, bytes, cudaMemcpyHostToDevice,
437 getActiveStream()));
438 CUDA_CHECK(cudaStreamSynchronize(cuda::getActiveStream()));
439}
440
441template<typename T>
442void writeDeviceDataArray(Array<T> &arr, const void *const data,

Callers

nothing calls this directly

Calls 3

getActiveStreamFunction · 0.85
isOwnerMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected