run.sh 904 字节
Newer Older
1 2 3 4
set -x
PADDLE_ROOT=$1
WITH_MKL=$2
WITH_GPU=$3
5 6 7 8 9 10
if [ $2 == ON ]; then
  # You can export yourself if move the install path
  MKL_LIB=${PADDLE_ROOT}/build/fluid_install_dir/third_party/install/mklml/lib
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MKL_LIB}
fi
if [ $3 == ON ]; then
11 12 13 14
  use_gpu_list='true false'
else    
  use_gpu_list='false'
fi
L
Luo Tao 已提交
15 16 17 18

mkdir -p build
cd build

19
for WITH_STATIC_LIB in ON OFF; do
L
Luo Tao 已提交
20 21 22 23 24 25
  rm -rf *
  cmake .. -DPADDLE_LIB=${PADDLE_ROOT}/build/fluid_install_dir/ \
    -DWITH_MKL=$WITH_MKL \
    -DDEMO_NAME=simple_on_word2vec \
    -DWITH_GPU=$WITH_GPU \
    -DWITH_STATIC_LIB=$WITH_STATIC_LIB
26
  make -j
L
Luo Tao 已提交
27 28 29 30
  for use_gpu in $use_gpu_list; do
    ./simple_on_word2vec \
      --dirname=${PADDLE_ROOT}/build/python/paddle/fluid/tests/book/word2vec.inference.model \
      --use_gpu=$use_gpu
31 32 33 34
    if [ $? -ne 0 ]; then
      echo "inference demo runs fail."
      exit 1
    fi
L
Luo Tao 已提交
35
  done
36 37
done
set +x