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

Function mm

src/backend/cpu/sparse_blas.cpp:344–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342
343template<typename T, bool conjugate>
344void mm(Param<T> output, CParam<T> values, CParam<int> rowIdx,
345 CParam<int> colIdx, CParam<T> right, int M, int N, int ldb, int ldc) {
346 UNUSED(M);
347 const T *valPtr = values.get();
348 const int *rowPtr = rowIdx.get();
349 const int *colPtr = colIdx.get();
350 const T *rightPtr = right.get();
351 T *outPtr = output.get();
352
353 for (int o = 0; o < N; ++o) {
354 for (int i = 0; i < rowIdx.dims(0) - 1; ++i) {
355 outPtr[i] = scalar<T>(0);
356 for (int j = rowPtr[i]; j < rowPtr[i + 1]; ++j) {
357 // If stride[0] of right is not 1 then
358 // rightPtr[colPtr[j]*stride]
359 if (conjugate) {
360 outPtr[i] += getConjugate(valPtr[j]) * rightPtr[colPtr[j]];
361 } else {
362 outPtr[i] += valPtr[j] * rightPtr[colPtr[j]];
363 }
364 }
365 }
366 rightPtr += ldb;
367 outPtr += ldc;
368 }
369}
370
371template<typename T, bool conjugate>
372void mtm(Param<T> output, CParam<T> values, CParam<int> rowIdx,

Callers

nothing calls this directly

Calls 3

getConjugateFunction · 0.70
getMethod · 0.45
dimsMethod · 0.45

Tested by

no test coverage detected