![]() |
ryujin 2.1.1 revision b04fb4aba7bd97ddfa5994a6b4b6e8586eb15db2
|
Classes | |
| class | ryujin::MirroredStorage< Derived > |
| class | ryujin::Mirrored< T > |
| class | ryujin::SelectView< dim, Number, MemorySpace, Object > |
Typedefs | |
| using | ryujin::selected_memory_space_t = std::conditional_t< have_separate_memory_spaces, dealii::MemorySpace::Default, dealii::MemorySpace::Host > |
| template<typename MemorySpace > | |
| using | ryujin::other_space_t = std::conditional_t< std::is_same_v< MemorySpace, dealii::MemorySpace::Host >, dealii::MemorySpace::Default, dealii::MemorySpace::Host > |
Functions | |
| constexpr bool | ryujin::performs_implicit_transfers (const TransferPolicy policy) |
| template<int dim, typename Number , typename MemorySpace , typename Object > | |
| auto | ryujin::make_select_view (const Object &object) |
Variables | |
| constexpr bool | ryujin::have_separate_memory_spaces |
| constexpr unsigned int | ryujin::warp_size |
This module contains classes and functions used for managing data mirrored between the host and default (device) memory spaces: the MirroredStorage base class implementing a unified interface for querying residency and transferring data between memory spaces, the TransferPolicy describing whether such transfers happen explicitly or implicitly, and the Mirrored convenience wrapper that maintains a single "POD style" object on both memory spaces.
| using ryujin::selected_memory_space_t = typedef std::conditional_t<have_separate_memory_spaces, dealii::MemorySpace::Default, dealii::MemorySpace::Host> |
The selected memory space for the compute kernels.
| using ryujin::other_space_t = typedef std::conditional_t<std::is_same_v<MemorySpace, dealii::MemorySpace::Host>, dealii::MemorySpace::Default, dealii::MemorySpace::Host> |
|
strong |
A policy describing how host/device memory transfers are performed when accessing a MirroredStorage object via view().
| Enumerator | |
|---|---|
| explicit_transfers | view<MemorySpace>() asserts that the selected memory space is resident; all transfers must be requested manually via copy_to_memory_space() and move_to_memory_space(). |
| implicit_transfers | Requesting a read-only view triggers an implicit copy_to_memory_space() if the selected memory space is not resident (both memory spaces remain resident afterwards). Requesting a writable view triggers an implicit move_to_memory_space(): the data is copied over if necessary and the other memory space is deallocated and marked non-resident. Writable access invalidates the stale mirror. |
| implicit_transfers_host_resident | The same policy as implicit_transfers, but with the host memory space "pinned": operations that would deallocate the host storage, i.e., move_to_memory_space<dealii::MemorySpace::Default>() and requesting a writable view on the default memory space, are disallowed. The data thus always remains resident on the host memory space and pointers (and views) into the host storage remain valid. If the host and default memory spaces coincide the restriction is lifted: there is only a single allocation that no transfer can deallocate. |
| implicit_transfers_default_resident | The converse of implicit_transfers_host_resident: the default (device) memory space is pinned and move_to_memory_space<dealii::MemorySpace::Host>() as well as requesting a writable view on the host memory space are disallowed. If the host and default memory spaces coincide the restriction is lifted. |
|
inlineconstexpr |
Return true if the given transfer policy performs implicit memory transfers when a view is requested, i.e., for all implicit_transfers* policies.
Definition at line 139 of file gpu.h.
References ryujin::implicit_transfers, ryujin::implicit_transfers_default_resident, and ryujin::implicit_transfers_host_resident.
| auto ryujin::make_select_view | ( | const Object & | object | ) |
Create a SelectView object, see the documentation of SelectView.
|
inlineconstexpr |
A constexpr boolean that is true if the host and default (device) memory spaces are distinct. If ryujin is configured without device support then dealii::MemorySpace::Default coincides with dealii::MemorySpace::Host and no memory transfers are necessary.
Definition at line 29 of file gpu.h.
Referenced by ryujin::copy_to_memory_space(), ryujin::copy_to_memory_space(), ryujin::EulerAEOS::HyperbolicSystem::fill_precomputed_values(), ryujin::EulerBarotropic::HyperbolicSystem::fill_precomputed_values(), ryujin::ScalarConservation::HyperbolicSystem::fill_precomputed_values(), ryujin::move_to_memory_space(), ryujin::move_to_memory_space(), ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::prepare(), ryujin::HyperbolicModule< ryujin::ScalarConservation::HyperbolicDescription, dim, double >::step(), and ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::step().
|
inlineconstexpr |
The "warp size": the number of consecutive row indices of the internal index range [0, n_internal_dofs) that a SparsityPattern bins together. All rows of a warp have the same stencil size and their matrix entries are stored contiguously (array-of-struct-of-array), see the documentation of the SparsityPattern class.
Definition at line 46 of file gpu.h.
Referenced by ryujin::DoFRenumbering::export_indices_first(), ryujin::DoFRenumbering::inconsistent_strides_last(), and ryujin::DoFRenumbering::internal_range().