Celeritas
0.5.0-86+4a8eea4
|
Helper functions for memspace-specific references. More...
Functions | |
template<template< Ownership, MemSpace > class S, MemSpace M> | |
S< Ownership::reference, M > | celeritas::make_ref (S< Ownership::value, M > &states) |
Construct a reference object pointing to state data. More... | |
template<template< Ownership, MemSpace > class P, MemSpace M> | |
P< Ownership::const_reference, M > | celeritas::make_ref (P< Ownership::value, M > const ¶ms) |
Construct a reference object pointing to params data. | |
template<template< Ownership, MemSpace > class P, MemSpace M> | |
decltype(auto) | celeritas::make_const_ref (P< Ownership::value, M > const ¶ms) |
Construct a const reference object pointing to params data. | |
template<MemSpace M, class T > | |
decltype(auto) | celeritas::get_ref (T &&obj) |
Get a reference to memory-spaced data owned by a params/state object. More... | |
template<template< Ownership, MemSpace > class CG, Ownership W, MemSpace M> | |
auto | celeritas::make_host_val (CG< W, M > const &source) |
Copy an entire collection group to the host. More... | |
Helper functions for memspace-specific references.
decltype(auto) celeritas::get_ref | ( | T && | obj | ) |
Get a reference to memory-spaced data owned by a params/state object.
The object must have host_ref
and device_ref
accessors depending on the value of M
.
|
inline |
Copy an entire collection group to the host.
This is mostly useful for debugging and testing. It is not performant and should not be used as part of the stepping loop, since it is likely to perform many allocations.
|
inline |
Construct a reference object pointing to state data.
Since the "reference" type is a value whose scope must extend beyond all references to it, it's often necessary to create a "reference" instance from a "value" instance. Collection groups don't define templated copy constructors, so this function (and the others like it) provide a workaround.