ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ryujin::SelectView< dim, Number, MemorySpace, Object > Class Template Reference

#include <source/gpu.h>

Public Member Functions

 SelectView (const Object &object)
 
template<typename T >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE const auto & view () const
 

Detailed Description

template<int dim, typename Number, typename MemorySpace, typename Object>
class ryujin::SelectView< dim, Number, MemorySpace, Object >

A small helper class that stores a scalar and a vectorized view of an equation object object (such as the hyperbolic system, the indicator, the limiter, or the wave speed estimator) and hands out the appropriate one depending on the number type T that the loop body operates on.

This is meant to be used in conjunction with loop(): the loop body receives a "sentinel" of the number type it operates on and simply queries the matching view:

const auto views = make_select_view<dim, Number, MemorySpace>(object);
const auto body = [=](auto sentinel, unsigned int i) {
using T = decltype(sentinel);
const auto view = views.template view<T>();
// ...
};
DEAL_II_HOST_DEVICE_ALWAYS_INLINE const auto & view() const
Definition gpu.h:680
Note
This class is meant to be captured by value in computation loops with access to either the host or device memory space. Both views are created on the host in the constructor, the view() access operator is host and device callable.

Definition at line 640 of file gpu.h.

Constructor & Destructor Documentation

◆ SelectView()

template<int dim, typename Number , typename MemorySpace , typename Object >
ryujin::SelectView< dim, Number, MemorySpace, Object >::SelectView ( const Object &  object)
inline

Definition at line 669 of file gpu.h.

Member Function Documentation

◆ view()

template<int dim, typename Number , typename MemorySpace , typename Object >
template<typename T >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE const auto & ryujin::SelectView< dim, Number, MemorySpace, Object >::view ( ) const
inline

Return the scalar view if T is a scalar number type, and the vectorized view if T is a VectorizedArray.

Definition at line 680 of file gpu.h.


The documentation for this class was generated from the following file: