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

Function af_div

src/api/c/binary.cpp:353–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353af_err af_div(af_array *out, const af_array lhs, const af_array rhs,
354 const bool batchMode) {
355 try {
356 // Check if inputs are sparse
357 const ArrayInfo &linfo = getInfo(lhs, false);
358 const ArrayInfo &rinfo = getInfo(rhs, false);
359
360 if (linfo.isSparse() && rinfo.isSparse()) {
361 // return af_arith_sparse<af_div_t>(out, lhs, rhs);
362 // MKL doesn't have mul or div support yet, hence
363 // this is commented out although alternative cpu code exists
364 return AF_ERR_NOT_SUPPORTED;
365 }
366 if (linfo.isSparse() && !rinfo.isSparse()) {
367 return af_arith_sparse_dense<af_div_t>(out, lhs, rhs);
368 }
369 if (!linfo.isSparse() && rinfo.isSparse()) {
370 // Division by sparse is currently not allowed - for convinence of
371 // dealing with division by 0
372 // return af_arith_sparse_dense<af_div_t>(out, rhs, lhs, true); //
373 // dense should be rhs
374 return AF_ERR_NOT_SUPPORTED;
375 }
376 return af_arith<af_div_t>(out, lhs, rhs, batchMode);
377 }
378 CATCHALL;
379}
380
381af_err af_maxof(af_array *out, const af_array lhs, const af_array rhs,
382 const bool batchMode) {

Callers 8

iterDeconvImageTestFunction · 0.85
invDeconvImageTestFunction · 0.85
toTempFormatFunction · 0.85
sparseArithTesterDivFunction · 0.85
imageTestFunction · 0.85
af_rootFunction · 0.85
af_iirFunction · 0.85
af_save_imageFunction · 0.85

Calls 1

isSparseMethod · 0.80

Tested by 1

toTempFormatFunction · 0.68