diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..cdd8de78cef63e14274db368755bbba44e8fb845 --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(api) +add_subdirectory(v2) diff --git a/doc/v2/CMakeLists.txt b/doc/v2/CMakeLists.txt index 58ce5d61c950d12630cfe1de354ffc2a2ba1fd59..50714258f3057a99514d9b120f282190a7e66aae 100644 --- a/doc/v2/CMakeLists.txt +++ b/doc/v2/CMakeLists.txt @@ -16,7 +16,7 @@ set(SPHINX_CACHE_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_doctrees") set(SPHINX_HTML_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/html") configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/templates/conf.py.en.in" + "${CMAKE_CURRENT_SOURCE_DIR}/../templates/conf.py.en.in" "${BINARY_BUILD_DIR_EN}/conf.py" @ONLY) @@ -37,7 +37,7 @@ set(SPHINX_CACHE_DIR_CN "${CMAKE_CURRENT_BINARY_DIR}/cn/_doctrees") set(SPHINX_HTML_DIR_CN "${CMAKE_CURRENT_BINARY_DIR}/cn/html") configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/templates/conf.py.cn.in" + "${CMAKE_CURRENT_SOURCE_DIR}/../templates/conf.py.cn.in" "${BINARY_BUILD_DIR_CN}/conf.py" @ONLY) @@ -47,5 +47,3 @@ sphinx_add_target(paddle_docs_cn ${SPHINX_CACHE_DIR_CN} ${CMAKE_CURRENT_SOURCE_DIR} ${SPHINX_HTML_DIR_CN}) - -add_subdirectory(api) diff --git a/doc/v2/howto/optimization/gpu_profiling_cn.rst b/doc/v2/howto/optimization/gpu_profiling_cn.rst index 0239eef4f118197bf92f9fc7d323be58344b0ded..25bcaccb6975bc21fba2e8c5843da15c69948d72 100644 --- a/doc/v2/howto/optimization/gpu_profiling_cn.rst +++ b/doc/v2/howto/optimization/gpu_profiling_cn.rst @@ -55,7 +55,7 @@ above profilers. :code:`paddle/math/test` 目录中的 :code:`test_GpuProfiler` 就是用于展示上述分析工具的用法。 -.. literalinclude:: ../../../paddle/math/tests/test_GpuProfiler.cpp +.. literalinclude:: ../../../../paddle/math/tests/test_GpuProfiler.cpp :language: c++ :lines: 137-151 :linenos: @@ -83,7 +83,7 @@ program crashes when CPU version of PaddlePaddle invokes them. 1. 加入 :code:`REGISTER_TIMER_INFO` 和 :code:`printAllStatus` 函数(如高亮部分)。 - .. literalinclude:: ../../../paddle/math/tests/test_GpuProfiler.cpp + .. literalinclude:: ../../../../paddle/math/tests/test_GpuProfiler.cpp :language: c++ :lines: 137-151 :emphasize-lines: 8-12,14 @@ -130,7 +130,7 @@ nvprof 工具 1. 将 :code:`REGISTER_GPU_PROFILER` 函数加到代码中(参考强调部分)。 - .. literalinclude:: ../../../paddle/math/tests/test_GpuProfiler.cpp + .. literalinclude:: ../../../../paddle/math/tests/test_GpuProfiler.cpp :language: c++ :lines: 137-151 :emphasize-lines: 6-7 diff --git a/doc/v2/howto/optimization/gpu_profiling_en.rst b/doc/v2/howto/optimization/gpu_profiling_en.rst index ed208ceaf7af0c5aab88fd4fcb18fa96b8c9ff38..50adb7da24906515cb5977db565e9f8a76599fef 100644 --- a/doc/v2/howto/optimization/gpu_profiling_en.rst +++ b/doc/v2/howto/optimization/gpu_profiling_en.rst @@ -54,7 +54,7 @@ In this tutorial, we will focus on nvprof and nvvp. :code:`test_GpuProfiler` from :code:`paddle/math/tests` directory will be used to evaluate above profilers. -.. literalinclude:: ../../../paddle/math/tests/test_GpuProfiler.cpp +.. literalinclude:: ../../../../paddle/math/tests/test_GpuProfiler.cpp :language: c++ :lines: 137-151 :linenos: @@ -80,7 +80,7 @@ As a simple example, consider the following: 1. Add :code:`REGISTER_TIMER_INFO` and :code:`printAllStatus` functions (see the emphasize-lines). - .. literalinclude:: ../../../paddle/math/tests/test_GpuProfiler.cpp + .. literalinclude:: ../../../../paddle/math/tests/test_GpuProfiler.cpp :language: c++ :lines: 137-151 :emphasize-lines: 8-12,14 @@ -127,7 +127,7 @@ To use this command line profiler **nvprof**, you can simply issue the following 1. Add :code:`REGISTER_GPU_PROFILER` function (see the emphasize-lines). - .. literalinclude:: ../../../paddle/math/tests/test_GpuProfiler.cpp + .. literalinclude:: ../../../../paddle/math/tests/test_GpuProfiler.cpp :language: c++ :lines: 137-151 :emphasize-lines: 6-7 diff --git a/paddle/scripts/travis/build_doc.sh b/paddle/scripts/travis/build_doc.sh index aa223d87ba8ff09e774172d049f73039d5c9fc28..70c821fad94b688536a38c7a5cd02b66de553155 100755 --- a/paddle/scripts/travis/build_doc.sh +++ b/paddle/scripts/travis/build_doc.sh @@ -12,8 +12,8 @@ make -j `nproc` copy_paddle_pybind make -j `nproc` paddle_docs paddle_docs_cn paddle_api_docs # check websites for broken links -linkchecker doc/en/html/index.html -linkchecker doc/cn/html/index.html +linkchecker doc/v2/en/html/index.html +linkchecker doc/v2/cn/html/index.html linkchecker doc/api/en/html/index.html # Parse Github URL @@ -55,8 +55,8 @@ function deploy_docs() { set +e rm -rf ${DIR}/doc ${DIR}/doc_cn ${DIR}/api_doc set -e - cp -r ../doc/cn/html ${DIR}/doc_cn - cp -r ../doc/en/html ${DIR}/doc + cp -r ../doc/v2/cn/html ${DIR}/doc_cn + cp -r ../doc/v2/en/html ${DIR}/doc cp -r ../doc/api/en/html ${DIR}/api_doc git add . }