|
Celeritas 0.7-develop+a3e14d7
|
#include <numeric>#include <utility>#include <vector>#include "Collection.hh"#include "CollectionBuilder.hh"#include "Copier.hh"#include "Filler.hh"Functions | |
| template<class T , Ownership W, MemSpace M, class I > | |
| void | celeritas::fill (T &&value, Collection< T, W, M, I > *col) |
| Fill the collection with the given value. | |
| template<class T , Ownership W, MemSpace M, class I > | |
| void | celeritas::fill_sequence (Collection< T, W, M, I > *dst, StreamId stream) |
| Fill the collection with sequentially increasing values starting from zero. | |
| template<class T , MemSpace M, class I > | |
| void | celeritas::reserve (Collection< T, Ownership::value, M, I > *col, size_type num_used, size_type capacity, StreamId stream) |
| Reallocate the collection with a larger capacity. | |
| template<class T , Ownership W, MemSpace M, class I , std::size_t E> | |
| void | celeritas::copy_to_host (Collection< T, W, M, I > const &src, Span< T, E > dst, StreamId sid={}) |
| Copy from the given collection to host. | |
| template<class T , Ownership W, MemSpace M, class I > | |
| auto | celeritas::copy_to_host (Collection< T, W, M, I > const &src) |
| Create a new host collection from the given collection. | |
| auto celeritas::copy_to_host | ( | Collection< T, W, M, I > const & | src | ) |
Create a new host collection from the given collection.
This is useful for debugging.
| void celeritas::fill | ( | T && | value, |
| Collection< T, W, M, I > * | col | ||
| ) |
Fill the collection with the given value.
This should only be used during initialization when stream synchronization is OK. Use the Filler directly during runtime since it supports streams.
| void celeritas::fill_sequence | ( | Collection< T, W, M, I > * | dst, |
| StreamId | stream | ||
| ) |
Fill the collection with sequentially increasing values starting from zero.
| void celeritas::reserve | ( | Collection< T, Ownership::value, M, I > * | col, |
| size_type | num_used, | ||
| size_type | capacity, | ||
| StreamId | stream | ||
| ) |
Reallocate the collection with a larger capacity.
The first num_used elements are copied into the new storage. On device, the allocation, copy, and release of the old storage are all ordered on the given stream, so the stream must order this after any kernels using the collection.