Skip to content

Instantly share code, notes, and snippets.

@pubudu91
Created November 10, 2016 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pubudu91/280231248d3cc4e1b8a3e583cb9d8168 to your computer and use it in GitHub Desktop.
Save pubudu91/280231248d3cc4e1b8a3e583cb9d8168 to your computer and use it in GitHub Desktop.
void blasL1(Matrix1D *A, Matrix1D *B, Matrix1D *C, int n) {
double *Cmat = C->matrix;
double *Amat = A->matrix;
double *Bmat = B->matrix;
double *Arv, *Crv;
omp_set_num_threads(4);
#pragma omp parallel for
for (int i = 0; i < n; ++i) {
Arv = Amat + i * n;
Crv = Cmat + i * n;
for (int j = 0; j < n; j++)
*(Crv + j) = cblas_ddot(n, Arv, 1, &Bmat[j * n], 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment