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

Function mtv

src/backend/cpu/sparse_blas.cpp:319–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317
318template<typename T, bool conjugate>
319void mtv(Param<T> output, CParam<T> values, CParam<int> rowIdx,
320 CParam<int> colIdx, CParam<T> right, int M) {
321 UNUSED(M);
322
323 const T *valPtr = values.get();
324 const int *rowPtr = rowIdx.get();
325 const int *colPtr = colIdx.get();
326 const T *rightPtr = right.get();
327 T *outPtr = output.get();
328
329 // Output Array Created is a zero value Array
330 // Hence, no need to initialize to zero here
331 for (int i = 0; i < rowIdx.dims(0) - 1; ++i) {
332 for (int j = rowPtr[i]; j < rowPtr[i + 1]; ++j) {
333 // If stride[0] of right is not 1 then rightPtr[i*stride]
334 if (conjugate) {
335 outPtr[colPtr[j]] += getConjugate(valPtr[j]) * rightPtr[i];
336 } else {
337 outPtr[colPtr[j]] += valPtr[j] * rightPtr[i];
338 }
339 }
340 }
341}
342
343template<typename T, bool conjugate>
344void mm(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