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

Function copyData

src/backend/cpu/copy.cpp:34–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33template<typename T>
34void copyData(T *to, const Array<T> &from) {
35 if (from.elements() == 0) { return; }
36
37 from.eval();
38 // Ensure all operations on 'from' are complete before copying data to host.
39 getQueue().sync();
40 if (from.isLinear()) {
41 // FIXME: Check for errors / exceptions
42 memcpy(to, from.get(), from.elements() * sizeof(T));
43 } else {
44 dim4 ostrides = calcStrides(from.dims());
45 kernel::stridedCopy<T>(to, ostrides, from.get(), from.dims(),
46 from.strides(), from.ndims() - 1);
47 }
48}
49
50template<typename T>
51Array<T> copyArray(const Array<T> &A) {

Callers

nothing calls this directly

Calls 10

getQueueFunction · 0.50
calcStridesFunction · 0.50
elementsMethod · 0.45
evalMethod · 0.45
syncMethod · 0.45
isLinearMethod · 0.45
getMethod · 0.45
dimsMethod · 0.45
stridesMethod · 0.45
ndimsMethod · 0.45

Tested by

no test coverage detected