onnxruntime/cmake
Michael Klimenko 07e6648e12
Enable Intel oneAPI DPC++/C++ compiler build (#16587)
Last week I fixed error #16484 found when trying to build onnxruntime
with the icpx compiler. Another thing I found out is that icpx uses
-ffast-math flag by default. You can check it by running the compiler
with -v flag like following:

```bash
# Setup the environment
. /opt/intel/oneapi/setvars.sh
# Compile any file to see all the implicit flags
icpx -v main.cpp
```

This leads to a bunch of warnings during the build like:

```bash
In file included from /mnt/f/wsl_home/onnxruntime/onnxruntime/test/providers/cpu/tensor/upsample_op_test.cc:5:
In file included from /mnt/f/wsl_home/onnxruntime/onnxruntime/test/providers/provider_test_utils.h:6:
In file included from /mnt/f/wsl_home/onnxruntime/onnxruntime/test/providers/checkers.h:10:
In file included from /mnt/f/wsl_home/onnxruntime/onnxruntime/core/util/math_cpuonly.h:68:
In file included from /mnt/f/wsl_home/onnxruntime/build/Linux/RelWithDebInfo/_deps/eigen-src/Eigen/Core:172:
/mnt/f/wsl_home/onnxruntime/build/Linux/RelWithDebInfo/_deps/eigen-src/Eigen/src/Core/MathFunctions.h:1019:12: warning: comparison with NaN always evaluates to false in fast floating point modes [-Wtautological-constant-compare]
    return isnan EIGEN_NOT_A_MACRO (x);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
		   
And some tests are failing as well, usually with infinities involved. To
list a few:

```bash
# ...
1: [  FAILED  ] IsInfTest.test_isinf_float
1: [  FAILED  ] IsInfTest.test_isinf_double
1: [  FAILED  ] IsInfTest.test_isinf_positive_float
1: [  FAILED  ] IsInfTest.test_isinf_positive_double
1: [  FAILED  ] IsInfTest.test_isinf_negative_float
1: [  FAILED  ] IsInfTest.test_isinf_negative_double
1: [  FAILED  ] IsNaNOpTest.IsNaNFloat
1: [  FAILED  ] IsNaNOpTest.IsNaNDouble
# ...
```

This PR adds a quick global check for the IntelLLVM compiler, as in the
way its name is reported by CMake and then, depending on the compiler
driver, sets either MSVC-like or GCC-like switch to disable fast-maths.

Probably a bit cleaner solution would be to use
```target_compile_options(${TARGET} PRIVATE MEOW)``` instead of a
global-wide ```set(CMAKE_CXX_FLAGS MEOW)```, but then we'd be required
to add it to all the individual targets and execution providers and this
will lead to a lot of code duplication.
2023-08-02 12:50:35 -07:00
..
external Update the MacOS/Linux build scripts that build/install protobuf from source (#16906) 2023-07-31 10:51:48 -07:00
patches Fix some build issues on MacOS with Xcode 14.3. (#15878) 2023-06-07 12:07:11 -07:00
tensorboard
adjust_global_compile_flags.cmake Cleanup WASM cmake code (#15996) 2023-05-20 18:07:39 -07:00
CMakeLists.txt Enable Intel oneAPI DPC++/C++ compiler build (#16587) 2023-08-02 12:50:35 -07:00
CMakeSettings.json
codeconv.runsettings
deps.txt Allow --build_wasm on a mac system (#16761) 2023-07-21 14:21:37 -07:00
EnableVisualStudioCodeAnalysis.props
gdk_toolchain.cmake
Info.plist.in
libonnxruntime.pc.cmake.in
nuget_helpers.cmake
onnxruntime.cmake [ios] Enable --use_extensions with custom built iOS pod (#16711) 2023-07-14 15:37:16 -07:00
onnxruntime_codegen_tvm.cmake
onnxruntime_common.cmake [C#, CPP] Introduce Float16/BFloat16 support and tests for C#, C++ (#16506) 2023-07-14 10:46:52 -07:00
onnxruntime_compile_triton_kernel.cmake [ROCm] Add ROCm Triton TunableOp for GroupNorm (#16196) 2023-07-11 13:55:30 +08:00
onnxruntime_config.h.in Enable -Wshorten-64-to-32 warning if available. (#16524) 2023-07-07 08:11:44 -07:00
onnxruntime_csharp.cmake
onnxruntime_flatbuffers.cmake Rework some external targets to ease building with -DFETCHCONTENT_FULLY_DISCONNECTED=ON (#15323) 2023-04-03 17:45:12 -07:00
onnxruntime_framework.cmake [C#, CPP] Introduce Float16/BFloat16 support and tests for C#, C++ (#16506) 2023-07-14 10:46:52 -07:00
onnxruntime_framework.natvis [C#, CPP] Introduce Float16/BFloat16 support and tests for C#, C++ (#16506) 2023-07-14 10:46:52 -07:00
onnxruntime_fuzz_test.cmake
onnxruntime_graph.cmake added support for cmake "find_package" (#8919) 2023-06-19 22:20:31 -07:00
onnxruntime_ios.toolchain.cmake
onnxruntime_java.cmake Update build option for training in java to enable_training_api (#15638) 2023-04-24 11:53:08 -07:00
onnxruntime_java_unittests.cmake Update build option for training in java to enable_training_api (#15638) 2023-04-24 11:53:08 -07:00
onnxruntime_kernel_explorer.cmake [ROCm] TunableOp: Update rocBLAS get_solutions API (since ROCm5.6) (#16657) 2023-07-13 11:20:26 +08:00
onnxruntime_language_interop_ops.cmake
onnxruntime_mlas.cmake Workaround to upgrade VS2022 for Windows ARM build (#16826) 2023-07-25 08:35:52 +08:00
onnxruntime_nodejs.cmake
onnxruntime_objectivec.cmake Objective C Training API: TrainingSession (#16374) 2023-06-28 09:13:56 -07:00
onnxruntime_opschema_lib.cmake
onnxruntime_optimizer.cmake Triton Codegen for ORTModule (#15831) 2023-07-13 18:17:58 +08:00
onnxruntime_providers.cmake [JS/Web] Added Gelu contrib operator support to JSEP (#16909) 2023-07-31 09:18:58 -07:00
onnxruntime_pyop.cmake
onnxruntime_python.cmake Triton Codegen for ORTModule (#15831) 2023-07-13 18:17:58 +08:00
onnxruntime_rocm_hipify.cmake [CUDA] Add PackedMultiHeadAttention operator (#16779) 2023-07-28 16:35:38 -07:00
onnxruntime_session.cmake added support for cmake "find_package" (#8919) 2023-06-19 22:20:31 -07:00
onnxruntime_snpe_provider.cmake
onnxruntime_training.cmake Triton Codegen for ORTModule (#15831) 2023-07-13 18:17:58 +08:00
onnxruntime_unittests.cmake Ignore deprecated declarations warning for TRT EP build (#16948) 2023-08-02 09:51:58 -07:00
onnxruntime_util.cmake
onnxruntime_webassembly.cmake [WebNN EP] Merge support for segment anything into main branch (#16208) 2023-06-07 09:56:37 -07:00
precompiled_header.cmake
Sdl.ruleset Add a Github workflow for Prefast (#15763) 2023-05-03 11:42:51 -07:00
set_winapi_family_desktop.h
target_delayload.cmake
uwp_stubs.h Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
wcos_rules_override.cmake
winml.cmake
winml_cppwinrt.cmake
winml_sdk_helpers.cmake
winml_unittests.cmake