pythonPackages.tensorflow: add flags for efficent math on CPU

This commit is contained in:
Jean-Philippe Bernardy 2017-10-25 10:56:51 +02:00 committed by Nikolay Amiantov
parent bb87d2c81a
commit 6269306a8d

View File

@ -7,6 +7,9 @@
, cudaSupport ? false, nvidia_x11 ? null, cudatoolkit ? null, cudnn ? null , cudaSupport ? false, nvidia_x11 ? null, cudatoolkit ? null, cudnn ? null
# Default from ./configure script # Default from ./configure script
, cudaCapabilities ? [ "3.5" "5.2" ] , cudaCapabilities ? [ "3.5" "5.2" ]
, sse42Support ? false
, avx2Support ? false
, fmaSupport ? false
}: }:
assert cudaSupport -> cudatoolkit != null assert cudaSupport -> cudatoolkit != null
@ -77,6 +80,9 @@ let
hardeningDisable = [ "all" ]; hardeningDisable = [ "all" ];
bazelFlags = [ "--config=opt" ] bazelFlags = [ "--config=opt" ]
++ lib.optional sse42Support "--copt=-msse4.2"
++ lib.optional avx2Support "--copt=-mavx2"
++ lib.optional fmaSupport "--copt=-mfma"
++ lib.optional cudaSupport "--config=cuda"; ++ lib.optional cudaSupport "--config=cuda";
bazelTarget = "//tensorflow/tools/pip_package:build_pip_package"; bazelTarget = "//tensorflow/tools/pip_package:build_pip_package";