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..67b150dcf --- /dev/null +++ b/docs/source/API/core/c_style_memory_management/free.rst @@ -0,0 +1,32 @@ +``kokkos_free`` +=============== + +.. role:: cppkokkos(code) + :language: cppkokkos + +Defined in header ```` + +.. _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. + +Description +----------- + +.. cppkokkos:function:: template void kokkos_free(void* ptr); + + :tparam MemorySpace: Controls the storage location. If omitted the memory space of the default execution space is used (i.e. ``Kokkos::DefaultExecutionSpace::memory_space``). + + :param ptr: The pointer to the memory to deallocate on the specified memory space. + + :returns: (none) + + :throws: Throws ``std::runtime_error`` on failure to deallocate.