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

Function arithOp

src/api/c/binary.cpp:53–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52template<typename T, af_op_t op>
53static inline af_array arithOp(const af_array lhs, const af_array rhs,
54 const dim4 &odims) {
55 const ArrayInfo &linfo = getInfo(lhs);
56 const ArrayInfo &rinfo = getInfo(rhs);
57
58 dtype type = static_cast<af::dtype>(af::dtype_traits<T>::af_type);
59
60 const detail::Array<T> &l =
61 linfo.getType() == type ? getArray<T>(lhs) : castArray<T>(lhs);
62 const detail::Array<T> &r =
63 rinfo.getType() == type ? getArray<T>(rhs) : castArray<T>(rhs);
64
65 return getHandle(arithOp<T, op>(l, r, odims));
66}
67
68template<typename T, af_op_t op>
69static inline af_array arithOpBroadcast(const af_array lhs,

Callers

nothing calls this directly

Calls 2

getHandleFunction · 0.70
getTypeMethod · 0.45

Tested by

no test coverage detected