Commit ea166bcd authored by Jayaram Bobba's avatar Jayaram Bobba Committed by Sang Ik Lee

Build option to disable fast math (#2822)

* Added build option to disable fast math

* Change option name
parent ec2f69bf
......@@ -178,6 +178,7 @@ option(NGRAPH_LIB_VERSIONING_ENABLE "Enable shared library versioning" FALSE)
option(NGRAPH_PYTHON_BUILD_ENABLE "Enable build nGraph python package wheel" FALSE)
option(NGRAPH_PLAIDML_ENABLE "Enable the PlaidML backend" ${PLAIDML_FOUND})
option(NGRAPH_DISTRIBUTED_ENABLE "Enable distributed training using MLSL/OpenMPI" OFF)
option(NGRAPH_FAST_MATH_ENABLE "Enable fast math" ON)
option(NGRAPH_JSON_ENABLE "Enable JSON based serialization and tracing features" TRUE)
option(NGRAPH_STATIC_LIB_ENABLE "Enable build nGraph static library" FALSE)
......
......@@ -171,6 +171,10 @@ if (NGRAPH_CPU_ENABLE)
add_dependencies(cpu_backend ext_halide)
endif()
if(NOT NGRAPH_FAST_MATH_ENABLE)
target_compile_definitions(cpu_backend PRIVATE EIGEN_FAST_MATH=0)
endif()
if(OPENMP_FOUND)
target_compile_options(cpu_backend PRIVATE "${OpenMP_CXX_FLAGS}")
if (NOT WIN32)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment