mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 09:59:12 +00:00
Merge topic 'intel-finites'
b93ee30ab Enable non-finite values with Intel compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sujin Philip <sujin.philip@kitware.com> Merge-request: !3213
This commit is contained in:
commit
bf0390b8e1
@ -90,6 +90,19 @@ set_target_properties(
|
|||||||
EXPORT_NAME developer_flags
|
EXPORT_NAME developer_flags
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Intel OneAPI compilers >= 2021.2.0 turn on "fast math" at any non-zero
|
||||||
|
# optimization level. Suppress this non-standard behavior using the
|
||||||
|
# `-fp-model=precise` flag.
|
||||||
|
set(intel_oneapi_compiler_version_min "2021.2.0")
|
||||||
|
set(is_lang "$<COMPILE_LANGUAGE:CXX>")
|
||||||
|
set(is_intelllvm "$<CXX_COMPILER_ID:IntelLLVM>")
|
||||||
|
set(is_intelllvm_fastmath_assuming_version "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,${intel_oneapi_compiler_version_min}>")
|
||||||
|
set(intel_oneapi_compiler_detections
|
||||||
|
"$<AND:${is_lang},${is_intelllvm},${is_intelllvm_fastmath_assuming_version}>")
|
||||||
|
target_compile_options(vtkm_developer_flags
|
||||||
|
INTERFACE
|
||||||
|
"$<BUILD_INTERFACE:$<${intel_oneapi_compiler_detections}:-fp-model=precise>>")
|
||||||
|
|
||||||
# Additional warnings just for Clang 3.5+, and AppleClang 7+
|
# Additional warnings just for Clang 3.5+, and AppleClang 7+
|
||||||
# about failures to vectorize.
|
# about failures to vectorize.
|
||||||
if (VTKM_COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.4)
|
if (VTKM_COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.4)
|
||||||
|
6
docs/changelog/intel-finites.md
Normal file
6
docs/changelog/intel-finites.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Enable non-finite values with Intel compiler
|
||||||
|
|
||||||
|
The Intel compiler by default turns on an optimization that assumes that
|
||||||
|
all floating point values are finite. This breaks any ligitimate uses of
|
||||||
|
non-finite values including checking values with functions like `isnan`
|
||||||
|
and `isinf`. Turn off this feature for the intel compiler.
|
Loading…
Reference in New Issue
Block a user