-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add simd.math * update simd.math and add an accurate and performance testing framework for simd.math * update simd and simd.math * fix unused func * fix x86 CI test * fix 2 test no pass and fix 1 unused --------- Co-authored-by: 韦存阳 <[email protected]>
- Loading branch information
Showing
14 changed files
with
28,170 additions
and
4 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
libcxx/test/std/experimental/simd/simd.math/simd_math_erf_functions.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
#include "simd_math_head.h" | ||
|
||
int main() | ||
{ | ||
/////////////////////// ACC ///////////////////////////// | ||
|
||
{ | ||
cout << "\n" << "***Erf float***" << "\n" << endl; | ||
test_accuracy_for_single<float,float, llvm_test_single<float, float, ex::erf, erf>, vml_test_single<float, float, erf>>(1); | ||
cout << "\n" << "***Erf double***" << "\n" << endl; | ||
test_accuracy_for_single<double,double, llvm_test_single<double, double, ex::erf, erf>, vml_test_single<double, double, erf>>(1); | ||
} | ||
|
||
{ | ||
cout << "\n" << "***Erfc float***" << "\n" << endl; | ||
test_accuracy_for_single<float,float, llvm_test_single<float, float, ex::erfc, erfc>, vml_test_single<float, float, erfc>>(1); | ||
cout << "\n" << "***Erfc double***" << "\n" << endl; | ||
test_accuracy_for_single<double,double, llvm_test_single<double, double, ex::erfc, erfc>, vml_test_single<double, double, erfc>>(1); | ||
} | ||
|
||
|
||
|
||
/////////////////////// ULP ///////////////////////////// | ||
|
||
{ | ||
cout << "\n" << "***Erf float***" << "\n" << endl; | ||
ulp_test_accuracy_for_single<float, float, double, double, llvm_test_single<float, float, ex::erf, erf>, vml_test_single<double, double, erf>>(1); | ||
} | ||
|
||
{ | ||
cout << "\n" << "***Erfc float***" << endl; | ||
ulp_test_accuracy_for_single<float, float, double, double, llvm_test_single<float, float, ex::erfc, erfc>, vml_test_single<double, double, erfc>>(1); | ||
} | ||
|
||
{ | ||
// long double test | ||
#ifdef LDOUBLE_TEST | ||
cout << "\n" << "***Erf long double***" << "\n" << endl; | ||
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::erf, erf>, vml_test_single<long double, long double, erf>>(1); | ||
cout << "\n" << "***Erfc long double***" << "\n" << endl; | ||
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::erf, erf>, vml_test_single<long double, long double, erf>>(1); | ||
|
||
cout << "\n" << "***Erf double***" << "\n" << endl; | ||
ulp_test_accuracy_for_single<double, double, long double, long double, llvm_test_single<double, double, ex::erf, erf>, vml_test_single<long double, long double, erf>>(1); | ||
cout << "\n" << "***Erf long double***" << "\n" << endl; | ||
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::erf, erf>, vml_test_single<long double, long double, erf>>(1); | ||
|
||
cout << "\n" << "***Erfc double***" << endl; | ||
ulp_test_accuracy_for_single<double, double, long double, long double, llvm_test_single<double, double, ex::erfc, erfc>, vml_test_single<long double, long double, erfc>>(1); | ||
cout << "\n" << "***Erfc long double***" << endl; | ||
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::erfc, erfc>, vml_test_single<long double, long double, erfc>>(1); | ||
|
||
#endif | ||
} | ||
|
||
|
||
} |
45 changes: 45 additions & 0 deletions
45
libcxx/test/std/experimental/simd/simd.math/simd_math_exponential_functions.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include "simd_math_head.h" | ||
|
||
|
||
int main() | ||
{ | ||
/////////////////////// ACC ///////////////////////////// | ||
{ | ||
cout << "\n" << "***Expm1 float***" << "\n" << endl; | ||
test_accuracy_for_single<float, float, llvm_test_single<float, float, ex::expm1, expm1>, vml_test_single<float, float, expm1>>(1); | ||
cout << "\n" << "***Expm1 double***" << "\n" << endl; | ||
test_accuracy_for_single<double, double, llvm_test_single<double, double, ex::expm1, expm1>, vml_test_single<double, double, expm1>>(1); | ||
} | ||
|
||
/////////////////////// ULP ///////////////////////////// | ||
|
||
{ | ||
cout << "\n" << "***Expm1 float***" << "\n" << endl; | ||
ulp_test_accuracy_for_single<float, float, double, double, llvm_test_single<float, float, ex::expm1, expm1>, vml_test_single<double, double, expm1>>(1); | ||
} | ||
|
||
{ | ||
// long double test | ||
#ifdef LDOUBLE_TEST | ||
cout << "\n" << "***Exp long double***" << "\n" << endl; | ||
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::exp, exp>, vml_test_single<long double, long double, exp>>(1); | ||
cout << "\n" << "***Exp2 long double***" << "\n" << endl; | ||
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::exp2, exp2>, vml_test_single<long double, long double, exp2>>(1); | ||
|
||
cout << "\n" << "***Expm1 long double***" << "\n" << endl; | ||
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::expm1, expm1>, vml_test_single<long double, long double, expm1>>(1); | ||
|
||
cout << "\n" << "***Exp long double***" << "\n" << endl; | ||
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::exp, exp>, vml_test_single<long double, long double, exp>>(1); | ||
|
||
cout << "\n" << "***Exp2 long double***" << "\n" << endl; | ||
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::exp2, exp2>, vml_test_single<long double, long double, exp2>>(1,1); | ||
|
||
cout << "\n" << "***Expm1 double***" << "\n" << endl; | ||
ulp_test_accuracy_for_single<double, double, long double, long double, llvm_test_single<double, double, ex::expm1, expm1>, vml_test_single<long double, long double, expm1>>(1); | ||
cout << "\n" << "***Expm1 long double***" << "\n" << endl; | ||
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::expm1, expm1>, vml_test_single<long double, long double, expm1>>(1); | ||
|
||
#endif | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
libcxx/test/std/experimental/simd/simd.math/simd_math_gamma_functions.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
#include "simd_math_head.h" | ||
|
||
int main() | ||
{ | ||
/////////////////////// ACC ///////////////////////////// | ||
|
||
{ | ||
cout << "\n" << "***Lgamma float***" << endl; | ||
test_accuracy_for_single<float,float, llvm_test_single<float, float, ex::lgamma, lgamma>, vml_test_single<float, float, lgamma>>(1); | ||
cout << "\n" << "***Lgamma double***" << endl; | ||
test_accuracy_for_single<double,double, llvm_test_single<double, double, ex::lgamma, lgamma>, vml_test_single<double, double, lgamma>>(1); | ||
// test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::lgamma, lgamma>, vml_test_single<long double, long double, lgamma>>(1); | ||
} | ||
|
||
{ | ||
cout << "\n" << "***Tgamma float***" << "\n" << endl; | ||
test_accuracy_for_single<float,float, llvm_test_single<float, float, ex::tgamma, tgamma>, vml_test_single<float, float, tgamma>>(1); | ||
cout << "\n" << "***Tgamma double***" << endl; | ||
test_accuracy_for_single<double,double, llvm_test_single<double, double, ex::tgamma, tgamma>, vml_test_single<double, double, tgamma>>(1); | ||
} | ||
|
||
/////////////////////// ULP ///////////////////////////// | ||
|
||
|
||
{ | ||
cout << "\n" << "***Tgamma float***" << endl; | ||
ulp_test_accuracy_for_single<float,float, double, double, llvm_test_single<float, float, ex::tgamma, tgamma>, vml_test_single<double,double, tgamma>>(1); | ||
} | ||
|
||
{ | ||
cout << "\n" << "***Lgamma float***" << endl; | ||
ulp_test_accuracy_for_single<float,float, double,double,llvm_test_single<float, float, ex::lgamma, lgamma>, vml_test_single<double,double, lgamma>>(1); | ||
} | ||
|
||
{ | ||
// long double test | ||
#ifdef LDOUBLE_TEST | ||
cout << "\n" << "***Lgamma long double***" << endl; | ||
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::lgamma, lgamma>, vml_test_single<long double, long double, lgamma>>(1); | ||
|
||
cout << "\n" << "***Tgamma long double***" << endl; | ||
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::tgamma, tgamma>, vml_test_single<long double, long double, tgamma>>(1); | ||
|
||
cout << "\n" << "***Tgamma double***" << endl; | ||
ulp_test_accuracy_for_single<double,double, long double, long double, llvm_test_single<double, double, ex::tgamma, tgamma>, vml_test_single<long double, long double, tgamma>>(1); | ||
cout << "\n" << "***Tgamma long double***" << endl; | ||
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::tgamma, tgamma>, vml_test_single<long double, long double, tgamma>>(1); | ||
|
||
cout << "\n" << "***Lgamma double***" << endl; | ||
ulp_test_accuracy_for_single<double,double,long double, long double, llvm_test_single<double, double, ex::lgamma, lgamma>, vml_test_single<long double, long double, lgamma>>(1); | ||
cout << "\n" << "***Lgamma long double***" << endl; | ||
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::lgamma, lgamma>, vml_test_single<long double, long double, lgamma>>(1); | ||
#endif | ||
} | ||
} |
Oops, something went wrong.