Skip to content
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

Fix float reproducibility tests on Apple Silicon chips #2845

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ namespace {
// into smaller type when the type is saved into memory. This obviously
// leads to a different answer, than doing the math in the correct precision.
#if ( defined( _MSC_VER ) && _M_IX86_FP < 2 ) || \
( defined( __GNUC__ ) && !defined( __SSE2_MATH__ ) )
( defined( __GNUC__ ) && (defined( __i386__ ) || defined( __x86_64__ )) && !defined( __SSE2_MATH__ ) )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this does not actually fix the tests, this just enables them on M1 machines.

Secondary issue is that the original warning will still be present on platforms that correctly disable the tests.

Full fix is to keep this updated define, but also to

  1. move the ifdef above the block defining all the uniform_fp_test_params
  2. Change the change the tests "uniform_floating_point_distribution can handle unitary ranges" not to rely on uniform_fp_test_params.

# define CATCH_TEST_CONFIG_DISABLE_FLOAT_REPRODUCIBILITY_TESTS
#endif

Expand Down