Celeritas 0.7.0-33+develop.9c828abdd
Loading...
Searching...
No Matches
Classes | Functions
TrackInitData.hh File Reference
#include <utility>
#include "corecel/Types.hh"
#include "corecel/cont/Range.hh"
#include "corecel/data/Collection.hh"
#include "corecel/data/CollectionAlgorithms.hh"
#include "corecel/data/CollectionBuilder.hh"
#include "corecel/data/Copier.hh"
#include "corecel/random/data/RngData.hh"
#include "corecel/sys/Device.hh"
#include "corecel/sys/ThreadId.hh"
#include "geocel/Types.hh"
#include "celeritas/Types.hh"
#include "celeritas/phys/ParticleData.hh"
#include "celeritas/phys/Primary.hh"
#include "CoreStateCounters.hh"
#include "SimData.hh"

Classes

struct  celeritas::TrackInitParamsData< W, M >
 Persistent data for track initialization. More...
 
struct  celeritas::TrackInitializer
 Lightweight version of a track used to initialize new tracks from primaries or secondaries. More...
 
struct  celeritas::TrackInitStateData< W, M >
 Storage for dynamic data used to initialize new tracks. More...
 

Functions

template<MemSpace M>
void celeritas::resize (TrackInitStateData< Ownership::value, M > *data, HostCRef< TrackInitParamsData > const &params, StreamId stream, size_type size)
 Resize and initialize track initializer data.
 
template<MemSpace M>
void celeritas::reserve_initializers (TrackInitStateData< Ownership::value, M > *data, size_type num_used, size_type capacity, StreamId stream)
 Reallocate the track initializer buffer with a larger capacity.
 

Function Documentation

◆ reserve_initializers()

template<MemSpace M>
void celeritas::reserve_initializers ( TrackInitStateData< Ownership::value, M > *  data,
size_type  num_used,
size_type  capacity,
StreamId  stream 
)

Reallocate the track initializer buffer with a larger capacity.

The first num_used initializers are copied into the new buffer. On device, the allocation, copy, and release of the old buffer are all ordered on the given stream, so this must be called between steps (or the stream must otherwise order it after any kernels using the initializers). Any references to the state data must be updated afterward.

◆ resize()

template<MemSpace M>
void celeritas::resize ( TrackInitStateData< Ownership::value, M > *  data,
HostCRef< TrackInitParamsData > const &  params,
StreamId  stream,
size_type  size 
)

Resize and initialize track initializer data.

Here size is the number of track states, and the "capacity" is the initial number of track initializers (inactive/pending tracks) that we can hold.

Note
It's likely that for GPU runs, the capacity should be greater than the size, but that might not be the case universally, so it is not asserted.