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

Function writeDeviceDataArray

src/backend/oneapi/Array.cpp:515–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513
514template<typename T>
515void writeDeviceDataArray(Array<T> &arr, const void *const data,
516 const size_t bytes) {
517 if (!arr.isOwner()) { arr = copyArray<T>(arr); }
518
519 sycl::buffer<T> *dataptr =
520 static_cast<sycl::buffer<T> *>(const_cast<void *>(data));
521 auto arr_get = arr.get();
522 getQueue().submit([&](sycl::handler &h) {
523 auto src_acc = dataptr->template get_access<sycl::access_mode::read>(
524 h, sycl::range(bytes / sizeof(T)));
525 auto dst_acc = arr_get->template get_access<sycl::access_mode::write>(
526 h, sycl::range(bytes / sizeof(T)), arr.getOffset());
527 h.copy(src_acc, dst_acc);
528 });
529}
530
531template<typename T>
532void Array<T>::setDataDims(const dim4 &new_dims) {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected