diff options
author | 2016-05-25 12:39:30 -0800 | |
---|---|---|
committer | 2016-05-25 13:54:21 -0700 | |
commit | 8074e98b20c425b3ca4f51a4cba2cbad35d0413d (patch) | |
tree | 842a991e1403400048c934809224964d48bbe77f | |
parent | 13dc98fd9587c5ad2423757de38a44251c87db56 (diff) |
Pass -O3 when building tensorflow with clang -c opt. (This isn't hooked
up to the OSS build yet, we're working on it.)
Change: 123248081
-rw-r--r-- | tensorflow/tensorflow.bzl | 5 | ||||
-rw-r--r-- | third_party/gpus/cuda/BUILD | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl index acc01eae84..1e73e00a3f 100644 --- a/tensorflow/tensorflow.bzl +++ b/tensorflow/tensorflow.bzl @@ -314,6 +314,11 @@ def _cuda_copts(): "--cuda-gpu-arch=sm_35", ] ), + }) + select({ + # Pass -O3 when building CUDA code with clang; some important + # optimizations are not enabled at O2. + "//third_party/gpus/cuda:using_clang_opt": ["-O3"], + "//conditions:default": [], }) # Build defs for TensorFlow kernels diff --git a/third_party/gpus/cuda/BUILD b/third_party/gpus/cuda/BUILD index a0d1d6561b..b68104385d 100644 --- a/third_party/gpus/cuda/BUILD +++ b/third_party/gpus/cuda/BUILD @@ -31,6 +31,15 @@ config_setting( }, ) +# Equivalent to using_clang && -c opt. +config_setting( + name = "using_clang_opt", + values = { + "define": "using_cuda_clang=true", + "compilation_mode": "opt", + }, +) + config_setting( name = "darwin", values = {"cpu": "darwin"}, |