Skip to content

Commit

Permalink
Add omp simd pragmas to some loops
Browse files Browse the repository at this point in the history
  • Loading branch information
imciner2 committed May 3, 2024
1 parent b37fdff commit 4e798e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/qdldl.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ void QDLDL_Lsolve(const QDLDL_int n,
QDLDL_int i,j;
for(i = 0; i < n; i++){
QDLDL_float val = x[i];

#pragma omp simd
for(j = Lp[i]; j < Lp[i+1]; j++){
x[Li[j]] -= Lx[j]*val;
}
Expand All @@ -258,6 +260,8 @@ void QDLDL_Ltsolve(const QDLDL_int n,
QDLDL_int i,j;
for(i = n-1; i>=0; i--){
QDLDL_float val = x[i];

#pragma omp simd
for(j = Lp[i]; j < Lp[i+1]; j++){
val -= Lx[j]*x[Li[j]];
}
Expand All @@ -276,6 +280,10 @@ void QDLDL_solve(const QDLDL_int n,
QDLDL_int i;

QDLDL_Lsolve(n,Lp,Li,Lx,x);
for(i = 0; i < n; i++) x[i] *= Dinv[i];

#pragma omp simd
for(i = 0; i < n; i++)
x[i] *= Dinv[i];

QDLDL_Ltsolve(n,Lp,Li,Lx,x);
}

0 comments on commit 4e798e0

Please sign in to comment.