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

Function af_dot_all

src/api/c/blas.cpp:360–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360af_err af_dot_all(double *rval, double *ival, const af_array lhs,
361 const af_array rhs, const af_mat_prop optLhs,
362 const af_mat_prop optRhs) {
363 using namespace detail; // NOLINT needed for imag and real functions
364 // name resolution
365
366 try {
367 *rval = 0;
368 if (ival) { *ival = 0; }
369
370 af_array out = 0;
371 AF_CHECK(af_dot(&out, lhs, rhs, optLhs, optRhs));
372
373 const ArrayInfo &lhsInfo = getInfo(lhs);
374 af_dtype lhs_type = lhsInfo.getType();
375
376 switch (lhs_type) {
377 case f16: *rval = static_cast<double>(dotAll<half>(out)); break;
378 case f32: *rval = dotAll<float>(out); break;
379 case f64: *rval = dotAll<double>(out); break;
380 case c32: {
381 cfloat temp = dotAll<cfloat>(out);
382 *rval = real(temp);
383 if (ival) { *ival = imag(temp); }
384 } break;
385 case c64: {
386 cdouble temp = dotAll<cdouble>(out);
387 *rval = real(temp);
388 if (ival) { *ival = imag(temp); }
389 } break;
390 default: TYPE_ERROR(1, lhs_type);
391 }
392
393 if (out != 0) { AF_CHECK(af_release_array(out)); }
394 }
395 CATCHALL
396 return AF_SUCCESS;
397}

Callers 1

dotAllTestFunction · 0.50

Calls 5

af_dotFunction · 0.70
af_release_arrayFunction · 0.70
realFunction · 0.50
imagFunction · 0.50
getTypeMethod · 0.45

Tested by

no test coverage detected