diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-04-04 15:45:20 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-04 15:51:49 -0700 |
commit | 1bba94af33aca56c3a2240302d80f44d65e6aa17 (patch) | |
tree | 7290850aaec1f92b3fe99120202364841e8883f4 /configure.py | |
parent | c8e3d2b43e4cbf9a9e32567a2e59597916f5b0b9 (diff) |
Compile TensorFlow with /arch:AVX on Windows
/arch:AVX is the correpsonding option in MSVC for gcc's --march=native
PiperOrigin-RevId: 191660389
Diffstat (limited to 'configure.py')
-rw-r--r-- | configure.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/configure.py b/configure.py index 0f52c0ec99..26eff5767e 100644 --- a/configure.py +++ b/configure.py @@ -484,6 +484,8 @@ def set_cc_opt_flags(environ_cp): if is_ppc64le(): # gcc on ppc64le does not support -march, use mcpu instead default_cc_opt_flags = '-mcpu=native' + elif is_windows(): + default_cc_opt_flags = '/arch:AVX' else: default_cc_opt_flags = '-march=native' question = ('Please specify optimization flags to use during compilation when' @@ -494,7 +496,7 @@ def set_cc_opt_flags(environ_cp): for opt in cc_opt_flags.split(): write_to_bazelrc('build:opt --copt=%s' % opt) # It should be safe on the same build host. - if not is_ppc64le(): + if not is_ppc64le() and not is_windows(): write_to_bazelrc('build:opt --host_copt=-march=native') write_to_bazelrc('build:opt --define with_default_optimizations=true') # TODO(mikecase): Remove these default defines once we are able to get |