Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
gpu_wavenet_realtime_node.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
8
9namespace pulp::gpu_audio {
11namespace detail {
12struct WaveNetRealtimeTestAccess;
13struct SharedIoCompletionNotifier;
14} // namespace detail
15
21 bool enabled = false;
22 bool capture_admissions = false;
24 std::uint32_t success_stride = 1;
25};
26#define PULP_GPU_WAVENET_TRACE_CONFIG_API 1
27
29 public:
30 struct Config {
32 std::uint32_t channels = 1;
33 std::uint32_t lead_blocks = 2;
34 std::uint32_t capacity = 8;
42 std::uint32_t max_inflight = 0;
43 std::uint32_t prewarm_blocks = 0;
47 std::uint64_t completion_service_wait_ns = 0;
59 std::uint32_t watchdog_blocks = 0;
65 };
66
73
76 bool prepare() override;
81 bool release() noexcept;
86 bool release_bounded(std::uint64_t budget_ns) noexcept override;
89 bool fenced() const noexcept;
93 std::uint64_t recovery_sequence() const noexcept;
98 std::uint64_t sanitized_input_samples() const noexcept;
101 GpuAudioStatus status_snapshot() const noexcept override;
102 bool bind_realtime_path(detail::RealtimeGpuNodeBinding& binding) noexcept override;
104 void process_block(const audio::BufferView<const float>&, audio::BufferView<float>&,
105 std::uint32_t) final;
106
107 private:
108 struct Impl;
109 std::unique_ptr<Impl> impl_;
111 bool authenticated_provider() const noexcept;
112 static std::uint8_t process(void*, const audio::BufferView<const float>&,
113 audio::BufferView<float>&, std::uint32_t, std::uint64_t, bool,
114 std::uint64_t) noexcept;
115 static std::uint32_t service(void*, std::uint64_t) noexcept;
116 static bool fence(void*) noexcept;
117 static void delivered(void*, std::uint64_t, std::uint8_t, std::uint64_t,
118 std::uint64_t) noexcept;
119 static std::uint64_t next_sequence(void*) noexcept;
120 static bool reprepare(void*, std::uint64_t) noexcept;
121 // Host only, while no service step runs: route every channel's provider
122 // completion events to the transport worker, or clear them.
123 static bool set_notifier(void*, detail::SharedIoCompletionNotifier) noexcept;
124 bool ready() const noexcept;
125};
126} // namespace pulp::gpu_audio
A unit of audio work the transport schedules onto a non-real-time worker.
Definition gpu_audio_node.hpp:92
Host-owned cache of prepared GPU-audio providers that survive a node's release, so the next prepare()...
Definition gpu_audio_provider_pool.hpp:40
void process_block(const audio::BufferView< const float > &, audio::BufferView< float > &, std::uint32_t) final
Not a legacy FIFO node. GpuAudioTransport rejects an unprepared instance.
GpuWaveNetRealtimeNode & operator=(const GpuWaveNetRealtimeNode &)=delete
std::uint64_t sanitized_input_samples() const noexcept
Non-finite input samples (NaN, +/-Inf) replaced with zero before GPU submission since prepare().
bool release() noexcept
Stop/join callback and worker first. False retains provider owners for retry.
~GpuWaveNetRealtimeNode() override
Stop/join callback and worker first; destruction releases and closes the trace generation as release(...
bool configure_trace(const GpuWaveNetTraceConfig &) noexcept
Host-only, before prepare.
bool prepare() override
Stop/join callback and worker first: prepare() begins with release().
bool bind_realtime_path(detail::RealtimeGpuNodeBinding &binding) noexcept override
Private transport hook, not for node authors: a node that the GPU audio transport drives through a st...
GpuAudioStatus status_snapshot() const noexcept override
Allocation-free provider-neutral lifecycle projection for hosts that own this stamped node directly.
GpuWaveNetRealtimeNode(const Config &)
Copies all descriptors, dilation arrays and weights. Host thread only.
bool release_bounded(std::uint64_t budget_ns) noexcept override
release() within budget_ns per call: a provider that cannot drain in time abandons to quarantine (its...
bool fenced() const noexcept
Diagnostic snapshot: true before preparation or after delivery was fenced.
GpuAudioRecoveryReason recovery_reason() const noexcept
First latched recovery cause, if the shared-I/O path has fenced.
GpuWaveNetRealtimeNode(const GpuWaveNetRealtimeNode &)=delete
GpuAudioNodeDescriptor descriptor() const override
friend struct detail::WaveNetRealtimeTestAccess
Definition gpu_wavenet_realtime_node.hpp:110
std::uint64_t recovery_sequence() const noexcept
Sequence associated with the first latched recovery cause, or UINT64_MAX.
Definition analyzer_provider.hpp:12
Definition gpu_audio_node.hpp:78
Definition flow_pans.hpp:19
GpuAudioRecoveryReason
First latched reason that a node entered recovery.
Definition gpu_audio_status.hpp:40
MissPolicy
What the transport does for a block when the GPU result is not ready in time (the worker fell behind,...
Definition gpu_audio_node.hpp:12
@ Silence
Output silence for the missed block (+ telemetry).
Definition gpu_audio_node.hpp:15
STL namespace.
Declared, fixed scheduling properties of a GPU audio node.
Definition gpu_audio_node.hpp:44
Versioned, allocation-free status shared by native hosts and UI adapters.
Definition gpu_audio_status.hpp:80
Definition gpu_wavenet_realtime_node.hpp:30
bool supports_cpu_fallback
Definition gpu_wavenet_realtime_node.hpp:49
std::uint32_t max_inflight
Maximum number of submitted blocks retained by the serialized worker before it waits for retirement.
Definition gpu_wavenet_realtime_node.hpp:42
std::uint32_t watchdog_blocks
Callback blocks that may pass with work in flight and no completion before the node latches GpuAudioR...
Definition gpu_wavenet_realtime_node.hpp:59
GpuAudioProviderPool * provider_pool
Optional host-owned pool that keeps this node's providers warm across release() and prepare().
Definition gpu_wavenet_realtime_node.hpp:64
std::uint32_t prewarm_blocks
Definition gpu_wavenet_realtime_node.hpp:43
std::uint64_t completion_service_wait_ns
Optional bounded completion-service budget for each non-RT worker pump.
Definition gpu_wavenet_realtime_node.hpp:47
std::uint32_t capacity
Definition gpu_wavenet_realtime_node.hpp:34
MissPolicy miss_policy
Definition gpu_wavenet_realtime_node.hpp:48
std::uint32_t lead_blocks
Definition gpu_wavenet_realtime_node.hpp:33
GpuWaveNetSession::Config session
Definition gpu_wavenet_realtime_node.hpp:31
std::uint32_t channels
Definition gpu_wavenet_realtime_node.hpp:32
Definition gpu_wavenet.hpp:123
Experimental stamped WaveNet bridge.
Definition gpu_wavenet_realtime_node.hpp:20
std::uint32_t success_stride
Definition gpu_wavenet_realtime_node.hpp:24
bool capture_callback_timing
Definition gpu_wavenet_realtime_node.hpp:23
bool enabled
Definition gpu_wavenet_realtime_node.hpp:21
bool capture_admissions
Definition gpu_wavenet_realtime_node.hpp:22