Skip to content

Commit

Permalink
dot.c code edits
Browse files Browse the repository at this point in the history
  • Loading branch information
hrue committed Mar 30, 2024
1 parent 26f316f commit d94019a
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions gmrflib/dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ double GMRFLib_dot_product_group_mkl_alt(GMRFLib_idxval_tp *__restrict ELM_, dou
return value_;
}

double GMRFLib_dot_product_serial(GMRFLib_idxval_tp *__restrict ELM_, double *__restrict ARR_)
forceinline double GMRFLib_dot_product_serial(GMRFLib_idxval_tp *__restrict ELM_, double *__restrict ARR_)
{
double *__restrict vv_ = ELM_->val;
double *__restrict aa_ = ARR_;
Expand All @@ -116,7 +116,7 @@ double GMRFLib_dot_product_serial(GMRFLib_idxval_tp *__restrict ELM_, double *__
return GMRFLib_ddot_idx(ELM_->n, vv_, aa_, idx_);
}

double GMRFLib_dot_product_serial_mkl(GMRFLib_idxval_tp *__restrict ELM_, double *__restrict ARR_)
forceinline double GMRFLib_dot_product_serial_mkl(GMRFLib_idxval_tp *__restrict ELM_, double *__restrict ARR_)
{
double *__restrict vv_ = ELM_->val;
double *__restrict aa_ = ARR_;
Expand All @@ -125,7 +125,7 @@ double GMRFLib_dot_product_serial_mkl(GMRFLib_idxval_tp *__restrict ELM_, double
return GMRFLib_ddot_idx_mkl(ELM_->n, vv_, aa_, idx_);
}

double GMRFLib_dot_product_serial_mkl_alt(GMRFLib_idxval_tp *__restrict ELM_, double *__restrict ARR_)
forceinline double GMRFLib_dot_product_serial_mkl_alt(GMRFLib_idxval_tp *__restrict ELM_, double *__restrict ARR_)
{
double *__restrict vv_ = ELM_->val;
double *__restrict aa_ = ARR_;
Expand All @@ -134,6 +134,12 @@ double GMRFLib_dot_product_serial_mkl_alt(GMRFLib_idxval_tp *__restrict ELM_, do
return GMRFLib_ddot_idx_mkl_alt(ELM_->n, vv_, aa_, idx_);
}

forceinline double GMRFLib_ddot(int n, double *x, double *y)
{
int one = 1;
return ddot_(&n, x, &one, y, &one);
}

int GMRFLib_isum(int n, int *ix)
{
int s = 0;
Expand All @@ -155,12 +161,6 @@ double GMRFLib_dsum(int n, double *x)
return s;
}

double GMRFLib_ddot(int n, double *x, double *y)
{
int one = 1;
return ddot_(&n, x, &one, y, &one);
}

double GMRFLib_dsum_idx(int n, double *__restrict a, int *__restrict idx)
{
const int roll = 8L;
Expand Down Expand Up @@ -191,7 +191,6 @@ double GMRFLib_dsum_idx(int n, double *__restrict a, int *__restrict idx)
return s0 + s1 + s2 + s3;
}


double GMRFLib_ddot_idx(int n, double *__restrict v, double *__restrict a, int *__restrict idx)
{
const int roll = 8L;
Expand Down Expand Up @@ -245,7 +244,7 @@ forceinline double GMRFLib_ddot_idx_mkl(int n, double *__restrict v, double *__r

#else /* defined(INLA_WITH_MKL) */

double GMRFLib_ddot_idx_mkl_alt(int n, double *__restrict v, double *__restrict a, int *__restrict idx)
forceinline double GMRFLib_ddot_idx_mkl_alt(int n, double *__restrict v, double *__restrict a, int *__restrict idx)
{
return GMRFLib_ddot_idx(n, v, a, idx);
}
Expand Down

0 comments on commit d94019a

Please sign in to comment.