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

◆ dispatch_core_async()

Portal::Graphics::FenceID MayaFlux::Yantra::GpuDispatchCore::dispatch_core_async ( const std::vector< std::vector< double > > &  channels,
const DataStructureInfo structure_info 
)
protected

Non-blocking variant of dispatch_core.

Performs the full setup (on_before_gpu_dispatch, prepare_gpu_inputs, bind_descriptor) then calls GpuResourceManager::dispatch_async. Returns immediately with a FenceID. The caller must poll ShaderFoundry::is_fence_signaled on the returned ID, and once signaled call readback_primary / readback_aux to collect results.

Parameters
channelsExtracted double channels from the input Datum.
structure_infoDimension/modality metadata from OperationHelper.
Returns
FenceID to poll. INVALID_FENCE if dispatch fails.

Definition at line 336 of file GpuDispatchCore.cpp.

339{
340 on_before_gpu_dispatch(channels, structure_info);
341 prepare_gpu_inputs(channels, structure_info);
342
344
345 const size_t effective = m_staging_floats.empty()
347 : m_staging_floats.size();
348 const auto groups = calculate_dispatch_size(effective, structure_info);
349
351
353 dispatch_key(), groups, m_bindings,
354 m_push_constants.empty() ? nullptr : m_push_constants.data(),
355 m_push_constants.size());
356}
virtual std::array< uint32_t, 3 > calculate_dispatch_size(size_t total_elements, const DataStructureInfo &structure_info) const
Calculate workgroup dispatch counts from structure dimensions.
const std::string & dispatch_key() const
The key used for this context's GpuResourceManager unit.
std::vector< uint8_t > m_push_constants
std::vector< GpuBufferBinding > m_bindings
virtual void prepare_gpu_inputs(const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info)
Marshal channel data into GPU input buffers.
virtual void on_before_gpu_dispatch(const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info)
Called immediately before dispatch.
Portal::Graphics::FenceID dispatch_async(const std::string &key, const std::array< uint32_t, 3 > &groups, const std::vector< GpuBufferBinding > &bindings, const uint8_t *push_constant_data, size_t push_constant_size)
Submit a compute dispatch without blocking.

References bind_all_descriptors(), calculate_dispatch_size(), MayaFlux::Yantra::GpuResourceManager::dispatch_async(), dispatch_key(), largest_binding_data_element_count(), m_bindings, m_last_effective_element_count, m_push_constants, m_resources, m_staging_floats, on_before_gpu_dispatch(), and prepare_gpu_inputs().

Referenced by MayaFlux::Yantra::ShaderExecutionContext< InputType, OutputType >::dispatch_async().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: