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

Function writeHostDataArray

src/backend/oneapi/Array.cpp:500–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498
499template<typename T>
500void writeHostDataArray(Array<T> &arr, const T *const data,
501 const size_t bytes) {
502 if (!arr.isOwner()) { arr = copyArray<T>(arr); }
503 auto arr_get = arr.get();
504 getQueue()
505 .submit([&](sycl::handler &h) {
506 auto host_acc =
507 arr_get->template get_access<sycl::access_mode::write>(
508 h, sycl::range(bytes / sizeof(T)), arr.getOffset());
509 h.copy(data, host_acc);
510 })
511 .wait();
512}
513
514template<typename T>
515void writeDeviceDataArray(Array<T> &arr, const void *const data,

Callers

nothing calls this directly

Calls 7

rangeFunction · 0.70
getQueueFunction · 0.50
isOwnerMethod · 0.45
getMethod · 0.45
waitMethod · 0.45
getOffsetMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected