Skip to content

Commit

Permalink
pythonPackages.tensorflow: add flags for efficent math on CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
jyp authored and abbradar committed Nov 4, 2017
1 parent bb87d2c commit 6269306
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/development/python-modules/tensorflow/default.nix
Expand Up @@ -7,6 +7,9 @@
, cudaSupport ? false, nvidia_x11 ? null, cudatoolkit ? null, cudnn ? null
# Default from ./configure script
, cudaCapabilities ? [ "3.5" "5.2" ]
, sse42Support ? false
, avx2Support ? false
, fmaSupport ? false
}:

assert cudaSupport -> cudatoolkit != null
Expand Down Expand Up @@ -77,6 +80,9 @@ let
hardeningDisable = [ "all" ];

bazelFlags = [ "--config=opt" ]
++ lib.optional sse42Support "--copt=-msse4.2"
++ lib.optional avx2Support "--copt=-mavx2"
++ lib.optional fmaSupport "--copt=-mfma"
++ lib.optional cudaSupport "--config=cuda";

bazelTarget = "//tensorflow/tools/pip_package:build_pip_package";
Expand Down

0 comments on commit 6269306

Please sign in to comment.