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

Function mv

src/backend/cpu/sparse_blas.cpp:295–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293
294template<typename T, bool conjugate>
295void mv(Param<T> output, CParam<T> values, CParam<int> rowIdx,
296 CParam<int> colIdx, CParam<T> right, int M) {
297 const T *valPtr = values.get();
298 const int *rowPtr = rowIdx.get();
299 const int *colPtr = colIdx.get();
300 const T *rightPtr = right.get();
301
302 T *outPtr = output.get();
303
304 // Output Array Created is a zero value Array
305 // Hence, no need to initialize to zero here
306 for (int i = 0; i < M; ++i) {
307 for (int j = rowPtr[i]; j < rowPtr[i + 1]; ++j) {
308 // If stride[0] of right is not 1 then rightPtr[colPtr[j]*stride]
309 if (conjugate) {
310 outPtr[i] += getConjugate(valPtr[j]) * rightPtr[colPtr[j]];
311 } else {
312 outPtr[i] += valPtr[j] * rightPtr[colPtr[j]];
313 }
314 }
315 }
316}
317
318template<typename T, bool conjugate>
319void mtv(Param<T> output, CParam<T> values, CParam<int> rowIdx,

Callers

nothing calls this directly

Calls 2

getConjugateFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected