Search code examples
windowstensorflowcompilationbazel

Tensorflow with bazel: avx ignored?


I'm trying to compile tensorflow by hand to take Advantage of avx. Unfortunately I it seems to be ignoring specifically these instructions. I might add that I'm working on a Windows 10. Any help would be appreciated. Thank you.

I used the following command for bazel:

bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both -k //tensorflow/tools/pip_package:build_pip_package

Compile with bazel


Solution

  • -mavx and so on are for GCC and Clang compilers only. Since you are using MSVC, you should use --copt=/arch:AVX --copt=/arch:AVX2 and so on instead.