Based on this document "Intel® Math Kernel Library for Deep Learning Networks: Part 1–Overview and Installation", I give a quick summary to do it.
Here are the steps for building TensorFlow from source with Intel MKL enabled.
For MKL DNN:
Here are the steps for building TensorFlow from source with Intel MKL enabled.
For MKL DNN:
# Install Intel MKL & MKL-DNN
$ git clone https://github.com/01org/mkl-dnn.git
$ cd mkl-dnn
$ cd scripts && ./prepare_mkl.sh && cd ..
$ mkdir -p build && cd build && cmake .. && make -j$(nproc)
$ make test
$ sudo make install
For building TensorFlow: