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

◆ dispatch_core()

GpuChannelResult MayaFlux::Yantra::GpuDispatchCore::dispatch_core ( const std::vector< std::vector< double > > &  channels,
const DataStructureInfo structure_info 
)
protected

Full single-pass dispatch.

Drives prepare_gpu_inputs, on_before_gpu_dispatch, bind_descriptor, and GpuResourceManager::dispatch.

Parameters
channelsExtracted double channels from the input Datum.
structure_infoDimension/modality metadata from OperationHelper.
Returns
GpuChannelResult containing primary float readback and aux buffers.

Definition at line 244 of file GpuDispatchCore.cpp.

247{
248 on_before_gpu_dispatch(channels, structure_info);
249 prepare_gpu_inputs(channels, structure_info);
250
252
253 const size_t effective = m_staging_floats.empty()
255 : m_staging_floats.size();
256 const auto groups = calculate_dispatch_size(effective, structure_info);
257
259 dispatch_key(), groups, m_bindings,
260 m_push_constants.empty() ? nullptr : m_push_constants.data(),
261 m_push_constants.size());
262
263 GpuChannelResult result;
264 result.primary = readback_primary(effective);
265 readback_aux(result);
266 return result;
267}
void readback_aux(GpuChannelResult &result)
Read back all OUTPUT bindings that have explicit size overrides into the aux map of a GpuChannelResul...
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.
std::vector< float > readback_primary(size_t float_count)
Read back the primary output buffer into a float vector.
void dispatch(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)

References bind_all_descriptors(), calculate_dispatch_size(), MayaFlux::Yantra::GpuResourceManager::dispatch(), dispatch_key(), largest_binding_data_element_count(), m_bindings, m_push_constants, m_resources, m_staging_floats, on_before_gpu_dispatch(), prepare_gpu_inputs(), MayaFlux::Yantra::GpuChannelResult::primary, readback_aux(), and readback_primary().

Referenced by MayaFlux::Yantra::GpuExecutionContext< InputType, OutputType >::execute().

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