Skip to content

Commit

Permalink
[Diag][#9] Fix diagnostic compilation on macos 10.14
Browse files Browse the repository at this point in the history
  • Loading branch information
dpiparo committed Feb 5, 2019
1 parent c5c0817 commit c57ca42
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 52 deletions.
42 changes: 21 additions & 21 deletions include/diagnostic/vdtdiag_fcnTuples.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void getFunctionTuples( std::vector<genfpfcn2D_tuple<double>>* fcn_tuples,
fcn_tuples->clear();

fcn_tuples->push_back(genfpfcn2D_tuple<double>( "Identity2D", identity2D, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() ));
fcn_tuples->push_back(genfpfcn2D_tuple<double>( "Atan2", atan2, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() ));
fcn_tuples->push_back(genfpfcn2D_tuple<double>( "Atan2", refMath::atan2, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() ));
fcn_tuples->push_back(genfpfcn2D_tuple<double>( "Fast_Atan2", fast_atan2, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() ));

}
Expand All @@ -73,7 +73,7 @@ void getFunctionTuples( std::vector<genfpfcn2D_tuple<float>>* fcn_tuples,
fcn_tuples->clear();

fcn_tuples->push_back(genfpfcn2D_tuple<float>( "Identity2Df", identity2Df, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() ));
fcn_tuples->push_back(genfpfcn2D_tuple<float>( "Atan2f", atan2f, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() ));
fcn_tuples->push_back(genfpfcn2D_tuple<float>( "Atan2f", refMath::atan2f, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() ));
fcn_tuples->push_back(genfpfcn2D_tuple<float>( "Fast_Atan2f", fast_atan2f, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() ));

}
Expand Down Expand Up @@ -109,15 +109,15 @@ void getFunctionTuples( std::vector<genfpfcn_tuple<double>>* fcn_tuples,
fcn_tuples->clear();

fcn_tuples->push_back(genfpfcn_tuple<double>( "Identity", identity, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Exp", exp, expPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Log", log, positiverPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Sin", sin, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Cos", cos, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Tan", tan, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Tanh", tanh, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Asin", asin, mone2onerPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Acos", acos, mone2onerPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Atan", atan, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Exp", refMath::exp, expPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Log", refMath::log, positiverPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Sin", refMath::sin, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Cos", refMath::cos, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Tan", refMath::tan, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Tanh", refMath::tanh, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Asin", refMath::asin, mone2onerPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Acos", refMath::acos, mone2onerPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Atan", refMath::atan, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Isqrt", isqrt, positiverPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<double>( "Inverse", inv, symmetricrPool.getNumbers() ));

Expand Down Expand Up @@ -155,15 +155,15 @@ void getFunctionTuples( std::vector<genfpfcn_tuple<float>>* fcn_tuples,
fcn_tuples->clear();

fcn_tuples->push_back(genfpfcn_tuple<float>( "Identityf", identityf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Expf", expf, expPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Logf", logf, positiverPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Sinf", sinf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Cosf", cosf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Tanf", tanf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Tanhf", tanhf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Asinf", asinf, mone2onerPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Acosf", acosf, mone2onerPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Atanf", atanf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Expf", refMath::expf, expPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Logf", refMath::logf, positiverPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Sinf", refMath::sinf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Cosf", refMath::cosf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Tanf", refMath::tanf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Tanhf", refMath::tanhf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Asinf", refMath::asinf, mone2onerPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Acosf", refMath::acosf, mone2onerPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Atanf", refMath::atanf, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Isqrtf", isqrtf, positiverPool.getNumbers() ));
fcn_tuples->push_back(genfpfcn_tuple<float>( "Inversef", invf, symmetricrPool.getNumbers() ));

Expand Down Expand Up @@ -247,7 +247,7 @@ void getFunctionTuplesvect(std::vector<genfpfcnv_tuple<float>>* fcn_tuples,
randomPool<float>& expPool){
fcn_tuples->clear();

fcn_tuples->push_back(genfpfcnv_tuple<float>( "Identityfv", identityfv, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcnv_tuple<float>( "Identityfv", identityfv, symmetricrPool.getNumbers() ));
fcn_tuples->push_back(genfpfcnv_tuple<float>( "Expfv", vdt::expfv, expPool.getNumbers() ));
fcn_tuples->push_back(genfpfcnv_tuple<float>( "Logfv", vdt::logfv, positiverPool.getNumbers() ));
fcn_tuples->push_back(genfpfcnv_tuple<float>( "Sinfv", vdt::sinfv, symmetricrPool.getNumbers() ));
Expand Down
24 changes: 24 additions & 0 deletions include/diagnostic/vdtdiag_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,30 @@
#include <unistd.h>
#endif

// Wrappers to support macos 10.14 https://github.com/dpiparo/vdt/issues/9
namespace refMath {
double atan2(double x, double y) { return ::atan2(x, y); }
float atan2f(float x, float y) { return ::atan2f(x, y); }
double tan(double x) { return ::tan(x); }
float tanf(float x) { return ::tanf(x); }
double atan(double x) { return ::atan(x); }
float atanf(float x) { return ::atanf(x); }
double tanh(double x) { return ::tanh(x); }
float tanhf(float x) { return ::tanhf(x); }
double exp(double x) { return ::exp(x); }
float expf(float x) { return ::expf(x); }
double log(double x) { return ::log(x); }
float logf(float x) { return ::logf(x); }
double sin(double x) { return ::sin(x); }
float sinf(float x) { return ::sinf(x); }
double asin(double x) { return ::asin(x); }
float asinf(float x) { return ::asinf(x); }
double cos(double x) { return ::cos(x); }
float cosf(float x) { return ::cosf(x); }
double acos(double x) { return ::acos(x); }
float acosf(float x) { return ::acosf(x); }
}


namespace{

Expand Down
4 changes: 2 additions & 2 deletions progs/units/acos_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ int main(){

//dp
double dpvals[size]={1,.9,.8,.6,1e-200,0,-0.00004,-.2,-.8,-0.9999999999};
printFuncDiff("acos", (dpdpfunction)acos,(dpdpfunction)fast_acos, dpvals, size);
printFuncDiff("acos", (dpdpfunction)refMath::acos,(dpdpfunction)fast_acos, dpvals, size);
printFuncDiff ("acosv", (dpdpfunctionv) acosv, (dpdpfunctionv) fast_acosv, dpvals, size );

//sp
float spvals[size]={1.f,.9f,.8f,.12f,1e-20f,0.f,-0.004f,-.2f,-.8f,-0.9999999999f};
printFuncDiff("acosf", (spspfunction)acosf,(spspfunction)fast_acosf,spvals,size);
printFuncDiff("acosf", (spspfunction)refMath::acosf,(spspfunction)fast_acosf,spvals,size);
printFuncDiff ("acosfv", (spspfunctionv) acosfv, (spspfunctionv) fast_acosfv, spvals, size );

}
Expand Down
4 changes: 2 additions & 2 deletions progs/units/asin_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ int main(){

// dp
double dpvals[size]={1,.9,.8,.6,1e-200,0,-0.00004,-.2,-.8,-0.9999999999};
printFuncDiff("asin", (dpdpfunction)asin,(dpdpfunction)fast_asin,dpvals,size);
printFuncDiff("asin", (dpdpfunction)refMath::asin,(dpdpfunction)fast_asin,dpvals,size);
printFuncDiff ("asinv", (dpdpfunctionv) asinv, (dpdpfunctionv) fast_asinv, dpvals, size );


//sp
float spvals[size]={1,.9,.8,.12,1e-200,0,-0.004,-.2,-.8,-0.9999999999};
printFuncDiff("asinf", (spspfunction)asinf,(spspfunction)fast_asinf,spvals,size);
printFuncDiff("asinf", (spspfunction)refMath::asinf,(spspfunction)fast_asinf,spvals,size);
printFuncDiff ("asinfv", (spspfunctionv) asinfv, (spspfunctionv) fast_asinfv, spvals, size );

}
Expand Down
4 changes: 2 additions & 2 deletions progs/units/atan2_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ int main(){
//sp
float spvals1[size]={-1e30f,-1e19f,-300.f,-20.f,-0.23f,0.f,13.f,230.f,1e20f,1e30f};
float spvals2[size]={1e2f,1e1f,400.f,20.f,0.934f,0.f,-21.2f,-532.f,-1e17f,-1e29f};
printFuncDiff("atan2f", (spsp2function)atan2f,(spsp2function)fast_atan2f,spvals1,spvals2,size);
printFuncDiff("atan2f", (spsp2function)refMath::atan2f,(spsp2function)fast_atan2f,spvals1,spvals2,size);

//sp
double dpvals1[size]={-1e30,-1e19,-300.,-20.,-0.23,0.f,13.,230.,1e20,1e90};
double dpvals2[size]={1e2,1e1,400.,20.,0.934,0.,-21.2,-532.,-1e17,-1e29};
printFuncDiff("atan2", (dpdp2function)atan2,(dpdp2function)fast_atan2,dpvals1,dpvals2,size);
printFuncDiff("atan2", (dpdp2function)refMath::atan2,(dpdp2function)fast_atan2,dpvals1,dpvals2,size);

}

Expand Down
4 changes: 2 additions & 2 deletions progs/units/atan_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ int main(){

// dp
double dpvals[size]={-1e200,-1e50,-300.,-20.,0.,13.,230.,1e20,1e303};
printFuncDiff("atan", (dpdpfunction)atan,(dpdpfunction)fast_atan,dpvals,size);
printFuncDiff("atan", (dpdpfunction)refMath::atan,(dpdpfunction)fast_atan,dpvals,size);
printFuncDiff ("atanv", (dpdpfunctionv) atanv, (dpdpfunctionv) fast_atanv, dpvals, size );

//sp
float spvals[size]={-1e30f,-1e19f,-300.f,-20.f,0.f,13.f,230.f,1e20f,1e30f};
printFuncDiff("atanf", (spspfunction)atanf,(spspfunction)fast_atanf,spvals,size);
printFuncDiff("atanf", (spspfunction)refMath::atanf,(spspfunction)fast_atanf,spvals,size);
printFuncDiff ("atanfv", (spspfunctionv) atanfv, (spspfunctionv) fast_atanfv, spvals, size );

}
Expand Down
4 changes: 2 additions & 2 deletions progs/units/cos_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ int main(){

// dp
double dpvals[size]={32.*PI,5.6*PI,PI/4.1,PI/6.2,PI/7,PI/7.5,PI/85,PI/19,PI/10,0.000001};
printFuncDiff("cos", (dpdpfunction)cos,(dpdpfunction)fast_cos,dpvals,size);
printFuncDiff("cos", (dpdpfunction)refMath::cos,(dpdpfunction)fast_cos,dpvals,size);
printFuncDiff ("cosv", (dpdpfunctionv) cosv, (dpdpfunctionv) fast_cosv, dpvals, size );
// printFuncDiff("cos2", (dpdpfunction)cos,(dpdpfunction)fast_cos2,dpvals,size);

//sp
float spvals[size]={PI,PI/2.9,PI/4.1,PI/6.2,PI/7,PI/7,PI/85,PI/19,PI/10,PI/20.2};
printFuncDiff("cosf", (spspfunction)cosf,(spspfunction)fast_cosf,spvals,size);
printFuncDiff("cosf", (spspfunction)refMath::cosf,(spspfunction)fast_cosf,spvals,size);
printFuncDiff ("cosfv", (spspfunctionv) cosfv, (spspfunctionv) fast_cosfv, spvals, size );

}
Expand Down
4 changes: 2 additions & 2 deletions progs/units/exp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ int main(){

// dp
double dpvals[size]={-705,-100,-2,-1e-16,0,1e-50,4,10,500,805};
printFuncDiff("exp", (dpdpfunction)exp,(dpdpfunction)fast_exp,dpvals,size);
printFuncDiff("exp", (dpdpfunction)refMath::exp,(dpdpfunction)fast_exp,dpvals,size);
printFuncDiff ("expv", (dpdpfunctionv) expv, (dpdpfunctionv) fast_expv, dpvals, size );

//sp
float spvals[size]={-87.f,-50.f,-2.f,-1e-10f,0.f,1e-10f,4.f,10.f,50.f,95.f};
printFuncDiff("expf", (spspfunction)expf,(spspfunction)fast_expf,spvals,size);
printFuncDiff("expf", (spspfunction)refMath::expf,(spspfunction)fast_expf,spvals,size);
printFuncDiff ("expvf", (spspfunctionv) expfv, (spspfunctionv) fast_expfv, spvals, size );


Expand Down
4 changes: 2 additions & 2 deletions progs/units/log_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ int main(){

// dp
double dpvals[size]={1e200,1.34e101,2,1e-16,0,1e-50,4,10,500,.1};
printFuncDiff("log", (dpdpfunction)log,(dpdpfunction)fast_log,dpvals,size);
printFuncDiff("log", (dpdpfunction)refMath::log,(dpdpfunction)fast_log,dpvals,size);
printFuncDiff ("logv", (dpdpfunctionv) logv, (dpdpfunctionv) fast_logv, dpvals, size );

//sp
float spvals[size]={-87.f,-50.f,-2.f,-1e-1f,0.f,1e-5f,4.f,10.f,50.f,95.f};
printFuncDiff("logf", (spspfunction)logf,(spspfunction)fast_logf,spvals,size);
printFuncDiff("logf", (spspfunction)refMath::logf,(spspfunction)fast_logf,spvals,size);
printFuncDiff ("logvf", (spspfunctionv) logfv, (spspfunctionv) fast_logfv, spvals, size );

}
Expand Down
4 changes: 2 additions & 2 deletions progs/units/sin_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ int main(){

// dp
double dpvals[size]={PI,PI/2.9,PI/4.1,PI/6.2,PI/7,PI/7,PI/85,PI/19,PI/10,PI/20.2};
printFuncDiff("sin", (dpdpfunction)sin,(dpdpfunction)fast_sin,dpvals,size);
printFuncDiff("sin", (dpdpfunction)refMath::sin,(dpdpfunction)fast_sin,dpvals,size);
printFuncDiff ("sinv", (dpdpfunctionv) sinv, (dpdpfunctionv) fast_sinv, dpvals, size );


//sp
float spvals[size]={PI,PI/2.9,PI/4.1,PI/6.2,PI/7,PI/7,PI/85,PI/19,PI/10,PI/20.2};
printFuncDiff("sinf", (spspfunction)sinf,(spspfunction)fast_sinf,spvals,size);
printFuncDiff("sinf", (spspfunction)refMath::sinf,(spspfunction)fast_sinf,spvals,size);
printFuncDiff ("sinfv", (spspfunctionv) sinfv, (spspfunctionv) fast_sinfv, spvals, size );


Expand Down
4 changes: 2 additions & 2 deletions progs/units/tan_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ int main(){

// dp
double dpvals[size]={0.01, 0.1+PI/4, 0.01+PI/2, 1176.2*PI,0,-PI/7.5,PI/85,-PI/19,PI/10,-0.000001};
printFuncDiff("tan", (dpdpfunction)tan,(dpdpfunction)fast_tan,dpvals,size);
printFuncDiff("tan", (dpdpfunction)refMath::tan,(dpdpfunction)fast_tan,dpvals,size);
printFuncDiff ("tanv", (dpdpfunctionv) tanv, (dpdpfunctionv) fast_tanv, dpvals, size );

//sp
float spvals[size]={0.01, 0.1+PI/4, 0.01+PI/2, 1176.2*PI,PI/7,-PI/7.5,PI/85,-PI/19,PI/10,-0.000001};
printFuncDiff("tanf", (spspfunction)tanf,(spspfunction)fast_tanf,spvals,size);
printFuncDiff("tanf", (spspfunction)refMath::tanf,(spspfunction)fast_tanf,spvals,size);
printFuncDiff ("tanfv", (spspfunctionv) tanfv, (spspfunctionv) fast_tanfv, spvals, size );

}
Expand Down
4 changes: 2 additions & 2 deletions progs/units/tanh_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ int main(){

// dp
double dpvals[size]={-1e200,-1e50,-10.,-0.1,0.,0.3,2.3,1e20,1e303};
printFuncDiff("tanh", (dpdpfunction)tanh,(dpdpfunction)fast_tanh,dpvals,size);
printFuncDiff("tanh", (dpdpfunction)refMath::tanh,(dpdpfunction)fast_tanh,dpvals,size);
printFuncDiff ("tanhv", (dpdpfunctionv) tanhv, (dpdpfunctionv) fast_tanhv, dpvals, size );

//sp
float spvals[size]={-1e30f,-1e1f,-3.f,-0.7f,0.f,.3f,2.3f,1e20f,1e30f};
printFuncDiff("tanhf", (spspfunction)tanhf,(spspfunction)fast_tanhf,spvals,size);
printFuncDiff("tanhf", (spspfunction)refMath::tanhf,(spspfunction)fast_tanhf,spvals,size);
printFuncDiff ("tanhfv", (spspfunctionv) tanhfv, (spspfunctionv) fast_tanhfv, spvals, size );

}
Expand Down
4 changes: 2 additions & 2 deletions progs/units/test_fcnComparison.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int main(){
// Test the FcnResponse in double precision
std::string dpofilename("test_dpfunctionComparison.txt");
randomPool<double> dpRandomPool(100,1000,size);
fcnResponse<double> dpLogResp("Log",dpRandomPool.getNumbers(), (vdth::dpdpfunction) log);
fcnResponse<double> dpLogResp("Log",dpRandomPool.getNumbers(), (vdth::dpdpfunction) refMath::log);
fcnResponse<double> dpFastLogResp("Fast Log",dpRandomPool.getNumbers(), (vdth::dpdpfunction) vdt::fast_log);
fcnComparison<double> dpLogComp("Log - libmVSvdt",
dpRandomPool.getNumbers(),
Expand All @@ -37,7 +37,7 @@ int main(){
// Test the FcnResponse in single precision
std::string spofilename("test_spfunctionComparison.txt");
randomPool<float> spRandomPool(1,1000,size);
fcnResponse<float> spLogResp("Logf",spRandomPool.getNumbers(), (vdth::spspfunction) logf);
fcnResponse<float> spLogResp("Logf",spRandomPool.getNumbers(), (vdth::spspfunction) refMath::logf);
fcnResponse<float> spFastLogResp("Fast Logf",spRandomPool.getNumbers(), (vdth::spspfunction) vdt::fast_logf);
fcnComparison<float> spLogComp("Logf - libmVSvdt",
spRandomPool.getNumbers(),
Expand Down
2 changes: 1 addition & 1 deletion progs/units/test_fcnPerformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main(){
// Test the FcnResponse in double precision
fcnPerformance<double> dpExpPerf("Exp",
dpRandomPool.getNumbers(),
(vdth::dpdpfunction) exp,repetitions);
(vdth::dpdpfunction) refMath::exp,repetitions);
dpExpPerf.print();

fcnPerformance<double> dpFastExpPerf("Fast Exp",
Expand Down
8 changes: 4 additions & 4 deletions progs/units/test_fcnResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int main(){
// Test the FcnResponse in double precision
const std::string dpfilename("testDpFcnPerf.txt");
randomPool<double> dpRandomPool(-500,500,size);
fcnResponse<double> dpExpResp("Exp",dpRandomPool.getNumbers(), (vdth::dpdpfunction) exp);
fcnResponse<double> dpExpResp("Exp",dpRandomPool.getNumbers(), (vdth::dpdpfunction) refMath::exp);
dpExpResp.writeFile(dpfilename);
fcnResponse<double> dpExpRespFromFile(dpfilename);
dpExpRespFromFile.print();
Expand All @@ -29,7 +29,7 @@ int main(){
// Test the FcnResponse in single precision
const std::string spfilename("testSpFcnPerf.txt");
randomPool<float> spRandomPool(-50,50,size);
fcnResponse<float> spExpResp("Exp",spRandomPool.getNumbers(), (vdth::spspfunction) expf);
fcnResponse<float> spExpResp("Exp",spRandomPool.getNumbers(), (vdth::spspfunction) refMath::expf);
spExpResp.writeFile(spfilename);
fcnResponse<float> spExpRespFromFile(spfilename);
spExpRespFromFile.print();
Expand All @@ -43,7 +43,7 @@ int main(){
fcnResponse2D<double> dpAtan2Resp("Atan2",
dp2RandomPool.getNumbersX(),
dp2RandomPool.getNumbersY(),
(vdth::dpdp2function) atan2);
(vdth::dpdp2function) refMath::atan2);
dpAtan2Resp.print();
dpAtan2Resp.writeFile(dp2filename);

Expand All @@ -57,7 +57,7 @@ int main(){
fcnResponse2D<float> spAtan2Resp("Atan2",
sp2RandomPool.getNumbersX(),
sp2RandomPool.getNumbersY(),
(vdth::spsp2function) atan2);
(vdth::spsp2function) refMath::atan2);
spAtan2Resp.print();
spAtan2Resp.writeFile(sp2filename);

Expand Down
4 changes: 2 additions & 2 deletions progs/vdtArithmBenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ int main(int argc, char **argv){
// Add atan2
std::cout << " - Processing atan2 (all flavours)\n";
saveResponses2D<double,vdth::dpdp2function> ("Atan2",
atan2,
refMath::atan2,
spool2D->getNumbersX(),spool2D->getNumbersY(),
nick);
saveResponses2D<double,vdth::dpdp2function> ("Fast_Atan2",
Expand Down Expand Up @@ -192,7 +192,7 @@ int main(int argc, char **argv){
// Add atan2
std::cout << " - Processing atan2 (all flavours)\n";
saveResponses2D<float,vdth::spsp2function> ("Atan2f",
atan2f,
refMath::atan2f,
fspool2D->getNumbersX(),fspool2D->getNumbersY(),
nick);
saveResponses2D<float,vdth::spsp2function> ("Fast_Atan2f",
Expand Down
3 changes: 1 addition & 2 deletions progs/vdtArithmComparison.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
#include "vdtdiag_fcnComparison.h"
#include "vdtdiag_simpleCmd.h"


//converts (comma) separated list (in string) to vector of strings
void list2vector(std::string csList, std::vector<std::string>* vect, char separator = ','){
int lastCommaPos = -1, commaPos;

vect->clear();
while(true){
//no other comma, break
Expand Down

0 comments on commit c57ca42

Please sign in to comment.