summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Reed <jamesreed@fb.com>2019-04-23 11:03:31 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-04-23 11:06:49 -0700
commit1b3967b491fc264835f8e3326d686aaa3b5231c0 (patch)
tree928cbfb23ccefc9dd4ef6f04901f60474c0fbc58
parentd8729efabe83b18f7c53cdf8cd62128baf9c0bd6 (diff)
downloadpytorch-1b3967b491fc264835f8e3326d686aaa3b5231c0.tar.gz
pytorch-1b3967b491fc264835f8e3326d686aaa3b5231c0.tar.bz2
pytorch-1b3967b491fc264835f8e3326d686aaa3b5231c0.zip
-fno-math-errno -fno-trapping-math (#19552)
Summary: As suggested in https://github.com/pytorch/pytorch/pull/19152#discussion_r275925767, this may give the compiler more opportunities for auto-vectorization Pull Request resolved: https://github.com/pytorch/pytorch/pull/19552 Differential Revision: D15048358 Pulled By: jamesr66a fbshipit-source-id: db2c2c515c3e9f7d22305c039ab0c8a867fc43a2
-rw-r--r--CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6a20cd88c..71f8b693a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -309,6 +309,8 @@ if(NOT MSVC)
endif()
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -O0")
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -O0")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-math-errno")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-trapping-math")
else()
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE