Avoid compiling for AVX2 instructions on older hardware. #485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
/arch:AVX2
was always enabled for Visual Studio, but pre-Haswell hardware does not support AVX2. While the compiler could still create code, it would fail to run properly. To avoid this, we add a platform check for AVX2 capabilities -- actually the check already existed inconfig/query_fma.cc
but it needed a small change to narrow the check to AVX2 only.Description of changes
query_fma.cc
to take command line arguments-f
and-a
, which limit the check to fma-availability or avx2-availablity only. This code will return1
if those features are found.platform_checks.cmake
to compile and runquery_fma.cc
and then set the build variablesHAVE_HARDWARE_AVX2
andHAVE_HARDWARE_FMA
. These values are saved tods++/config.h
and are also available when the build system parseswindows-cl.cmake
so that appropriate code paths can be taken.drel.f90
.appveyor.yml
that prevented output from failing tests from being printed.Status