A prepared, one-stream shared-memory WaveNet session. More...
#include <gpu_wavenet.hpp>
Classes | |
| struct | Config |
| struct | CreateResult |
Public Member Functions | |
| ~GpuWaveNetSession () | |
| GpuWaveNetSession (const GpuWaveNetSession &)=delete | |
| GpuWaveNetSession & | operator= (const GpuWaveNetSession &)=delete |
| bool | prepared () const noexcept |
| std::uint32_t | block_size () const noexcept |
| GpuWaveNetCompletionPolicy | completion_policy () const noexcept |
| Returns the requested policy. | |
| bool | completion_policy_supported () const noexcept |
| True when the provider accepted the requested policy without fallback. | |
| bool | submit_block (std::span< const float > input, std::uint64_t sequence, std::uint64_t deadline_ns=0) noexcept |
| Copies one mono block into a persistent shared slot and submits it to the authenticated provider. | |
| std::size_t | service (std::uint64_t now_ns) noexcept |
| Services already-submitted provider work without waiting for a future completion. | |
| std::size_t | service_until (std::uint64_t deadline_ns) noexcept |
| Services completions until the supplied steady-clock deadline. | |
| std::optional< GpuWaveNetBlockResult > | receive (std::span< float > output) noexcept |
| Copies one completed block into output and releases its shared slot. | |
| bool | release () noexcept |
| Host/quiescent-only release. | |
| bool | release_bounded (std::uint64_t budget_ns) noexcept |
| release() that bounds the provider's physical drain to budget_ns. | |
| bool | device_lost () const noexcept |
| True once the provider has observed loss of its device. | |
| std::uint64_t | outstanding_blocks () const noexcept |
| Blocks accepted by submit_block() whose result receive() has not yet returned, whether delivered or failed. | |
Static Public Member Functions | |
| static CreateResult | create (const Config &config) noexcept |
Friends | |
| struct | detail::GpuWaveNetSessionAccess |
| struct | detail::GpuWaveNetSessionTestAccess |
| struct | detail::GpuWaveNetSessionPoolAccess |
A prepared, one-stream shared-memory WaveNet session.
The session owns the provider, resident model resources, causal history, and fixed shared input/output slots. Callers provide only model metadata, weights, and audio spans; Dawn, Metal, queue, and slot handles remain private. submit_block() and service() are serialized non-realtime operations in this first SDK seam. A caller that needs a realtime bridge should connect this session to its own preallocated callback/fallback machinery rather than invoking provider work from the audio callback.
The first public session is intentionally limited to one causal stream (descriptor.stream_instances == 1). Submitted sequence numbers must be contiguous because they advance the persistent WaveNet history.
| pulp::gpu_audio::GpuWaveNetSession::~GpuWaveNetSession | ( | ) |
|
delete |
|
noexcept |
|
noexcept |
Returns the requested policy.
It remains observable even when the backend cannot provide that policy and falls back to its default.
|
noexcept |
True when the provider accepted the requested policy without fallback.
|
staticnoexcept |
|
noexcept |
True once the provider has observed loss of its device.
A lost session never delivers again; its owner must release it and create a new one. Serialized non-realtime diagnostic, like service().
|
delete |
|
noexcept |
Blocks accepted by submit_block() whose result receive() has not yet returned, whether delivered or failed.
|
noexcept |
|
noexcept |
Copies one completed block into output and releases its shared slot.
A failed provider completion returns a result with no output written.
|
noexcept |
Host/quiescent-only release.
A false result retains the session so the caller can retry the provider's physical drain barrier.
|
noexcept |
release() that bounds the provider's physical drain to budget_ns.
On expiry the provider abandons to quarantine: its device is destroyed, its shared memory stays owned, and this returns false. The session keeps ownership on false; the caller must still call release() later to complete the disposal. Host/quiescent or serialized worker.
|
noexcept |
Services already-submitted provider work without waiting for a future completion.
Returns the number of newly visible terminal records.
|
noexcept |
Services completions until the supplied steady-clock deadline.
This is serialized non-realtime work; never call it from an audio callback.
|
noexcept |
Copies one mono block into a persistent shared slot and submits it to the authenticated provider.
deadline_ns == 0 disables late marking.
|
friend |
|
friend |
|
friend |