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

Function retain

src/api/c/handle.cpp:32–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace arrayfire {
31
32af_array retain(const af_array in) {
33 const ArrayInfo &info = getInfo(in, false);
34 af_dtype ty = info.getType();
35
36 if (info.isSparse()) {
37 switch (ty) {
38 case f32: return retainSparseHandle<float>(in);
39 case f64: return retainSparseHandle<double>(in);
40 case c32: return retainSparseHandle<detail::cfloat>(in);
41 case c64: return retainSparseHandle<detail::cdouble>(in);
42 default: TYPE_ERROR(1, ty);
43 }
44 } else {
45 switch (ty) {
46 case f32: return retainHandle<float>(in);
47 case f64: return retainHandle<double>(in);
48 case s32: return retainHandle<int>(in);
49 case u32: return retainHandle<uint>(in);
50 case s8: return retainHandle<schar>(in);
51 case u8: return retainHandle<uchar>(in);
52 case c32: return retainHandle<detail::cfloat>(in);
53 case c64: return retainHandle<detail::cdouble>(in);
54 case b8: return retainHandle<char>(in);
55 case s64: return retainHandle<intl>(in);
56 case u64: return retainHandle<uintl>(in);
57 case s16: return retainHandle<short>(in);
58 case u16: return retainHandle<ushort>(in);
59 case f16: return retainHandle<half>(in);
60 default: TYPE_ERROR(1, ty);
61 }
62 }
63}
64
65af_array createHandle(const dim4 &d, af_dtype dtype) {
66 // clang-format off

Callers 15

af_accumFunction · 0.85
af_scanFunction · 0.85
af_scan_by_keyFunction · 0.85
af_moddimsFunction · 0.85
af_flatFunction · 0.85
af_lookupFunction · 0.85
af_medfilt1Function · 0.85
af_medfilt2Function · 0.85
af_assign_seqFunction · 0.85
af_assign_genFunction · 0.85
reduce_typeFunction · 0.85
reduce_promoteFunction · 0.85

Calls 2

isSparseMethod · 0.80
getTypeMethod · 0.45

Tested by

no test coverage detected