Skip to content

Commit 5e72a9a

Browse files
lucbvyasahi-hpc
andauthored
docs: adding API documentation template (kokkos#2579)
* docs: adding API documentation template This should make it easier for anyone to start a new documentation file for new or undocumented functions. Signed-off-by: Luc Berger-Vergiat <[email protected]> * Update docs/api_template.rst Co-authored-by: yasahi-hpc <[email protected]> * Update docs/api_template.rst Co-authored-by: yasahi-hpc <[email protected]> * Update docs/api_template.rst Co-authored-by: yasahi-hpc <[email protected]> * Finishing to update according to feedback Disagreeing on the include semantic but I want this to merge so switching over as it is not a big issue overall. Signed-off-by: Luc Berger-Vergiat <[email protected]> --------- Signed-off-by: Luc Berger-Vergiat <[email protected]> Co-authored-by: yasahi-hpc <[email protected]>
1 parent 3cfcb4b commit 5e72a9a

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

docs/api_template.rst

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
namespace::function
2+
###################
3+
4+
Defined in header: :code:`<namespace>_<function>.hpp`
5+
6+
.. code:: c++
7+
8+
template <class execution_space, class input_type, class output_type>
9+
void function(const execution_space& space, const input_type& in, const output_type& out);
10+
11+
template <class input_type, class output_type>
12+
void function(const input_type& in, const output_type& out);
13+
14+
Explain what the <function> does and what each overall specificities are.
15+
16+
Parameters
17+
==========
18+
19+
:space: execution space instance
20+
21+
:in: input
22+
23+
:out: output
24+
25+
Type Requirements
26+
-----------------
27+
28+
- `execution_space` must be a Kokkos `execution space <https://kokkos.org/kokkos-core-wiki/API/core/execution_spaces.html>`_
29+
30+
- `input_type` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_
31+
32+
- ``Kokkos::SpaceAccessibility<execution_space, typename input_type::memory_space>::accessible``
33+
- ...
34+
35+
- `output_type` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ that satisfies
36+
37+
- ``Kokkos::SpaceAccessibility<execution_space, typename output_type::memory_space>::accessible``
38+
- ...
39+
40+
Example
41+
=======
42+
43+
.. code:: cpp
44+
45+
#include <Kokkos_Core.hpp>
46+
#include <Namespace_function.hpp>
47+
48+
using Scalar = default_scalar;
49+
using Ordinal = default_lno_t;
50+
using Offset = default_size_type;
51+
using Layout = default_layout;
52+
53+
int main(int argc, char* argv[]) {
54+
Kokkos::initialize(argc, argv);
55+
{
56+
...
57+
}
58+
Kokkos::finalize();
59+
return 0;
60+
}

0 commit comments

Comments
 (0)