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

Function writeDeviceDataArray

src/backend/opencl/Array.cpp:520–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518
519template<typename T>
520void writeDeviceDataArray(Array<T> &arr, const void *const data,
521 const size_t bytes) {
522 if (!arr.isOwner()) { arr = copyArray<T>(arr); }
523
524 Buffer &buf = *arr.get();
525
526 clRetainMemObject(reinterpret_cast<cl_mem>(const_cast<void *>(data)));
527 Buffer data_buf =
528 Buffer(reinterpret_cast<cl_mem>(const_cast<void *>(data)));
529
530 getQueue().enqueueCopyBuffer(data_buf, buf, 0,
531 static_cast<size_t>(arr.getOffset()), bytes);
532}
533
534template<typename T>
535void Array<T>::setDataDims(const dim4 &new_dims) {

Callers

nothing calls this directly

Calls 5

BufferClass · 0.70
getQueueFunction · 0.50
isOwnerMethod · 0.45
getMethod · 0.45
getOffsetMethod · 0.45

Tested by

no test coverage detected