Skip to content

Commit

Permalink
Merge pull request #46 from lanl/bkk_static_vector
Browse files Browse the repository at this point in the history
Transfer static vector from Singe
  • Loading branch information
Yurlungur authored Oct 15, 2024
2 parents 7157df1 + d4f072a commit 707ad53
Show file tree
Hide file tree
Showing 6 changed files with 1,001 additions and 1 deletion.
11 changes: 11 additions & 0 deletions doc/sphinx/src/using.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,14 @@ not yet ``constexpr``, so even with the "relaxed ``constexpr``" compilation mode
not feature-complete on GPUs. This will change when those member functions become ``constexpr`` in
C++20.

static_vector.hpp
^^^^^^^^^^^^^^^^^

``PortsOfCall::static_vector`` is a GPU-compatible data structure that provides a
``std::vector``-like interface, but uses ``std::array``-like backing storage. That means that the
size is variable, but the capacity is fixed at runtime. This allows the creation of a data
structure of non-default-constructible objects like with a ``std::vector``. This also allows the
type to be self-contained: no pointers, so a ``PortsOfCall::static_vector`` can be memcopied
between CPU and GPU. It is related to a `proposed data structure
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0843r8.html`_ that may be included in a
future C++ standard.
Loading

0 comments on commit 707ad53

Please sign in to comment.