diff --git a/paddle/fluid/train/demo/CMakeLists.txt b/paddle/fluid/train/demo/CMakeLists.txt index 289dd9869bd39911fba571cbe9bdb0b7070249d2..5a370b813f2382f1f6d9e10f5ed8b75adb56c377 100644 --- a/paddle/fluid/train/demo/CMakeLists.txt +++ b/paddle/fluid/train/demo/CMakeLists.txt @@ -30,6 +30,7 @@ link_directories("${PADDLE_LIB}/third_party/install/zlib/lib") add_executable(demo_trainer demo_trainer.cc) if(WITH_MKLDNN) + add_definitions(-DPADDLE_WITH_MKLDNN) include_directories("${PADDLE_LIB}/third_party/install/mkldnn/include") if(WIN32) set(MKLDNN_LIB ${PADDLE_LIB}/third_party/install/mkldnn/lib/mkldnn.lib) diff --git a/paddle/fluid/train/demo/clean.sh b/paddle/fluid/train/demo/clean.sh new file mode 100755 index 0000000000000000000000000000000000000000..0297b9781da42e49ff16f874a47649fa50b3ac46 --- /dev/null +++ b/paddle/fluid/train/demo/clean.sh @@ -0,0 +1,4 @@ +set -x +cd `dirname $0` +rm -rf build/ +set +x diff --git a/paddle/fluid/train/demo/run.sh b/paddle/fluid/train/demo/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..42b331066fe10a79c8eadaf9436e3725b3cc3170 --- /dev/null +++ b/paddle/fluid/train/demo/run.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -x + +PADDLE_ROOT=$1 +TURN_ON_MKL=$2 # use MKL or Openblas + +# download models +function download() { + wget -q http://paddle-tar.bj.bcebos.com/train_demo/LR/main_program + wget -q http://paddle-tar.bj.bcebos.com/train_demo/LR/startup_program +} + +download + +# build demo trainer +fluid_install_dir=${PADDLE_ROOT}/build/fluid_install_dir + +mkdir -p build +cd build +rm -rf * +cmake .. -DPADDLE_LIB=$fluid_install_dir \ + -DWITH_MKLDNN=$TURN_ON_MKL \ + -DWITH_MKL=$TURN_ON_MKL +make + +cd .. + +# run demo trainer +build/demo_trainer diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 447bd9c85b8c5258d6f4cff100123c9e3c80d6ac..1a99c9f52d26f7eb8a1c20c847245c9b35bf985a 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -296,7 +296,6 @@ function build_base() { make install -j ${parallel_number} } - function build() { mkdir -p ${PADDLE_ROOT}/build cd ${PADDLE_ROOT}/build @@ -952,6 +951,16 @@ EOF ./clean.sh } +function test_fluid_lib_train() { + cat <