MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Yantra::GpuTransformer< InputType, OutputType > Class Template Reference

Concrete UniversalTransformer that dispatches entirely via a GpuExecutionContext. More...

#include <GpuTransformer.hpp>

+ Inheritance diagram for MayaFlux::Yantra::GpuTransformer< InputType, OutputType >:
+ Collaboration diagram for MayaFlux::Yantra::GpuTransformer< InputType, OutputType >:

Public Types

using input_type = Datum< InputType >
 
using output_type = Datum< OutputType >
 
- Public Types inherited from MayaFlux::Yantra::UniversalTransformer< InputType, OutputType >
using base_type = ComputeOperation< InputType, OutputType >
 
using input_type = Datum< InputType >
 
using output_type = Datum< OutputType >
 
- Public Types inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType >
using input_type = Datum< InputType >
 
using output_type = Datum< OutputType >
 

Public Member Functions

std::shared_ptr< GpuExecutionContext< InputType, OutputType > > get_executor () const
 Returns the attached GpuExecutionContext for further configuration.
 
TransformationType get_transformation_type () const override
 Gets the transformation type category for this transformer.
 
std::string get_transformer_name () const override
 Get transformer-specific name (derived classes override this)
 
 GpuTransformer (std::shared_ptr< GpuExecutionContext< InputType, OutputType > > executor)
 Construct with a configured GpuExecutionContext.
 
- Public Member Functions inherited from MayaFlux::Yantra::UniversalTransformer< InputType, OutputType >
void add_transformation_key (const TransformationKey &key)
 Add transformation key for multi-dimensional transformations.
 
void clear_transformation_keys ()
 Clear all transformation keys.
 
virtual double estimate_computational_cost () const
 Estimates the computational cost of the transformation.
 
std::map< std::string, std::any > get_all_parameters () const override
 Gets all parameters as a map.
 
double get_intensity () const
 Gets the current transformation intensity.
 
std::string get_name () const override
 Gets human-readable name for this transformer.
 
OperationType get_operation_type () const override
 Returns the category of this operation for grammar and registry discovery.
 
std::any get_parameter (const std::string &name) const override
 Gets a parameter value by name.
 
TransformationQuality get_quality () const
 Gets the current transformation quality level.
 
TransformationScope get_scope () const
 Gets the current transformation scope.
 
TransformationStrategy get_strategy () const
 Gets the current transformation strategy.
 
const std::vector< TransformationKey > & get_transformation_keys () const
 Get all transformation keys.
 
virtual double get_transformation_progress () const
 Reports the current progress of a long-running transformation.
 
virtual bool is_in_place () const
 Indicates whether the transformation modifies the input data directly.
 
template<ComputeData T>
void set_custom_function (std::function< T(const T &)> func)
 Set a custom transformation function for mathematical transformations.
 
void set_intensity (double intensity)
 Set transformation intensity (0.0 = no transformation, 1.0 = full transformation)
 
void set_parameter (const std::string &name, std::any value) override
 Type-safe parameter management with transformation-specific defaults.
 
void set_quality (TransformationQuality quality)
 Sets the transformation quality level.
 
void set_scope (TransformationScope scope)
 Sets the transformation scope.
 
void set_strategy (TransformationStrategy strategy)
 Sets the transformation strategy.
 
virtual ~UniversalTransformer ()=default
 Virtual destructor for proper inheritance cleanup.
 
- Public Member Functions inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType >
void add_dependency (std::shared_ptr< ComputeOperation > dep)
 
output_type apply_operation (const input_type &input)
 Public synchronous execution interface.
 
output_type apply_operation_with_dependencies (const input_type &input)
 Applies the operation with dependencies resolved.
 
OutputType apply_to_data (const InputType &data)
 Convenience overload that extracts just the data from result.
 
 ComputeOperation ()
 Constructor with data type validation warnings.
 
output_type execute (const input_type &input)
 OpUnit interface - operations can act as units in dependency graphs.
 
virtual const std::shared_ptr< Kakshya::SignalSourceContainer > & get_container_for_regions () const
 
