Quantcast
Channel: Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 2652

How to multiply each row of matrix by a single column in CBLAS

$
0
0

I'd like to do the following in CBLAS:

static float a[max_i][max_j];
static float b[max_i][max_j];
static float vec[max_i];

for (size_t i = 0; i < max_i; i++) {
  for (size_t j = 0; j < max_j; j++) {
    b[i][j] += vec[i] * a[i][j];
  }
}

Is there a single performant function that I can use to do this whole thing (assuming I alter the 2d arrays to be 1d arrays)? I know I can do this with a for loop of cblas_saxpy's.

Thanks!


Viewing all articles
Browse latest Browse all 2652

Trending Articles