From 13e1cb9c820a4186f675511319d57f4ae23ae59b Mon Sep 17 00:00:00 2001 From: antoinemeyer5 Date: Tue, 21 Feb 2023 20:01:13 +0100 Subject: [PATCH 1/3] kokkos#120: API/core/c_style_memory_management/free init transition --- .../core/c_style_memory_management/free.md | 28 ------------ .../core/c_style_memory_management/free.rst | 44 +++++++++++++++++++ 2 files changed, 44 insertions(+), 28 deletions(-) delete mode 100644 docs/source/API/core/c_style_memory_management/free.md create mode 100644 docs/source/API/core/c_style_memory_management/free.rst diff --git a/docs/source/API/core/c_style_memory_management/free.md b/docs/source/API/core/c_style_memory_management/free.md deleted file mode 100644 index 0159336ef..000000000 --- a/docs/source/API/core/c_style_memory_management/free.md +++ /dev/null @@ -1,28 +0,0 @@ -# `kokkos_free` - -Defined in header `` - -```c++ -template -void kokkos_free(void* ptr); -``` - -Deallocates the space previously allocated by [`Kokkos::kokkos_malloc()`](./malloc) or [`Kokkos::kokkos_realloc()`](./realloc) on the specified memory space `MemorySpace`. - -If `ptr` is a null pointer, the function does nothing. - -## Parameters - -`ptr`: The pointer to the memory to deallocate on the specified memory space. - -## Template parameters - -* `MemorySpace`: Controls the storage location. If omitted the memory space of the default execution space is used (i.e. `Kokkos::DefaultExecutionSpace::memory_space`). - -## Return value - -(none) -## Exceptions - -Throws `std::runtime_error` on failure to deallocate. - diff --git a/docs/source/API/core/c_style_memory_management/free.rst b/docs/source/API/core/c_style_memory_management/free.rst new file mode 100644 index 000000000..7600b2ce9 --- /dev/null +++ b/docs/source/API/core/c_style_memory_management/free.rst @@ -0,0 +1,44 @@ +``kokkos_free`` +=============== + +.. role:: cppkokkos(code) + :language: cppkokkos + +Defined in header ```` + +.. code-block:: cpp + + template + void kokkos_free(void* ptr); + +.. _Kokkos_kokkos_malloc: ./malloc.html + +.. |Kokkos_kokkos_malloc| replace:: ``Kokkos::kokkos_malloc()`` + +.. _Kokkos_kokkos_realloc: ./realloc.html + +.. |Kokkos_kokkos_realloc| replace:: ``Kokkos::kokkos_realloc()`` + +Deallocates the space previously allocated by |Kokkos_kokkos_malloc|_ or |Kokkos_kokkos_realloc|_ on the specified memory space ``MemorySpace``. + +If ``ptr`` is a null pointer, the function does nothing. + +Parameters +---------- + +``ptr``: The pointer to the memory to deallocate on the specified memory space. + +Template parameters +------------------- + +* ``MemorySpace``: Controls the storage location. If omitted the memory space of the default execution space is used (i.e. ``Kokkos::DefaultExecutionSpace::memory_space``). + +Return value +------------ + +(none) + +Exceptions +---------- + +Throws ``std::runtime_error`` on failure to deallocate. From 3da5d5e7fa8a19fc8beb6f61453d1314d784c096 Mon Sep 17 00:00:00 2001 From: antoinemeyer5 Date: Thu, 2 Mar 2023 11:19:39 +0100 Subject: [PATCH 2/3] kokkos#120: API/core/c_style_memory_management/free use cppkokkos + document things --- docs/source/API/core/c_style_memory_management/free.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/source/API/core/c_style_memory_management/free.rst b/docs/source/API/core/c_style_memory_management/free.rst index 7600b2ce9..869bc7d14 100644 --- a/docs/source/API/core/c_style_memory_management/free.rst +++ b/docs/source/API/core/c_style_memory_management/free.rst @@ -6,10 +6,7 @@ Defined in header ```` -.. code-block:: cpp - - template - void kokkos_free(void* ptr); +.. cppkokkos:function:: template void kokkos_free(void* ptr); .. _Kokkos_kokkos_malloc: ./malloc.html @@ -26,7 +23,9 @@ If ``ptr`` is a null pointer, the function does nothing. Parameters ---------- -``ptr``: The pointer to the memory to deallocate on the specified memory space. +.. cppkokkos:var:: void* ptr + +* The pointer to the memory to deallocate on the specified memory space. Template parameters ------------------- From c242bee21a9ff9a266233f3646bddd156dbad9ac Mon Sep 17 00:00:00 2001 From: antoinemeyer5 Date: Thu, 2 Mar 2023 16:00:12 +0100 Subject: [PATCH 3/3] kokkos#120: API/core/c_style_memory_management/free update syntax --- .../core/c_style_memory_management/free.rst | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/docs/source/API/core/c_style_memory_management/free.rst b/docs/source/API/core/c_style_memory_management/free.rst index 869bc7d14..67b150dcf 100644 --- a/docs/source/API/core/c_style_memory_management/free.rst +++ b/docs/source/API/core/c_style_memory_management/free.rst @@ -6,8 +6,6 @@ Defined in header ```` -.. cppkokkos:function:: template void kokkos_free(void* ptr); - .. _Kokkos_kokkos_malloc: ./malloc.html .. |Kokkos_kokkos_malloc| replace:: ``Kokkos::kokkos_malloc()`` @@ -20,24 +18,15 @@ Deallocates the space previously allocated by |Kokkos_kokkos_malloc|_ or |Kokkos If ``ptr`` is a null pointer, the function does nothing. -Parameters ----------- - -.. cppkokkos:var:: void* ptr +Description +----------- -* The pointer to the memory to deallocate on the specified memory space. - -Template parameters -------------------- - -* ``MemorySpace``: Controls the storage location. If omitted the memory space of the default execution space is used (i.e. ``Kokkos::DefaultExecutionSpace::memory_space``). +.. cppkokkos:function:: template void kokkos_free(void* ptr); -Return value ------------- + :tparam MemorySpace: Controls the storage location. If omitted the memory space of the default execution space is used (i.e. ``Kokkos::DefaultExecutionSpace::memory_space``). -(none) + :param ptr: The pointer to the memory to deallocate on the specified memory space. -Exceptions ----------- + :returns: (none) -Throws ``std::runtime_error`` on failure to deallocate. + :throws: Throws ``std::runtime_error`` on failure to deallocate.