diff options
author | Jonathan Hseu <jhseu@google.com> | 2017-01-11 16:39:35 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-01-11 16:45:22 -0800 |
commit | 83c6e0c63acdcab2c58c4ed7220bfa58879b1d57 (patch) | |
tree | b04adda58043fd87b95940a675e065d21c0aef24 /configure | |
parent | 99e1b19ceba32b8354dddc2841b81864c9ba96bb (diff) |
Switch open-source to use jemalloc for CPU Tensor memory allocation, gRPC, and other places where we call malloc/free.
- Only enabled on Linux for now.
- Added as a ./configure option defaulting to enabled.
Change: 144266237
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -57,9 +57,27 @@ done if is_windows; then TF_NEED_GCP=0 TF_NEED_HDFS=0 + TF_NEED_JEMALLOC=0 TF_NEED_OPENCL=0 fi +while [ "$TF_NEED_JEMALLOC" == "" ]; do + read -p "Do you wish to use jemalloc as the malloc implementation? "\ +"(Linux only) [Y/n] " INPUT + case $INPUT in + [Yy]* ) echo "jemalloc enabled on Linux"; TF_NEED_JEMALLOC=1;; + [Nn]* ) echo "jemalloc disabled on Linux"; TF_NEED_JEMALLOC=0;; + "" ) echo "jemalloc enabled on Linux"; TF_NEED_JEMALLOC=1;; + * ) echo "Invalid selection: " $INPUT;; + esac +done + +if [ "$TF_NEED_JEMALLOC" == "1" ]; then + sed -i -e "s/WITH_JEMALLOC = False/WITH_JEMALLOC = True/" tensorflow/core/platform/default/build_config.bzl +else + sed -i -e "s/WITH_JEMALLOC = True/WITH_JEMALLOC = False/" tensorflow/core/platform/default/build_config.bzl +fi + while [ "$TF_NEED_GCP" == "" ]; do read -p "Do you wish to build TensorFlow with "\ "Google Cloud Platform support? [y/N] " INPUT |