-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Determinism] Add hash based testing #224
Changes from 9 commits
c4d12d6
3af0ce0
64cd76f
f91bca5
7d36250
32b7f2f
bae81d5
f8d915c
018683b
8be300c
9b4ae0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,23 @@ find_library(LIBGMP gmp) | |
find_library(LIBRT rt) | ||
find_library(LIBFFTW3 fftw3) | ||
|
||
if (NOT CMAKE_CROSSCOMPILING AND NOT SLEEF_FORCE_FIND_PACKAGE_SSL) | ||
find_package(OpenSSL) | ||
else() | ||
# find_package cannot find OpenSSL when cross-compiling | ||
find_library(LIBSSL ssl) | ||
find_library(LIBCRYPTO crypto) | ||
if (LIBSSL AND LIBCRYPTO) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need to set OpenSSL libraries as libssl libraries? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. libssl and libcrypto are the components of OpenSSL library. |
||
set(OPENSSL_FOUND TRUE) | ||
set(OPENSSL_LIBRARIES ${LIBSSL} ${LIBCRYPTO}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is risky. The OPENSSL_* variables are set by "find_library" afai, and manually setting them might break other components if SLEEF is added as a cmake subproject. Please avoid doing so. If you want to be able to switch between openSSL and libssl, I recommend setting variables "SLEEF_MD5_FOUND" and "SLEEF_MD5_LIBRARIES" and "SLEEF_MD5_INCLUDES" according to the results of find_package on libopenssl and libssl, and then use those new variables in the rest of the CMAKE scripts. |
||
set(OPENSSL_VERSION ${LIBSSL}) | ||
endif() | ||
endif() | ||
|
||
if (ENFORCE_TESTER3 AND NOT OPENSSL_FOUND) | ||
message(FATAL_ERROR "ENFORCE_TESTER3 is specified and OpenSSL not found") | ||
endif() | ||
|
||
find_path(MPFR_INCLUDE_DIR | ||
NAMES mpfr.h | ||
ONLY_CMAKE_FIND_ROOT_PATH) | ||
|
@@ -92,6 +109,16 @@ if((CMAKE_SYSTEM_PROCESSOR MATCHES "x86") OR (CMAKE_SYSTEM_PROCESSOR MATCHES "AM | |
command_arguments(ALIAS_PARAMS_AVX512F_SP -16 __m512 __m512i e avx512f) | ||
|
||
set(CLANG_FLAGS_ENABLE_PURECFMA_SCALAR "-mavx2;-mfma") | ||
|
||
set(TESTER3_DEFINITIONS_SSE2 ATR=cinz_ DPTYPE=__m128d SPTYPE=__m128 DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=sse2) | ||
set(TESTER3_DEFINITIONS_SSE4 ATR=cinz_ DPTYPE=__m128d SPTYPE=__m128 DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=sse4) | ||
set(TESTER3_DEFINITIONS_AVX2128 ATR=finz_ DPTYPE=__m128d SPTYPE=__m128 DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=avx2128) | ||
set(TESTER3_DEFINITIONS_AVX ATR=cinz_ DPTYPE=__m256d SPTYPE=__m256 DPTYPESPEC=d4 SPTYPESPEC=f8 EXTSPEC=avx) | ||
set(TESTER3_DEFINITIONS_FMA4 ATR=finz_ DPTYPE=__m256d SPTYPE=__m256 DPTYPESPEC=d4 SPTYPESPEC=f8 EXTSPEC=fma4) | ||
set(TESTER3_DEFINITIONS_AVX2 ATR=finz_ DPTYPE=__m256d SPTYPE=__m256 DPTYPESPEC=d4 SPTYPESPEC=f8 EXTSPEC=avx2) | ||
set(TESTER3_DEFINITIONS_AVX512F ATR=finz_ DPTYPE=__m512d SPTYPE=__m512 DPTYPESPEC=d8 SPTYPESPEC=f16 EXTSPEC=avx512f) | ||
set(TESTER3_DEFINITIONS_AVX512FNOFMA ATR=cinz_ DPTYPE=__m512d SPTYPE=__m512 DPTYPESPEC=d8 SPTYPESPEC=f16 EXTSPEC=avx512fnofma) | ||
|
||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") | ||
set(SLEEF_ARCH_AARCH64 ON CACHE INTERNAL "True for Aarch64 architecture.") | ||
# Aarch64 requires support for advsimdfma4 | ||
|
@@ -117,6 +144,12 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") | |
command_arguments(ALIAS_PARAMS_ADVSIMD_SP -4 float32x4_t int32x4_t n advsimd) | ||
|
||
set(CLANG_FLAGS_ENABLE_PURECFMA_SCALAR "-march=armv8-a+simd") | ||
|
||
set(TESTER3_DEFINITIONS_ADVSIMD ATR=finz_ DPTYPE=float64x2_t SPTYPE=float32x4_t DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=advsimd) | ||
set(TESTER3_DEFINITIONS_ADVSIMDNOFMA ATR=cinz_ DPTYPE=float64x2_t SPTYPE=float32x4_t DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=advsimdnofma) | ||
set(TESTER3_DEFINITIONS_SVE ATR=finz_ DPTYPE=svfloat64_t SPTYPE=svfloat32_t DPTYPESPEC=dx SPTYPESPEC=fx EXTSPEC=sve) | ||
set(TESTER3_DEFINITIONS_SVENOFMA ATR=cinz_ DPTYPE=svfloat64_t SPTYPE=svfloat32_t DPTYPESPEC=dx SPTYPESPEC=fx EXTSPEC=svenofma) | ||
|
||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") | ||
set(SLEEF_ARCH_AARCH32 ON CACHE INTERNAL "True for Aarch32 architecture.") | ||
set(COMPILER_SUPPORTS_NEON32 1) | ||
|
@@ -155,6 +188,10 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64") | |
set(ALIAS_PARAMS_VSX_SP -4 "vector float" "vector int" - vsx) | ||
|
||
set(CLANG_FLAGS_ENABLE_PURECFMA_SCALAR "-mvsx") | ||
|
||
set(TESTER3_DEFINITIONS_VSX ATR=finz_ DPTYPE=vector_double SPTYPE=vector_float DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=vsx) | ||
set(TESTER3_DEFINITIONS_VSXNOFMA ATR=cinz_ DPTYPE=vector_double SPTYPE=vector_float DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=vsxnofma) | ||
|
||
endif() | ||
|
||
command_arguments(HEADER_PARAMS_PUREC_SCALAR cinz_ 1 1 double float int32_t int32_t __STDC__ purec) | ||
|
@@ -164,6 +201,8 @@ command_arguments(ALIAS_PARAMS_PUREC_SCALAR_SP -1 float int32_t purec cinz_) | |
command_arguments(ALIAS_PARAMS_PURECFMA_SCALAR_DP 1 double int32_t purecfma finz_) | ||
command_arguments(ALIAS_PARAMS_PURECFMA_SCALAR_SP -1 float int32_t purecfma finz_) | ||
|
||
set(TESTER3_DEFINITIONS_PUREC_SCALAR ATR=cinz_ DPTYPE=double SPTYPE=float DPTYPESPEC=d1 SPTYPESPEC=f1 EXTSPEC=purec) | ||
set(TESTER3_DEFINITIONS_PURECFMA_SCALAR ATR=finz_ DPTYPE=double SPTYPE=float DPTYPESPEC=d1 SPTYPESPEC=f1 EXTSPEC=purecfma) | ||
set(COMPILER_SUPPORTS_PUREC_SCALAR 1) | ||
set(COMPILER_SUPPORTS_PURECFMA_SCALAR 1) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
sin u35 ec03e7577871ef943c4b1ca6a485d08c | ||
sin u10 0f8444e11d3779dc4c28f3db353607bf | ||
cos u35 b87d0826f08562a17c71125d39fb5919 | ||
cos u10 9f9e4f5f3d2d84deeab3829375054fe8 | ||
tan u35 b04ff8785a7c98694842004ccb3da186 | ||
tan u10 9a4e53fd7e9245c7c1c8cb9cd30b1644 | ||
sincos u10 7c164edcaa45988f6165b653fc76c495 | ||
sincos u35 38fe7e261e184ed8dbf432ce6bedc5c4 | ||
sincospi u05 0c6fc00c7aaf0b6e67d66542d1be833d | ||
sincospi u35 c428b0fc3e6c5be4d2c03dcd8bb27a7c | ||
log u10 4855b27222d900bea47a27cadba71727 | ||
log u35 9c60b59cc6bba46d016798b97ea939c2 | ||
log10 u10 ee979872a5a5181905eb7d04eefb3870 | ||
log1p u10 1383924fb56cf2e7eda27de21320c591 | ||
exp u10 1a8756694ca98254c4d872646b639721 | ||
exp2 u10 6aeddf0a30622490d3fabbe4851e3e7a | ||
exp10 u10 9d704b310f683872a6446cfc97726a4d | ||
expm1 u10 374817f0728c57b0ec019c3bfb141a79 | ||
pow u10 15d42c41ce130c3a61fff3686632c8ce | ||
cbrt u10 5d8bf28ac74624594fd1be9217817690 | ||
cbrt u10 3c896e03746bcf1b3f70182dfec3d93b | ||
cbrt u35 73daa306764e208aab1627ac110b10d7 | ||
cbrt u35 c29b7bf200215425b4ba948c8cc94c42 | ||
hypot u05 cc2f18e409e19a02cadf7b91fd869120 | ||
hypot u35 5194e0a554174a6145511ce3df9c1f46 | ||
asin u10 bae9eb3b4f484295f3f8641e61808dc6 | ||
asin u35 9bea0a03680e83cbd198262ecdb37e28 | ||
acos u10 1c435f5e072ad2fe458ed3cb7d61efdb | ||
acos u35 c7f12cdf2aa9b68b0476053d1727b42f | ||
atan u10 1f13ac8525edc54818f136bd9cd8ac46 | ||
atan u10 2b2309e489a92e208e83d1641301e59c | ||
atan u35 c62cfeb4fa325a5b85613723723b1d98 | ||
atan u35 515a88bf70e307daee25f24178e3791a | ||
atan2 u10 b3cbe8bf7c3a75c4eb1a767e2331b5ca | ||
atan2 u35 07060ed63483b89fb3c27840d200d747 | ||
sinh u10 25b8333e58c6a39e5b0f8ba085b218ef | ||
cosh u10 beb5e63186c0d580e11333e206aa31b1 | ||
tanh u10 2bb9dd54ed0fa22bb5f3b6d557eb58a3 | ||
asinh u10 01136e54e2a434839530dda54f33cfdb | ||
acosh u10 2f3c28c9ee2eb2b3d5659c6cb2a58e3e | ||
atanh u10 601a77ba8c1d5175f2808b48a41260c1 | ||
lgamma u10 90cdc41063f4198c6ad592c0cdd0f5da | ||
tgamma u10 74ac3717702a9586553f83cd9abfce6e | ||
erf u10 4031f3e285101359aea99feb5e2de3f0 | ||
erfc u15 9b6e3d08a9d409154bcbf0ab8315f0bd | ||
fabs bef2f2ac8a4789357e580b4da4f9b9fe | ||
copysign 3219022f267464e3704f90558e8df3bc | ||
fmax 4e4f5220ccfef191864c316df0d18fc0 | ||
fmin c0f8effb6c611e2b3b91b820ad943f62 | ||
fdim e876d103931f18ceede5bfd7e3df7ab0 | ||
fmod 618aa751e13012afdb41ec80dd35e6ba | ||
modf f03ce73cd4f9ea7f69c017f6e53355d5 | ||
nextafter 9eba4e30d12d74dc4e8003fcff0f1582 | ||
trunc 1bc7e909eba121dcef7f0e4046937ae5 | ||
floor 2cff66b499dc8a30cec9467de659b774 | ||
ceil b080e632dcb8f8134d8715752be12917 | ||
round 8907e21687ca9c2a539297536e754950 | ||
rint e49f837096bc661fe1c742801dd99a30 | ||
sinf u35 833d845950b9cbb025629fe4c040f8f6 | ||
sinf u10 9c21afa4d7d6af3fc666309c3cd647fe | ||
cosf u35 74d7f871a6553cd0019087895e2052ad | ||
cosf u10 35349e94c323c1614f22093959288010 | ||
tanf u35 5412973e369bb09dc7d506823b6fb4e9 | ||
tanf u10 227423bc04f42d76a8f68082ba696126 | ||
sincosf u10 83ecc4e3d5295056e9d8c52bc196b666 | ||
sincosf u35 533319caa49a961e4909bd6dcab40721 | ||
sincospif u05 8b3762b67a661957c1414c351ec49034 | ||
sincospif u35 cec15ed76a358091632634166fa77b66 | ||
logf u10 c5a90119943acc4199e1cc7030b5def8 | ||
logf u35 af2fbe4bfa2caaf59c734e3749dd15be | ||
log10f u10 7e235a82d960e4434575dd39648d8bb7 | ||
log1pf u10 350fc4f13502b36bb1107e1b1122acb1 | ||
expf u10 ee4adaabefa3fac6c0f1925b2a948eea | ||
exp2f u10 b0d283dbae0f36f1b3c7eed9871f0d0d | ||
exp10f u10 ba6b659a6ac3945fcb602c73623b6ff2 | ||
expm1f u10 ebfd6498cb40f61b609882de8a7f3c74 | ||
powf u10 a7cba3239c87969662e8b41a4dd8b4ab | ||
cbrtf u10 01c5cac23fe21638be1c3eab6e368fd6 | ||
cbrtf u10 2a245b03f83e9114644d03b40dac707b | ||
cbrtf u35 3ce62350fd585f0524a12c974fbe6cf5 | ||
cbrtf u35 2aca0404626a28f7af7f60105ad6e217 | ||
hypotf u05 bc5971cbeebee27b4c0d91fbe3f6bf30 | ||
hypotf u35 a6f0f774b346a6bba08889ff9ba3f193 | ||
asinf u10 7f77f7453b961512c89e87e49c549cfe | ||
asinf u35 22ed8760aa328e1f714031eec592a4d8 | ||
acosf u10 15617dd0429b90e59d2923415934c2a6 | ||
acosf u35 af0b132d9e263721f9296187dbf9b9bf | ||
atanf u10 26b77fb423104b45633cf24500237d6e | ||
atanf u10 4313d0bc2708de53f74d804aac6564d4 | ||
atanf u35 12c1b3ad574c3cbf642690ab13bf27d1 | ||
atanf u35 a112a95870d110dddf8a4aa7e877c556 | ||
atan2f u10 098a33f730fe95ce4774a991db4cee14 | ||
atan2f u35 25a1ce0f275b31ab2d77a5acc9d25ece | ||
sinhf u10 0780a2f57df3a831718195d1ee5c19ef | ||
coshf u10 cfbb6aed408e43a7b7f053474100ff2d | ||
tanhf u10 d19f254d41e8726c748df87b95bc9acd | ||
asinhf u10 260d129221468a86bbfd609c27bfea6a | ||
acoshf u10 24ced7e5631c78b20a5716faeedbaa92 | ||
atanhf u10 164fd77b8372b8c131baaacab1c9e650 | ||
lgammaf u10 3bf6d824175c4f4d86f3073064e41e84 | ||
tgammaf u10 f3a8d25c852068622bdfcae4cb813583 | ||
erff u10 afd2eb2e4f76145816d623ddc53959cb | ||
erfcf u15 915ab9830de89a5a504b3ce7cd2fecda | ||
fabsf a3c72220bc0ade68fe22e0a15eb730d4 | ||
copysignf 6b35517b8e1da78d9c9b52915d9a9b19 | ||
fmaxf 9833a60a2080e8fd9ae8de32c758966f | ||
fminf 2dcfa19e1f1ab4973a7dec9f2cc09fa0 | ||
fdimf c5c0fe7b095eb8ccbb19fbf934a36b24 | ||
fmodf 77aa84a9703e202a56e5f4609bd2482b | ||
modff 5fa4f044f20478216aa085a01b189697 | ||
nextafterf 517c1c8f072e9024518d3d9ead98b85b | ||
truncf 6937050850be63c44d4b7dbd666febe6 | ||
floorf 9341be69ee345c8554bf3ab4e9316133 | ||
ceilf c70874771cbe9741f1f05fedd4b629e9 | ||
roundf 0cf52f6b8015099771e9a7dfa6b090bc | ||
rintf bed68e788e2b11543c09c9d52198abf8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use directly libssl and libcrypto also when not cross compiling? I suggested OpenSSL just as an example, I didn't want to tie you to a particular implementation.
If possible, simplify this check by removing the OpenSSL branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_library cannot find OpenSSL with MSVC. So, I need both.