|
| | TicketIssuer ()=default |
| | Default constructor w/ delayed initialization. Call initialize(device_active) to set up.
|
| | TicketIssuer (const TicketIssuer &)=default |
| TicketIssuer & | operator= (const TicketIssuer &)=default |
| | TicketIssuer (TicketIssuer &&)=default |
| TicketIssuer & | operator= (TicketIssuer &&)=default |
| | ~TicketIssuer ()=default |
| | TicketIssuer (bool activate_device) |
| | Construct a TicketIssuer with the specified initial active memory space.
|
| void | initialize (bool activate_device=true) |
| | Initialize a default-constructed TicketIssuer. Cannot be called on an already initialized TicketIssuer, will throw (in debug mode).
|
| void | activate_host () |
| | Sets the active memory space to host and synchronizes ticket state if needed. While active, calling claim or count from device will result in a throw.
|
| void | activate_device () |
| | Sets the active memory space to device and synchronizes ticket state if needed. While active, calling claim or count from host will result in a throw.
|
| void | sync () |
| | Synchronize ticket state between active and inactive memory spaces.
|
| void | reset () |
| size_t | finalize_count () |
| | Finalize the count of issued tickets.
|
| TicketRange | claim (size_t n) const |
| | Claim N contiguous tickets atomically. Returns a TicketRange representing the claimed tickets. If you claim more tickets than are available, an exception is thrown (in debug mode).
|
| size_t | claim () const |
| | Claim a single ticket atomically. Returns the claimed ticket ID. If you claim more tickets than are available, an exception is thrown (in debug mode).
|
| size_t | count () const |
| | Get the current count of issued tickets atomically.
|
template<typename NgpMemSpace>
class mundy::mesh::TicketIssuer< NgpMemSpace >
- Note
- This class uses dual-view-like semantics to manage ticket state. The NgpMemSpace is the device memory space but the host can also claim tickets when activated. Importantly, only one memory space can claim tickets at a time and changing the active space acts as a phase boundary that synchronizes ticket state between host and device.