@@ -304,6 +304,45 @@ void q15xq7_q15_m_mulvec(const Q15_T* mat, const Q7_T* const vec, ITER_T nrows,
304
304
void q15_m_mulvec (const Q15_T * mat , const Q15_T * const vec , ITER_T nrows ,
305
305
ITER_T ncols , Q15_T * ret , SCALE_T scmat , SCALE_T scvec ,
306
306
SCALE_T H1 , SCALE_T H2 );
307
+ /**
308
+ * @brief Performs sparse matrix multiplication of a matrix and a vector.
309
+ * row_indices and mat_values combined are a sparse representation; dim(vec) = [ncols].
310
+ * mat_values[i] is the i^th non-zero value of the input matrix, and row_indices[i] encodes the (1-indexed) row location of mat_values[i].
311
+ * If number of zeroes before row_indices[i] is l, then l is the column location of the (i-l)th matrix value.
312
+ * @param[in] row_indices pointer to input matrix which stores the row indices of non-zero values of matrix A
313
+ * @param[in] mat_values pointer to input matrix which stores the non-zero values of matrix A
314
+ * @param[in] vec pointer to the input vector
315
+ * @param[in] nrows number of rows of the input matrix
316
+ * @param[in] ncols number of columns of the input matrix
317
+ * @param[out] ret pointer to the output vector
318
+ * @param[in] scmat scale factor of the input matrix
319
+ * @param[in] scvec scale factor of the input vector
320
+ * @param[in] H1 depth parameter for division-by-two used in TreeSum
321
+ * @param[in] H2 depth parameter for direct sum used in TreeSum
322
+ * @return none
323
+ * @example mat = { {23, 32, 0},
324
+ * {0, 0, 1},
325
+ * {48, 0, 0}}
326
+ * row_indices = {1, 3, 0, 1, 0, 2, 0}
327
+ * mat_values = {23, 48, 32, 1}
328
+ * vec = {1, 2, 3}
329
+ * nrows = 3
330
+ * ncols = 3
331
+ * scmat = 1
332
+ * scvec = 1
333
+ * H1 = 1
334
+ * H2 = 0
335
+ * ret = {87, 3, 48}
336
+ */
337
+ void q15xq7_q15_m_sparse_mulvec (const ITER_T * row_indices ,
338
+ const Q15_T * mat_values , const Q7_T * vec ,
339
+ ITER_T nrows , ITER_T ncols , Q15_T * ret ,
340
+ SCALE_T scmat , SCALE_T scvec , SCALE_T H1 ,
341
+ SCALE_T H2 );
342
+ void q15_m_sparse_mulvec (const ITER_T * row_indices , const Q15_T * mat_values ,
343
+ const Q15_T * vec , ITER_T nrows , ITER_T ncols ,
344
+ Q15_T * ret , SCALE_T scmat , SCALE_T scvec , SCALE_T H1 ,
345
+ SCALE_T H2 );
307
346
308
347
/**
309
348
* @brief Performs the element-wise addition of two input tensors.
0 commit comments