Celeritas 0.6.0-rc.2.10+develop.de0a3a05
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::CollectionMirror< P > Class Template Referencefinal

Helper class for copying setup-time Collection groups to host and device. More...

#include <CollectionMirror.hh>

Inheritance diagram for celeritas::CollectionMirror< P >:
Inheritance graph
[legend]

Public Types

Type aliases
using HostValue = celeritas::HostVal< P >
 
using HostRef = celeritas::HostCRef< P >
 
using DeviceRef = celeritas::DeviceCRef< P >
 
- Public Types inherited from celeritas::ParamsDataInterface< P >
using HostRef = HostCRef< P >
 
using DeviceRef = DeviceCRef< P >
 

Public Member Functions

 CollectionMirror ()=default
 Default constructor leaves in an "unassigned" state.
 
 CollectionMirror (HostValue &&host)
 Construct with defaults.
 
 operator bool () const
 Whether the data is assigned.
 
HostRef consthost_ref () const final
 Access data on host.
 
DeviceRef constdevice_ref () const final
 Access data on device.
 
- Public Member Functions inherited from celeritas::ParamsDataInterface< P >
template<MemSpace M>
P< Ownership::const_reference, M > constref () const
 
template<MemSpace M>
P< Ownership::const_reference, M > constref () const
 Dispatch a "ref" call to host or device data.
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::ParamsDataInterface< P >
 CELER_DEFAULT_COPY_MOVE (ParamsDataInterface)
 

Detailed Description

template<template< Ownership, MemSpace > class P>
class celeritas::CollectionMirror< P >

Helper class for copying setup-time Collection groups to host and device.

This should generally be an implementation detail of Params classes, which are constructed on host and must have the same data both on host and device. The template P must be a FooData class that:

On assignment, it will copy the data to the device if the GPU is enabled.

Example:

class FooParams
{
public:
using CollectionDeviceRef = FooData<Ownership::const_reference,
MemSpace::device>;
const CollectionDeviceRef& device_ref() const
{
return data_.device_ref();
}
private:
};
Helper class for copying setup-time Collection groups to host and device.
Definition CollectionMirror.hh:51

Member Function Documentation

◆ device_ref()

template<template< Ownership, MemSpace > class P>
DeviceRef const & celeritas::CollectionMirror< P >::device_ref ( ) const
inlinefinalvirtual

Access data on device.

Implements celeritas::ParamsDataInterface< P >.

◆ host_ref()

template<template< Ownership, MemSpace > class P>
HostRef const & celeritas::CollectionMirror< P >::host_ref ( ) const
inlinefinalvirtual

Access data on host.

Implements celeritas::ParamsDataInterface< P >.


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