Skip to content

Commit aef208f

Browse files
committed
[Math] Replace VecCore functions with std::simd functions
1 parent feb1cb0 commit aef208f

File tree

9 files changed

+211
-167
lines changed

9 files changed

+211
-167
lines changed

hist/hist/inc/TF1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ inline double TF1::EvalParVec(const Double_t *data, const Double_t *params)
841841
// res = GetSave(x);
842842
return TMath::SignalingNaN();
843843
}
844-
return vecCore::Get<ROOT::Double_v>(res, 0);
844+
return res[0];
845845
}
846846
#endif
847847

hist/hist/src/TFormula.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3134,7 +3134,7 @@ Double_t TFormula::EvalPar(const Double_t *x,const Double_t *params) const
31343134

31353135
if (fNdim == 0 || !x) {
31363136
ROOT::Double_v ret = DoEvalVec(nullptr, params);
3137-
return vecCore::Get( ret, 0 );
3137+
return ret[0];
31383138
}
31393139

31403140
// otherwise, regular Double_t inputs on a vectorized function
@@ -3150,15 +3150,15 @@ Double_t TFormula::EvalPar(const Double_t *x,const Double_t *params) const
31503150
xvec[i] = x[i];
31513151

31523152
ROOT::Double_v ans = DoEvalVec(xvec.data(), params);
3153-
return vecCore::Get(ans, 0);
3153+
return ans[0];
31543154
}
31553155
// allocating a vector is much slower (we do only for dim > 4)
31563156
std::vector<ROOT::Double_v> xvec(fNdim);
31573157
for (int i = 0; i < fNdim; i++)
31583158
xvec[i] = x[i];
31593159

31603160
ROOT::Double_v ans = DoEvalVec(xvec.data(), params);
3161-
return vecCore::Get(ans, 0);
3161+
return ans[0];
31623162

31633163
#else
31643164
// this should never happen, because fVectorized can only be set true with
@@ -3393,16 +3393,16 @@ ROOT::Double_v TFormula::EvalParVec(const ROOT::Double_v *x, const Double_t *par
33933393
if (gDebug)
33943394
Info("EvalPar", "Function is not vectorized - converting ROOT::Double_v into Double_t and back");
33953395

3396-
const int vecSize = vecCore::VectorSize<ROOT::Double_v>();
3396+
const int vecSize = ROOT::Double_v::size();
33973397
std::vector<Double_t> xscalars(vecSize*fNdim);
33983398

33993399
for (int i = 0; i < vecSize; i++)
34003400
for (int j = 0; j < fNdim; j++)
3401-
xscalars[i*fNdim+j] = vecCore::Get(x[j],i);
3401+
xscalars[i * fNdim + j] = x[j][i];
34023402

34033403
ROOT::Double_v answers(0.);
34043404
for (int i = 0; i < vecSize; i++)
3405-
vecCore::Set(answers, i, DoEval(&xscalars[i*fNdim], params));
3405+
answers[i] = DoEval(&xscalars[i * fNdim], params);
34063406

34073407
return answers;
34083408
}

math/mathcore/inc/Fit/FitData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ namespace ROOT {
358358
static unsigned VectorPadding(unsigned dataSize)
359359
{
360360
unsigned padding = 0;
361-
unsigned modP = (dataSize) % vecCore::VectorSize<ROOT::Double_v>();
361+
unsigned modP = (dataSize) % ROOT::Double_v::size();
362362
if (modP > 0)
363-
padding = vecCore::VectorSize<ROOT::Double_v>() - modP;
363+
padding = ROOT::Double_v::size() - modP;
364364
return padding;
365365
}
366366
#else

0 commit comments

Comments
 (0)