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

Function af_add

src/api/c/binary.cpp:282–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282af_err af_add(af_array *out, const af_array lhs, const af_array rhs,
283 const bool batchMode) {
284 try {
285 // Check if inputs are sparse
286 const ArrayInfo &linfo = getInfo(lhs, false);
287 const ArrayInfo &rinfo = getInfo(rhs, false);
288
289 if (linfo.isSparse() && rinfo.isSparse()) {
290 return af_arith_sparse<af_add_t>(out, lhs, rhs);
291 }
292 if (linfo.isSparse() && !rinfo.isSparse()) {
293 return af_arith_sparse_dense<af_add_t>(out, lhs, rhs);
294 }
295 if (!linfo.isSparse() && rinfo.isSparse()) {
296 // second operand(Array) of af_arith call should be dense
297 return af_arith_sparse_dense<af_add_t>(out, rhs, lhs, true);
298 }
299 return af_arith<af_add_t>(out, lhs, rhs, batchMode);
300 }
301 CATCHALL;
302}
303
304af_err af_mul(af_array *out, const af_array lhs, const af_array rhs,
305 const bool batchMode) {

Callers 3

TESTFunction · 0.85
medianFunction · 0.85
af_factorialFunction · 0.85

Calls 1

isSparseMethod · 0.80

Tested by

no test coverage detected