From 4221d9bf85e2be58415ea24e86543562c860e010 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 7 Aug 2023 10:31:04 -0700 Subject: [PATCH 01/21] Add docs to envs --- dependencies.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/dependencies.yaml b/dependencies.yaml index 95f275134..42c91114d 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -12,6 +12,7 @@ files: - develop - docs - run + - docs - test_python test_python: output: none From b55374b306ed5959581aed1cd70f947c0e93cdbe Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 7 Aug 2023 10:32:02 -0700 Subject: [PATCH 02/21] Add breathe and alphabetize --- conda/environments/all_cuda-118_arch-x86_64.yaml | 1 + conda/environments/all_cuda-120_arch-x86_64.yaml | 1 + dependencies.yaml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 78ddf0503..3a5cb90af 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -4,6 +4,7 @@ channels: - rapidsai - conda-forge dependencies: +- breathe - c-compiler - clang-tools==16.0.6 - clang==16.0.6 diff --git a/conda/environments/all_cuda-120_arch-x86_64.yaml b/conda/environments/all_cuda-120_arch-x86_64.yaml index aec31b3db..f87564b74 100644 --- a/conda/environments/all_cuda-120_arch-x86_64.yaml +++ b/conda/environments/all_cuda-120_arch-x86_64.yaml @@ -4,6 +4,7 @@ channels: - rapidsai - conda-forge dependencies: +- breathe - c-compiler - clang-tools==16.0.6 - clang==16.0.6 diff --git a/dependencies.yaml b/dependencies.yaml index 42c91114d..0022dfcb6 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -12,7 +12,6 @@ files: - develop - docs - run - - docs - test_python test_python: output: none @@ -176,6 +175,7 @@ dependencies: - output_types: conda packages: - *doxygen + - breathe - graphviz - ipython - make From 9f511da7dbe0a26fd87d7ff93bcb35447fc64e48 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 8 Aug 2023 17:36:48 -0700 Subject: [PATCH 03/21] Add C++ docs --- python/docs/conf.py | 12 ++++++++++++ python/docs/index.rst | 1 + python/docs/librmm_api.rst | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 python/docs/librmm_api.rst diff --git a/python/docs/conf.py b/python/docs/conf.py index d8c7460dc..e224f59dd 100644 --- a/python/docs/conf.py +++ b/python/docs/conf.py @@ -46,8 +46,12 @@ "IPython.sphinxext.ipython_directive", "nbsphinx", "recommonmark", + "breathe", ] +# Breathe Configuration +breathe_projects = {"librmm": "../../doxygen/xml"} +breathe_default_project = "librmm" copybutton_prompt_text = ">>> " @@ -197,9 +201,17 @@ ] +def on_missing_reference(app, env, node, contnode): + return contnode + if node["refdomain"] == "cpp": + return contnode + return None + + def setup(app): app.add_js_file("copybutton_pydocs.js") app.add_css_file("https://docs.rapids.ai/assets/css/custom.css") app.add_js_file( "https://docs.rapids.ai/assets/js/custom.js", loading_method="defer" ) + app.connect("missing-reference", on_missing_reference) diff --git a/python/docs/index.rst b/python/docs/index.rst index 8dffdeb02..4a675d297 100644 --- a/python/docs/index.rst +++ b/python/docs/index.rst @@ -12,6 +12,7 @@ Welcome to rmm's documentation! basics.md api.rst + librmm_api.rst Indices and tables diff --git a/python/docs/librmm_api.rst b/python/docs/librmm_api.rst new file mode 100644 index 000000000..087eda247 --- /dev/null +++ b/python/docs/librmm_api.rst @@ -0,0 +1,4 @@ +API Reference +============== + +.. doxygennamespace:: rmm From 01cf1114be9e288e1511f826e61314cb892a15c9 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 9 Aug 2023 08:13:31 -0700 Subject: [PATCH 04/21] Fix doxygen code blocks so that they also display nicely in Sphinx --- include/rmm/device_uvector.hpp | 2 +- include/rmm/mr/device/device_memory_resource.hpp | 2 +- include/rmm/mr/device/failure_callback_resource_adaptor.hpp | 2 +- include/rmm/mr/device/per_device_resource.hpp | 2 +- include/rmm/mr/device/polymorphic_allocator.hpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/rmm/device_uvector.hpp b/include/rmm/device_uvector.hpp index 930cda157..982d2095d 100644 --- a/include/rmm/device_uvector.hpp +++ b/include/rmm/device_uvector.hpp @@ -44,7 +44,7 @@ namespace rmm { * `thrust::uninitialized_fill`. * * Example: - * @code{c++} + * @code{.cpp} * rmm::mr::device_memory_resource * mr = new my_custom_resource(); * rmm::cuda_stream_view s{}; * diff --git a/include/rmm/mr/device/device_memory_resource.hpp b/include/rmm/mr/device/device_memory_resource.hpp index 355042092..bda52ac67 100644 --- a/include/rmm/mr/device/device_memory_resource.hpp +++ b/include/rmm/mr/device/device_memory_resource.hpp @@ -75,7 +75,7 @@ namespace rmm::mr { * pool_memory_resource objects for each device and sets them as the per-device resource for that * device. * - * @code{c++} + * @code{.cpp} * std::vector> per_device_pools; * for(int i = 0; i < N; ++i) { * cudaSetDevice(i); diff --git a/include/rmm/mr/device/failure_callback_resource_adaptor.hpp b/include/rmm/mr/device/failure_callback_resource_adaptor.hpp index 73fd5f3b8..f8cbe8597 100644 --- a/include/rmm/mr/device/failure_callback_resource_adaptor.hpp +++ b/include/rmm/mr/device/failure_callback_resource_adaptor.hpp @@ -60,7 +60,7 @@ using failure_callback_t = std::function; * When implementing a callback function for allocation retry, care must be taken to avoid an * infinite loop. The following example makes sure to only retry the allocation once: * - * @code{c++} + * @code{.cpp} * using failure_callback_adaptor = * rmm::mr::failure_callback_resource_adaptor; * diff --git a/include/rmm/mr/device/per_device_resource.hpp b/include/rmm/mr/device/per_device_resource.hpp index aa7217758..594b48749 100644 --- a/include/rmm/mr/device/per_device_resource.hpp +++ b/include/rmm/mr/device/per_device_resource.hpp @@ -61,7 +61,7 @@ * pool_memory_resource objects for each device and sets them as the per-device resource for that * device. * - * @code{c++} + * @code{.cpp} * std::vector> per_device_pools; * for(int i = 0; i < N; ++i) { * cudaSetDevice(i); diff --git a/include/rmm/mr/device/polymorphic_allocator.hpp b/include/rmm/mr/device/polymorphic_allocator.hpp index a52ec14d1..c3b8ac6ea 100644 --- a/include/rmm/mr/device/polymorphic_allocator.hpp +++ b/include/rmm/mr/device/polymorphic_allocator.hpp @@ -133,7 +133,7 @@ bool operator!=(polymorphic_allocator const& lhs, polymorphic_allocator co *`deallocate` functions. * * Example: - *\code{c++} + *\code{.cpp} * my_stream_ordered_allocator a{...}; * cuda_stream_view s = // create stream; * From dc7580d4b25b28e50c38ccbc267f2e0f5b2d243b Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 9 Aug 2023 17:53:34 -0700 Subject: [PATCH 05/21] Temporarily allow building with warnings so that CI can complete and generate previews --- python/docs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/docs/Makefile b/python/docs/Makefile index 72d1dcd85..68e58b474 100644 --- a/python/docs/Makefile +++ b/python/docs/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line, and also # from the environment for the first two. -SPHINXOPTS = -n -v -W --keep-going +SPHINXOPTS = -n -v SPHINXBUILD ?= sphinx-build SOURCEDIR = . BUILDDIR = _build From b4aba221e8f48b2dc5a2e5cefcc2297992a49b75 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 21 Sep 2023 10:37:08 -0700 Subject: [PATCH 06/21] Alphabetize deps --- dependencies.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.yaml b/dependencies.yaml index 0022dfcb6..af3f49ef0 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -174,8 +174,8 @@ dependencies: common: - output_types: conda packages: - - *doxygen - breathe + - *doxygen - graphviz - ipython - make From d8a46883c2edb4a7ac853b3120bfb59736c93d05 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 21 Sep 2023 10:41:36 -0700 Subject: [PATCH 07/21] Remove patch for now --- python/docs/conf.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python/docs/conf.py b/python/docs/conf.py index e224f59dd..021a077c1 100644 --- a/python/docs/conf.py +++ b/python/docs/conf.py @@ -201,11 +201,10 @@ ] -def on_missing_reference(app, env, node, contnode): - return contnode - if node["refdomain"] == "cpp": - return contnode - return None +# def on_missing_reference(app, env, node, contnode): +# if node["refdomain"] == "cpp": +# return contnode +# return None def setup(app): @@ -214,4 +213,4 @@ def setup(app): app.add_js_file( "https://docs.rapids.ai/assets/js/custom.js", loading_method="defer" ) - app.connect("missing-reference", on_missing_reference) + # app.connect("missing-reference", on_missing_reference) From fb8ff889145ce91e2ab2033e2456bf8450d7d7b9 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 21 Sep 2023 10:54:17 -0700 Subject: [PATCH 08/21] First pass of reorg --- python/docs/cpp.rst | 8 ++++++++ python/docs/{librmm_api.rst => cpp_api.rst} | 2 +- python/docs/{basics.md => guide.md} | 2 +- python/docs/index.rst | 5 ++--- python/docs/python.rst | 9 +++++++++ python/docs/{api.rst => python_api.rst} | 0 6 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 python/docs/cpp.rst rename python/docs/{librmm_api.rst => cpp_api.rst} (73%) rename python/docs/{basics.md => guide.md} (99%) create mode 100644 python/docs/python.rst rename python/docs/{api.rst => python_api.rst} (100%) diff --git a/python/docs/cpp.rst b/python/docs/cpp.rst new file mode 100644 index 000000000..e60f15129 --- /dev/null +++ b/python/docs/cpp.rst @@ -0,0 +1,8 @@ +Welcome to the rmm C++ documentation! +======================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + cpp_api.rst diff --git a/python/docs/librmm_api.rst b/python/docs/cpp_api.rst similarity index 73% rename from python/docs/librmm_api.rst rename to python/docs/cpp_api.rst index 087eda247..ca0afbb0d 100644 --- a/python/docs/librmm_api.rst +++ b/python/docs/cpp_api.rst @@ -1,4 +1,4 @@ API Reference -============== +============= .. doxygennamespace:: rmm diff --git a/python/docs/basics.md b/python/docs/guide.md similarity index 99% rename from python/docs/basics.md rename to python/docs/guide.md index 997745f00..c06135ca8 100644 --- a/python/docs/basics.md +++ b/python/docs/guide.md @@ -1,4 +1,4 @@ -# RMM - the RAPIDS Memory Manager +# User Guide Achieving optimal performance in GPU-centric workflows frequently requires customizing how GPU ("device") memory is allocated. diff --git a/python/docs/index.rst b/python/docs/index.rst index 4a675d297..524351253 100644 --- a/python/docs/index.rst +++ b/python/docs/index.rst @@ -10,9 +10,8 @@ Welcome to rmm's documentation! :maxdepth: 2 :caption: Contents: - basics.md - api.rst - librmm_api.rst + Python + C++ Indices and tables diff --git a/python/docs/python.rst b/python/docs/python.rst new file mode 100644 index 000000000..bff919627 --- /dev/null +++ b/python/docs/python.rst @@ -0,0 +1,9 @@ +Welcome to the rmm Python documentation! +======================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + guide.md + python_api.rst diff --git a/python/docs/api.rst b/python/docs/python_api.rst similarity index 100% rename from python/docs/api.rst rename to python/docs/python_api.rst From 34eaea5ab7ee820bc0131a8e33380583b68b7906 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 25 Oct 2023 09:23:53 -0700 Subject: [PATCH 09/21] First pass at using groups --- python/docs/cpp_api.rst | 6 ++++- .../librmm_docs/cuda_device_management.rst | 5 ++++ python/docs/librmm_docs/cuda_streams.rst | 5 ++++ python/docs/librmm_docs/data_containers.rst | 5 ++++ python/docs/librmm_docs/index.rst | 26 +++++++++++++++++++ python/docs/librmm_docs/logging.rst | 5 ++++ python/docs/librmm_docs/memory_resources.rst | 5 ++++ .../docs/librmm_docs/thrust_integrations.rst | 5 ++++ 8 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 python/docs/librmm_docs/cuda_device_management.rst create mode 100644 python/docs/librmm_docs/cuda_streams.rst create mode 100644 python/docs/librmm_docs/data_containers.rst create mode 100644 python/docs/librmm_docs/index.rst create mode 100644 python/docs/librmm_docs/logging.rst create mode 100644 python/docs/librmm_docs/memory_resources.rst create mode 100644 python/docs/librmm_docs/thrust_integrations.rst diff --git a/python/docs/cpp_api.rst b/python/docs/cpp_api.rst index ca0afbb0d..215389f83 100644 --- a/python/docs/cpp_api.rst +++ b/python/docs/cpp_api.rst @@ -1,4 +1,8 @@ API Reference ============= -.. doxygennamespace:: rmm +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + librmm_docs diff --git a/python/docs/librmm_docs/cuda_device_management.rst b/python/docs/librmm_docs/cuda_device_management.rst new file mode 100644 index 000000000..096509886 --- /dev/null +++ b/python/docs/librmm_docs/cuda_device_management.rst @@ -0,0 +1,5 @@ +CUDA Device Management +====================== + +.. doxygengroup:: cuda_device_management + :members: diff --git a/python/docs/librmm_docs/cuda_streams.rst b/python/docs/librmm_docs/cuda_streams.rst new file mode 100644 index 000000000..e3e6ed793 --- /dev/null +++ b/python/docs/librmm_docs/cuda_streams.rst @@ -0,0 +1,5 @@ +CUDA Streams +============ + +.. doxygengroup:: cuda_streams + :members: diff --git a/python/docs/librmm_docs/data_containers.rst b/python/docs/librmm_docs/data_containers.rst new file mode 100644 index 000000000..1cfccb7bd --- /dev/null +++ b/python/docs/librmm_docs/data_containers.rst @@ -0,0 +1,5 @@ +Data Containers +=============== + +.. doxygengroup:: data_containers + :members: diff --git a/python/docs/librmm_docs/index.rst b/python/docs/librmm_docs/index.rst new file mode 100644 index 000000000..f62170860 --- /dev/null +++ b/python/docs/librmm_docs/index.rst @@ -0,0 +1,26 @@ +.. rmm documentation master file, created by + sphinx-quickstart on Thu Nov 19 13:16:00 2020. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +librmm Documentation +==================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + cuda_device_management + cuda_streams + data_containers + logging + memory_resources + thrust_integrations + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/python/docs/librmm_docs/logging.rst b/python/docs/librmm_docs/logging.rst new file mode 100644 index 000000000..97f961c0c --- /dev/null +++ b/python/docs/librmm_docs/logging.rst @@ -0,0 +1,5 @@ +Logging +======= + +.. doxygengroup:: logging + :members: diff --git a/python/docs/librmm_docs/memory_resources.rst b/python/docs/librmm_docs/memory_resources.rst new file mode 100644 index 000000000..017ec02ab --- /dev/null +++ b/python/docs/librmm_docs/memory_resources.rst @@ -0,0 +1,5 @@ +Memory Resources +================ + +.. doxygengroup:: memory_resources + :members: diff --git a/python/docs/librmm_docs/thrust_integrations.rst b/python/docs/librmm_docs/thrust_integrations.rst new file mode 100644 index 000000000..8574f482a --- /dev/null +++ b/python/docs/librmm_docs/thrust_integrations.rst @@ -0,0 +1,5 @@ +Thrust Integration +================== + +.. doxygengroup:: thrust_integrations + :members: From 59deec7567880f1d3ae543c6b9d7c1961c1a419a Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 25 Oct 2023 09:41:52 -0700 Subject: [PATCH 10/21] Fix typo --- python/docs/cpp_api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/docs/cpp_api.rst b/python/docs/cpp_api.rst index 215389f83..63e435190 100644 --- a/python/docs/cpp_api.rst +++ b/python/docs/cpp_api.rst @@ -5,4 +5,4 @@ API Reference :maxdepth: 2 :caption: Contents: - librmm_docs + librmm_docs/index From 8a4276353ee3cbc333862785a15a192ab62ea3a7 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 25 Oct 2023 10:16:20 -0700 Subject: [PATCH 11/21] Add errors group --- python/docs/librmm_docs/errors.rst | 5 +++++ python/docs/librmm_docs/index.rst | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 python/docs/librmm_docs/errors.rst diff --git a/python/docs/librmm_docs/errors.rst b/python/docs/librmm_docs/errors.rst new file mode 100644 index 000000000..4de0ee40a --- /dev/null +++ b/python/docs/librmm_docs/errors.rst @@ -0,0 +1,5 @@ +Errors +====== + +.. doxygengroup:: errors + :members: diff --git a/python/docs/librmm_docs/index.rst b/python/docs/librmm_docs/index.rst index f62170860..f7de410b0 100644 --- a/python/docs/librmm_docs/index.rst +++ b/python/docs/librmm_docs/index.rst @@ -13,11 +13,15 @@ librmm Documentation cuda_device_management cuda_streams data_containers + errors logging memory_resources thrust_integrations +.. doxygennamespace:: rmm + :desc-only: + Indices and tables ================== From 6ec93b4fe2f2d9024fd349f0dedb1c4cf22ab95b Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 25 Oct 2023 10:16:40 -0700 Subject: [PATCH 12/21] Add all memory resource subgroups to breathe --- python/docs/librmm_docs/memory_resources.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python/docs/librmm_docs/memory_resources.rst b/python/docs/librmm_docs/memory_resources.rst index 017ec02ab..fb4764d8a 100644 --- a/python/docs/librmm_docs/memory_resources.rst +++ b/python/docs/librmm_docs/memory_resources.rst @@ -1,5 +1,17 @@ Memory Resources ================ +.. doxygennamespace:: rmm::mr + :desc-only: + .. doxygengroup:: memory_resources + :desc-only: + +.. doxygengroup:: device_memory_resources + :members: + +.. doxygengroup:: host_memory_resources + :members: + +.. doxygengroup:: device_resource_adaptors :members: From 229a37f3fe2e7d0356a69129e1a8a65850fd76b3 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 31 Oct 2023 10:11:42 -0700 Subject: [PATCH 13/21] Update python/docs/librmm_docs/index.rst Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com> --- python/docs/librmm_docs/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/docs/librmm_docs/index.rst b/python/docs/librmm_docs/index.rst index f7de410b0..880e90ce3 100644 --- a/python/docs/librmm_docs/index.rst +++ b/python/docs/librmm_docs/index.rst @@ -10,13 +10,13 @@ librmm Documentation :maxdepth: 2 :caption: Contents: + memory_resources + data_containers + thrust_integrations cuda_device_management cuda_streams - data_containers errors logging - memory_resources - thrust_integrations .. doxygennamespace:: rmm From 1c77fa78e0c3b1989955eca4383d712267346448 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 31 Oct 2023 10:11:29 -0700 Subject: [PATCH 14/21] Fix incorrect grouping for logger --- include/rmm/logger.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/rmm/logger.hpp b/include/rmm/logger.hpp index ce0abc23b..6213221ab 100644 --- a/include/rmm/logger.hpp +++ b/include/rmm/logger.hpp @@ -98,7 +98,9 @@ struct bytes { /** * @brief Returns the global RMM logger - * @addtogroup logging + * + * @ingroup logging + * * This is a spdlog logger. The easiest way to log messages is to use the `RMM_LOG_*` macros. * * @return spdlog::logger& The logger. From 851661c6521c081b10b672b325f1ff2e5f205e09 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 31 Oct 2023 10:12:58 -0700 Subject: [PATCH 15/21] Remove modindex --- python/docs/librmm_docs/index.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/docs/librmm_docs/index.rst b/python/docs/librmm_docs/index.rst index 880e90ce3..6afd94d2e 100644 --- a/python/docs/librmm_docs/index.rst +++ b/python/docs/librmm_docs/index.rst @@ -10,7 +10,7 @@ librmm Documentation :maxdepth: 2 :caption: Contents: - memory_resources + memory_resources data_containers thrust_integrations cuda_device_management @@ -26,5 +26,4 @@ Indices and tables ================== * :ref:`genindex` -* :ref:`modindex` * :ref:`search` From 89ce30079940a171671adde8dd7c26428f2581c5 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 31 Oct 2023 16:14:33 -0700 Subject: [PATCH 16/21] Add per_device_resource to memory_resources group --- include/rmm/mr/device/per_device_resource.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/rmm/mr/device/per_device_resource.hpp b/include/rmm/mr/device/per_device_resource.hpp index 594b48749..139389f0c 100644 --- a/include/rmm/mr/device/per_device_resource.hpp +++ b/include/rmm/mr/device/per_device_resource.hpp @@ -72,6 +72,10 @@ */ namespace rmm::mr { +/** + * @addtogroup memory_resources + * @{ + */ namespace detail { @@ -233,4 +237,5 @@ inline device_memory_resource* set_current_device_resource(device_memory_resourc { return set_per_device_resource(rmm::get_current_cuda_device(), new_mr); } +/** @} */ // end of group } // namespace rmm::mr From 3cc30f4c9962508dce43a55d0a0e04cd0f968372 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 31 Oct 2023 16:53:25 -0700 Subject: [PATCH 17/21] Fix thrown error --- include/rmm/mr/device/cuda_async_memory_resource.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rmm/mr/device/cuda_async_memory_resource.hpp b/include/rmm/mr/device/cuda_async_memory_resource.hpp index 527cd3875..de31c7dc4 100644 --- a/include/rmm/mr/device/cuda_async_memory_resource.hpp +++ b/include/rmm/mr/device/cuda_async_memory_resource.hpp @@ -75,7 +75,7 @@ class cuda_async_memory_resource final : public device_memory_resource { * If the pool size grows beyond the release threshold, unused memory held by the pool will be * released at the next synchronization event. * - * @throws rmm::runtime_error if the CUDA version does not support `cudaMallocAsync` + * @throws rmm::logic_error if the CUDA version does not support `cudaMallocAsync` * * @param initial_pool_size Optional initial size in bytes of the pool. If no value is provided, * initial pool size is half of the available GPU memory. From 6fdf76f9725eeda0290022d21b0fa77caac8529f Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 31 Oct 2023 16:53:35 -0700 Subject: [PATCH 18/21] Add documentation of per_device_resource functions --- python/docs/librmm_docs/memory_resources.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/docs/librmm_docs/memory_resources.rst b/python/docs/librmm_docs/memory_resources.rst index fb4764d8a..68d33f003 100644 --- a/python/docs/librmm_docs/memory_resources.rst +++ b/python/docs/librmm_docs/memory_resources.rst @@ -5,7 +5,7 @@ Memory Resources :desc-only: .. doxygengroup:: memory_resources - :desc-only: + :members: .. doxygengroup:: device_memory_resources :members: From ead99471581d47d23c7072065f8831cf855b56da Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 31 Oct 2023 17:25:46 -0700 Subject: [PATCH 19/21] Properly implement on missing ref --- python/docs/conf.py | 67 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/python/docs/conf.py b/python/docs/conf.py index 021a077c1..c55d998d6 100644 --- a/python/docs/conf.py +++ b/python/docs/conf.py @@ -11,6 +11,7 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # import os +import re # -- Project information ----------------------------------------------------- @@ -201,10 +202,66 @@ ] -# def on_missing_reference(app, env, node, contnode): -# if node["refdomain"] == "cpp": -# return contnode -# return None +def on_missing_reference(app, env, node, contnode): + if (refid := node.get("refid")) is not None and "hpp" in refid: + # We don't want to link to C++ header files directly from the + # Sphinx docs, those are pages that doxygen automatically + # generates. Adding those would clutter the Sphinx output. + return contnode + + names_to_skip = [ + # External names + "cudaStream_t", + "cudaStreamLegacy", + "cudaStreamPerThread", + "thrust", + "spdlog", + # Unknown types + "int64_t", + "int8_t", + # Internal objects + "detail", + "RMM_EXEC_CHECK_DISABLE", + "default_alignment_threshold", + "get_default_filename", + # Template types + "Base", + ] + if ( + node["refdomain"] == "cpp" + and (reftarget := node.get("reftarget")) is not None + ): + if any(toskip in reftarget for toskip in names_to_skip): + return contnode + + # Strip template parameters and just use the base type. + if match := re.search("(.*)<.*>", reftarget): + reftarget = match.group(1) + + # Try to find the target prefixed with e.g. namespaces in case that's + # all that's missing. Include the empty prefix in case we're searching + # for a stripped template. + extra_prefixes = ["rmm::", "rmm::mr::", "mr::", ""] + for (name, dispname, type, docname, anchor, priority) in env.domains[ + "cpp" + ].get_objects(): + + for prefix in extra_prefixes: + if ( + name == f"{prefix}{reftarget}" + or f"{prefix}{name}" == reftarget + ): + return env.domains["cpp"].resolve_xref( + env, + docname, + app.builder, + node["reftype"], + name, + node, + contnode, + ) + + return None def setup(app): @@ -213,4 +270,4 @@ def setup(app): app.add_js_file( "https://docs.rapids.ai/assets/js/custom.js", loading_method="defer" ) - # app.connect("missing-reference", on_missing_reference) + app.connect("missing-reference", on_missing_reference) From 420035861f3b3c34d1fb7acd323fe20365b443dc Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 31 Oct 2023 17:39:47 -0700 Subject: [PATCH 20/21] Breathe doesn't seem to like having the function show up twice in the group --- include/rmm/cuda_stream_view.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/rmm/cuda_stream_view.hpp b/include/rmm/cuda_stream_view.hpp index fe07fa1b9..7809140fb 100644 --- a/include/rmm/cuda_stream_view.hpp +++ b/include/rmm/cuda_stream_view.hpp @@ -125,6 +125,9 @@ static const cuda_stream_view cuda_stream_per_thread{ cudaStreamPerThread // NOLINT(cppcoreguidelines-pro-type-cstyle-cast) }; +// Need to avoid putting is_per_thread_default and is_default into the group twice. +/** @} */ // end of group + [[nodiscard]] inline bool cuda_stream_view::is_per_thread_default() const noexcept { #ifdef CUDA_API_PER_THREAD_DEFAULT_STREAM @@ -134,9 +137,6 @@ static const cuda_stream_view cuda_stream_per_thread{ #endif } -/** - * @brief Return true if the wrapped stream is explicitly the CUDA legacy default stream. - */ [[nodiscard]] inline bool cuda_stream_view::is_default() const noexcept { #ifdef CUDA_API_PER_THREAD_DEFAULT_STREAM @@ -146,6 +146,11 @@ static const cuda_stream_view cuda_stream_per_thread{ #endif } +/** + * @addtogroup cuda_streams + * @{ + */ + /** * @brief Equality comparison operator for streams * From 9e81c7303816ef53419e8754e9dc5416044eea56 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 31 Oct 2023 17:41:21 -0700 Subject: [PATCH 21/21] Go back to warnings as errors --- python/docs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/docs/Makefile b/python/docs/Makefile index 68e58b474..72d1dcd85 100644 --- a/python/docs/Makefile +++ b/python/docs/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line, and also # from the environment for the first two. -SPHINXOPTS = -n -v +SPHINXOPTS = -n -v -W --keep-going SPHINXBUILD ?= sphinx-build SOURCEDIR = . BUILDDIR = _build