Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding documentation for Kokkos::Array #615

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

nliber
Copy link
Contributor

@nliber nliber commented Jan 22, 2025

Fixes #430.

nliber and others added 6 commits January 15, 2025 18:54
Removed third template parameter and simplified the other descriptions

Left to do:
Tuple protocol (structured bindings)
Deduction guide
Mention deprecated interface (enough detail if folks see the extra
template parameter; not enough to use it)
@@ -7,6 +7,8 @@ API: Containers

* - Container
- Description
* - `Array <containers/Array.html>`__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this more like View ... do we really want this to be in containers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In C++ it is considered a container, but I don't have a strong feeling on it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here Containers refers to the Kokkos subpackage, that is, everything that is defined in the containers/src/ directory. Array belongs to Core so it is not the right place.
The API reference for Core is a bit messy at the moment so I would either put it in Utilities next to Complex or in the STL Compat section. We can put organize things better in follow ups.

Comment on lines +1 to +16
..
Use the following convention for headings:

# with overline, for parts (collections of chapters)

* with overline, for chapters

= for sections

- for subsections

^ for subsubsections

" for paragraphs

..
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean to push the comment stuff?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No; I'll fix it.

Deduction Guides
----------------

.. cppkokkos:function:: template<class T, class... U> Array(T, U...) -> Array<T, 1 + sizeof...(U)>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this can be highlighted in an example


.. cppkokkos:function:: template<class T, size_t N> constexpr kokkos_swap(Array<T, N>& l, Array<T, N>& r) noexcept(N == 0 || is_nothrow_swappable_V<T>)

:return: If ``T`` is swappable or ``N == 0``, each of the elements in `l` and `r` are swapped via ``kokkos_swap``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really a return ... but might be to render it neatly in sphinx

..
High-level, human-language summary of what the thing does, and if possible, brief statement about why it exists (2 - 3 sentences, max);

Description
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have the old version below: maybe add in which version this one was added?

Cleaned up examples a little
removed line numbers from examples (gets in the way of copy/paste)
Fixed to_array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kokkos::Array is fully missing in the wiki
3 participants