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

Function copyArray

src/backend/cuda/copy.cpp:38–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37template<typename T>
38Array<T> copyArray(const Array<T> &src) {
39 Array<T> out = createEmptyArray<T>(src.dims());
40 if (src.elements() > 0) {
41 if (src.isReady()) {
42 if (src.isLinear()) {
43 CUDA_CHECK(cudaMemcpyAsync(
44 out.get(), src.get(), src.elements() * sizeof(T),
45 cudaMemcpyDeviceToDevice, getActiveStream()));
46 } else {
47 kernel::memcopy<T>(out, src, src.ndims());
48 }
49 } else {
50 evalNodes<T>(out, src.getNode().get());
51 }
52 }
53 return out;
54}
55
56template<typename T>
57void multiply_inplace(Array<T> &src, double norm) {

Callers 4

svdFunction · 0.70
createSubArrayFunction · 0.70
copyDataFunction · 0.70
transformFunction · 0.70

Calls 8

getActiveStreamFunction · 0.85
dimsMethod · 0.45
elementsMethod · 0.45
isReadyMethod · 0.45
isLinearMethod · 0.45
getMethod · 0.45
ndimsMethod · 0.45
getNodeMethod · 0.45

Tested by

no test coverage detected