const auto & get_dependencies () const
 
const ExecutionContextget_last_execution_context () const
 
bool has_gpu_backend () const
 
output_type operator() (const InputType &data)
 Convenience overload for direct data processing (backward compatibility)
 
virtual void set_container_for_regions (const std::shared_ptr< Kakshya::SignalSourceContainer > &container)
 
void set_gpu_backend (std::shared_ptr< GpuExecutionContext< InputType, OutputType > > backend)
 Attach a GPU execution backend.
 
void set_last_execution_context (const ExecutionContext &ctx)
 
void set_post_execution_hook (const OperationHookCallback &hook)
 
void set_pre_execution_hook (const OperationHookCallback &hook)
 
void set_reconstruction_callback (const ReconstructionCallback &callback)
 
virtual ~ComputeOperation ()=default
 Virtual destructor for proper cleanup of derived classes.
 

Protected Member Functions

output_type transform_implementation (input_type &) override
 Pure virtual transformation implementation - derived classes implement this.
 
- Protected Member Functions inherited from MayaFlux::Yantra::UniversalTransformer< InputType, OutputType >
virtual output_type apply_scope_and_quality_processing (const output_type &result)
 Apply scope and quality filtering to the transformation result.
 
std::vector< double > extract_transformation_parameters (const input_type &input) const
 Helper method to apply transformation keys to extract parameters.
 
virtual std::any get_transformation_parameter (const std::string &name) const
 Gets a transformation-specific parameter value.
 
virtual std::map< std::string, std::any > get_transformation_parameters () const
 Gets all transformation-specific parameters.
 
output_type operation_function (const input_type &input) override
 Core operation implementation - called by ComputeOperation interface.
 
virtual void set_transformation_parameter (const std::string &name, std::any value)
 Transformation-specific parameter handling (override for custom parameters)
 
bool validate_input (const input_type &input) const override
 Basic input validation that derived classes can override.
 
- Protected Member Functions inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType >
output_type apply_hooks (const input_type &input, const ExecutionContext &context)
 
virtual std::future< output_typeapply_operation_async (const input_type &input)
 Optional async implementation - default delegates to operation_function.
 
virtual output_type apply_operation_chained (const input_type &input, const ExecutionContext &ctx)
 Optional chain-aware implementation - default delegates to operation_function.
 
virtual output_type apply_operation_internal (const input_type &input, const ExecutionContext &context)
 Internal execution method - ComputeMatrix can access this.
 
virtual output_type apply_operation_parallel (const input_type &input, const ExecutionContext &ctx)
 Optional parallel-aware implementation - default delegates to operation_function.
 
output_type convert_result (std::vector< std::vector< double > > &result_data, DataStructureInfo &metadata)
 Convert processed double data back to OutputType using metadata and optional callback.
 

Private Attributes

std::shared_ptr< GpuExecutionContext< InputType, OutputType > > m_executor
 

Additional Inherited Members

- Protected Attributes inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType >
std::shared_ptr< Kakshya::SignalSourceContainerm_container
 
ExecutionContext m_last_execution_context
 

Detailed Description

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
class MayaFlux::Yantra::GpuTransformer< InputType, OutputType >

Concrete UniversalTransformer that dispatches entirely via a GpuExecutionContext.

CPU path is a hard error.

Use when no CPU fallback exists or is needed. Attach a configured GpuExecutionContext at construction. For operations where a CPU fallback is available, prefer attaching a GpuExecutionContext to an existing concrete transformer via set_gpu_backend() instead.

auto op = std::make_shared<GpuTransformer<>>(
std::make_shared<GpuExecutionContext<>>(
GpuShaderConfig { "my_shader.comp", { 256, 1, 1 }, sizeof(MyPC) }));
op->get_executor()->input(data).output(output_bytes).push(pc);
pipeline->add_operation(op, "my_shader");
Plain-data description of the compute shader to dispatch.
Template Parameters
InputTypeComputeData type accepted.
OutputTypeComputeData type produced.

Definition at line 31 of file GpuTransformer.hpp.


The documentation for this class was generated from the following file: