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

Host-owned cache of prepared GPU-audio providers that survive a node's release, so the next prepare() of a node with the same program skips device, pipeline and resident-weight creation. More...

#include <gpu_audio_provider_pool.hpp>

Classes

struct  Config
struct  Stats

Public Member Functions

 GpuAudioProviderPool ()
 GpuAudioProviderPool (const Config &config)
 ~GpuAudioProviderPool ()
 Destroys every warm provider.
 GpuAudioProviderPool (const GpuAudioProviderPool &)=delete
GpuAudioProviderPool & operator= (const GpuAudioProviderPool &)=delete
 GpuAudioProviderPool (GpuAudioProviderPool &&)=delete
GpuAudioProviderPool & operator= (GpuAudioProviderPool &&)=delete
void evict_expired () noexcept
 Destroys providers held longer than keep_warm_ns.
void clear () noexcept
 Destroys every warm provider.
Stats stats () const noexcept

Friends

class GpuWaveNetRealtimeNode
struct detail::GpuAudioProviderPoolTestAccess

Detailed Description

Host-owned cache of prepared GPU-audio providers that survive a node's release, so the next prepare() of a node with the same program skips device, pipeline and resident-weight creation.

A node opts in through its config (for example GpuWaveNetRealtimeNode::Config::provider_pool). On release the node drains its provider and, when the provider can resume, returns it here instead of destroying it; a later prepare() with the same program key (model shape and weights, block size, slots and completion policy) borrows it back. A borrowed provider's causal history is stale, so the node re-fills it before delivering. Entries older than keep_warm_ns are destroyed by evict_expired(), which the host calls from a timer or any non-realtime thread. The audio callback never touches the pool.

Only a provider that drained cleanly, can resume, and has not lost its device is kept; anything else is released instead. A provider is lent only to a request for the same program on the same provider kind and revision. At capacity the least recently returned provider is evicted.

Thread safety: every member is safe from any host thread, and the transport's non-realtime worker takes the same mutex when an automatic re-acquire borrows a provider. The pool must outlive every node configured with it.

Constructor & Destructor Documentation

◆ GpuAudioProviderPool() [1/4]

pulp::gpu_audio::GpuAudioProviderPool::GpuAudioProviderPool ( )

◆ GpuAudioProviderPool() [2/4]

pulp::gpu_audio::GpuAudioProviderPool::GpuAudioProviderPool ( const Config & config)
explicit

◆ ~GpuAudioProviderPool()

pulp::gpu_audio::GpuAudioProviderPool::~GpuAudioProviderPool ( )

Destroys every warm provider.

◆ GpuAudioProviderPool() [3/4]

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

◆ GpuAudioProviderPool() [4/4]

pulp::gpu_audio::GpuAudioProviderPool::GpuAudioProviderPool ( GpuAudioProviderPool && )
delete

Member Function Documentation

◆ clear()

void pulp::gpu_audio::GpuAudioProviderPool::clear ( )
noexcept

Destroys every warm provider.

◆ evict_expired()

void pulp::gpu_audio::GpuAudioProviderPool::evict_expired ( )
noexcept

Destroys providers held longer than keep_warm_ns.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

GpuAudioProviderPool & pulp::gpu_audio::GpuAudioProviderPool::operator= ( GpuAudioProviderPool && )
delete

◆ stats()

Stats pulp::gpu_audio::GpuAudioProviderPool::stats ( ) const
noexcept

◆ detail::GpuAudioProviderPoolTestAccess

friend struct detail::GpuAudioProviderPoolTestAccess
friend

◆ GpuWaveNetRealtimeNode

friend class GpuWaveNetRealtimeNode
friend

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