MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ dispatch_async()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
Portal::Graphics::FenceID MayaFlux::Yantra::ShaderExecutionContext< InputType, OutputType >::dispatch_async ( const input_type input)
inline

Dispatch asynchronously and return a fence for polling.

Equivalent to calling extract_inputs then dispatch_core_async. The fence becomes signaled when the GPU work completes. Call collect_result() once signaled to obtain the GpuChannelResult.

Parameters
inputInput Datum. Channels are extracted before submission.
Returns
FenceID to poll with ShaderFoundry::is_fence_signaled. Returns INVALID_FENCE if GPU initialisation fails.

Definition at line 348 of file ShaderExecutionContext.hpp.

349 {
350 if (!this->ensure_gpu_ready())
352
353 auto [channels, structure_info] = this->extract_inputs(input);
354 return this->dispatch_core_async(channels, structure_info);
355 }
Core::GlobalInputConfig input
Definition Config.cpp:36
Portal::Graphics::FenceID dispatch_core_async(const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info)
Non-blocking variant of dispatch_core.
bool ensure_gpu_ready()
Ensure GPU resources are initialised.
virtual std::pair< std::vector< std::vector< double > >, DataStructureInfo > extract_inputs(const input_type &input)
Extract double channels and structure metadata from the input Datum.
constexpr FenceID INVALID_FENCE

References input.