DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::deviceViewVector< TView, B > Struct Template Reference

Contiguous host_device_vector of non-owning views, mirrored on a device. More...

#include <DeviceStorageHelper.hpp>

Collaboration diagram for DNDS::deviceViewVector< TView, B >:
[legend]

Public Member Functions

template<class TGetView >
 deviceViewVector (int32_t nViews, TGetView &&GetView)
 Build nViews views via GetView(i) and transfer them to device.
 
auto deviceView ()
 Device-side span over the stored views.
 

Public Attributes

host_device_vector< TView > views
 Vector of per-entry views, with a device mirror.
 

Detailed Description

template<class TView, DeviceBackend B>
struct DNDS::deviceViewVector< TView, B >

Contiguous host_device_vector of non-owning views, mirrored on a device.

Many CUDA kernels need "a vector of array views" – e.g., the per-cell adjacency views for a mesh, bundled into one flat array on the GPU. This helper takes a factory callback that produces the i-th view, stores all views in a host_device_vector, and pushes the result to the chosen backend in one call.

Template Parameters
TViewView type to store (must be trivially copyable).
BTarget device backend.

Definition at line 25 of file DeviceStorageHelper.hpp.

Constructor & Destructor Documentation

◆ deviceViewVector()

template<class TView , DeviceBackend B>
template<class TGetView >
DNDS::deviceViewVector< TView, B >::deviceViewVector ( int32_t  nViews,
TGetView &&  GetView 
)
inline

Build nViews views via GetView(i) and transfer them to device.

Definition at line 34 of file DeviceStorageHelper.hpp.

Member Function Documentation

◆ deviceView()

template<class TView , DeviceBackend B>
auto DNDS::deviceViewVector< TView, B >::deviceView ( )
inline

Device-side span over the stored views.

Definition at line 43 of file DeviceStorageHelper.hpp.

Member Data Documentation

◆ views

template<class TView , DeviceBackend B>
host_device_vector<TView> DNDS::deviceViewVector< TView, B >::views

Vector of per-entry views, with a device mirror.

Definition at line 30 of file DeviceStorageHelper.hpp.


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