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

◆ apply_operation_internal()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
virtual output_type MayaFlux::Yantra::ComputeOperation< InputType, OutputType >::apply_operation_internal ( const input_type input,
const ExecutionContext context 
)
inlineprotectedvirtual

Internal execution method - ComputeMatrix can access this.

Parameters
inputInput data wrapped in IO
contextExecution context with mode, threading, etc.
Returns
Processed output

Definition at line 212 of file ComputeOperation.hpp.

213 {
214 if (m_gpu_backend && m_gpu_backend->ensure_gpu_ready()) {
215 return m_gpu_backend->execute(input, context);
216 }
217
218 switch (context.mode) {
220 // Return the result of the future (this might need different handling)
221 return apply_operation_async(input).get();
222
224 return apply_operation_parallel(input, context);
225
227 return apply_operation_chained(input, context);
228
231 default:
232 return apply_hooks(input, context);
233 }
234 }
std::shared_ptr< GpuExecutionContext< InputType, OutputType > > m_gpu_backend
output_type apply_hooks(const input_type &input, const ExecutionContext &context)
virtual output_type apply_operation_chained(const input_type &input, const ExecutionContext &ctx)
Optional chain-aware implementation - default delegates to operation_function.
virtual std::future< output_type > apply_operation_async(const input_type &input)
Optional async implementation - default delegates to operation_function.
virtual output_type apply_operation_parallel(const input_type &input, const ExecutionContext &ctx)
Optional parallel-aware implementation - default delegates to operation_function.
@ SYNC
Synchronous execution.
@ CHAINED
Part of a sequential chain.
@ DEPENDENCY
Part of dependency graph.
@ ASYNC
Asynchronous execution.
@ PARALLEL
Parallel with other operations.

References MayaFlux::Yantra::ExecutionContext::mode.