Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::gpu_audio::GpuWaveNetSession Class Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~GpuWaveNetSession()

pulp::gpu_audio::GpuWaveNetSession::~GpuWaveNetSession ( )

◆ GpuWaveNetSession()

pulp::gpu_audio::GpuWaveNetSession::GpuWaveNetSession ( const GpuWaveNetSession & )
delete

Member Function Documentation

◆ block_size()

std::uint32_t pulp::gpu_audio::GpuWaveNetSession::block_size ( ) const
noexcept

◆ completion_policy()

GpuWaveNetCompletionPolicy pulp::gpu_audio::GpuWaveNetSession::completion_policy ( ) const
noexcept

Returns the requested policy.

It remains observable even when the backend cannot provide that policy and falls back to its default.

◆ completion_policy_supported()

bool pulp::gpu_audio::GpuWaveNetSession::completion_policy_supported ( ) const
noexcept

True when the provider accepted the requested policy without fallback.

◆ create()

CreateResult pulp::gpu_audio::GpuWaveNetSession::create ( const Config & config)
staticnoexcept

◆ device_lost()

bool pulp::gpu_audio::GpuWaveNetSession::device_lost ( ) const
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().

◆ operator=()

GpuWaveNetSession & pulp::gpu_audio::GpuWaveNetSession::operator= ( const GpuWaveNetSession & )
delete

◆ outstanding_blocks()

std::uint64_t pulp::gpu_audio::GpuWaveNetSession::outstanding_blocks ( ) const
noexcept

Blocks accepted by submit_block() whose result receive() has not yet returned, whether delivered or failed.

◆ prepared()

bool pulp::gpu_audio::GpuWaveNetSession::prepared ( ) const
noexcept

◆ receive()

std::optional< GpuWaveNetBlockResult > pulp::gpu_audio::GpuWaveNetSession::receive ( std::span< float > output)
noexcept

Copies one completed block into output and releases its shared slot.

A failed provider completion returns a result with no output written.

◆ release()

bool pulp::gpu_audio::GpuWaveNetSession::release ( )
noexcept

Host/quiescent-only release.

A false result retains the session so the caller can retry the provider's physical drain barrier.

◆ release_bounded()

bool pulp::gpu_audio::GpuWaveNetSession::release_bounded ( std::uint64_t budget_ns)
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.

◆ service()

std::size_t pulp::gpu_audio::GpuWaveNetSession::service ( std::uint64_t now_ns)
noexcept

Services already-submitted provider work without waiting for a future completion.

Returns the number of newly visible terminal records.

◆ service_until()

std::size_t pulp::gpu_audio::GpuWaveNetSession::service_until ( std::uint64_t deadline_ns)
noexcept

Services completions until the supplied steady-clock deadline.

This is serialized non-realtime work; never call it from an audio callback.

◆ submit_block()

bool pulp::gpu_audio::GpuWaveNetSession::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.

deadline_ns == 0 disables late marking.

◆ detail::GpuWaveNetSessionAccess

friend struct detail::GpuWaveNetSessionAccess
friend

◆ detail::GpuWaveNetSessionPoolAccess

friend struct detail::GpuWaveNetSessionPoolAccess
friend

◆ detail::GpuWaveNetSessionTestAccess

friend struct detail::GpuWaveNetSessionTestAccess
friend

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/gpu_audio/include/pulp/gpu_audio/gpu_wavenet.hpp