From 06bb059b5e56cda52ae7860d8dd09f2e84012d00 Mon Sep 17 00:00:00 2001 From: qingqing01 Date: Thu, 31 Oct 2019 20:20:39 +0800 Subject: [PATCH] Update custom_op doc (#1572) (#1573) --- .../development/new_op/custom_op.md | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/doc/fluid/advanced_usage/development/new_op/custom_op.md b/doc/fluid/advanced_usage/development/new_op/custom_op.md index 706399bb0..7abc548c4 100644 --- a/doc/fluid/advanced_usage/development/new_op/custom_op.md +++ b/doc/fluid/advanced_usage/development/new_op/custom_op.md @@ -251,29 +251,25 @@ lib_dir=$( python -c 'import paddle; print(paddle.sysconfig.get_lib())' ) echo $include_dir echo $lib_dir +# PaddlePaddel >=1.6.1, 仅需要include ${include_dir} 和 ${include_dir}/third_party nvcc relu_op.cu -c -o relu_op.cu.o -ccbin cc -DPADDLE_WITH_CUDA -DEIGEN_USE_GPU -DPADDLE_USE_DSO -Xcompiler -fPIC -std=c++11 -Xcompiler -fPIC -w --expt-relaxed-constexpr -O3 -DNVCC \ - -I ${include_dir}/third_party/install/gflags/include \ - -I ${include_dir}/third_party/install/glog/include \ - -I ${include_dir}/third_party/install/protobuf/include \ - -I ${include_dir}/third_party/install/xxhash/include \ - -I ${include_dir}/third_party/boost \ - -I ${include_dir}/third_party/eigen3 \ - -I ${include_dir}/third_party/dlpack/include \ - -I ${include_dir}/third_party/threadpool/src/extern_threadpool \ -I ${include_dir} \ + -I ${include_dir}/third_party \ g++ relu_op.cc relu_op.cu.o -o relu2_op.so -shared -fPIC -std=c++11 -O3 \ - -I ${include_dir}/third_party/install/protobuf/include \ - -I ${include_dir}/third_party/install/glog/include \ - -I ${include_dir}/third_party/install/gflags/include \ - -I ${include_dir}/third_party/install/xxhash/include \ - -I ${include_dir}/third_party/install/zlib/include \ - -I ${include_dir}/third_party/boost \ - -I ${include_dir}/third_party/eigen3 \ - -I ${include_dir}/third_party/dlpack/include \ -I ${include_dir} \ + -I ${include_dir}/third_party \ -L /usr/local/cuda/lib64 \ -L ${lib_dir} -lpaddle_framework -lcudart + +# PaddlePaddel 1.6.0, 需要include的third_party如下: +# -I ${include_dir}/third_party/install/protobuf/include \ +# -I ${include_dir}/third_party/install/glog/include \ +# -I ${include_dir}/third_party/install/gflags/include \ +# -I ${include_dir}/third_party/install/xxhash/include \ +# -I ${include_dir}/third_party/boost \ +# -I ${include_dir}/third_party/eigen3 \ +# -I ${include_dir}/third_party/dlpack/include \ ``` -- GitLab