MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
GpuAnalyzer.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace MayaFlux::Yantra {
7
8/**
9 * @class GpuAnalyzer
10 * @brief Concrete UniversalAnalyzer that dispatches entirely via a
11 * GpuExecutionContext. CPU path is a hard error.
12 *
13 * @tparam InputType ComputeData type accepted.
14 * @tparam OutputType ComputeData type produced.
15 */
16template <ComputeData InputType = std::vector<Kakshya::DataVariant>,
17 ComputeData OutputType = InputType>
18class MAYAFLUX_API GpuAnalyzer : public UniversalAnalyzer<InputType, OutputType> {
19public:
22
23 /**
24 * @brief Construct with a configured GpuExecutionContext.
25 * @param executor Configured executor. Must not be null.
26 */
27 explicit GpuAnalyzer(
28 std::shared_ptr<GpuExecutionContext<InputType, OutputType>> executor)
29 {
30 assert(executor && "GpuAnalyzer: executor must not be null");
31 m_executor = executor;
32 this->set_gpu_backend(std::move(executor));
33 }
34
35 /**
36 * @brief Returns the attached GpuExecutionContext for further configuration.
37 */
38 [[nodiscard]] std::shared_ptr<GpuExecutionContext<InputType, OutputType>>
39
41 {
42 return m_executor;
43 }
44
45 [[nodiscard]] std::string get_analyzer_name() const override
46 {
47 return "GpuAnalyzer";
48 }
49
50 [[nodiscard]] AnalysisType get_analysis_type() const override
51 {
52 return AnalysisType::CUSTOM;
53 }
54
55protected:
57 {
58 error<std::runtime_error>(
59 Journal::Component::Yantra,
60 Journal::Context::BufferProcessing,
61 std::source_location::current(),
62 "GpuAnalyzer: GPU unavailable and no CPU fallback provided");
63 }
64
65private:
66 std::shared_ptr<GpuExecutionContext<InputType, OutputType>> m_executor;
67};
68
69} // namespace MayaFlux::Yantra
Modern, digital-first universal analyzer framework for Maya Flux.
output_type analyze_implementation(const input_type &) override
Pure virtual analysis implementation - derived classes implement this.
AnalysisType get_analysis_type() const override
Gets the analysis type category for this analyzer.
GpuAnalyzer(std::shared_ptr< GpuExecutionContext< InputType, OutputType > > executor)
Construct with a configured GpuExecutionContext.
std::shared_ptr< GpuExecutionContext< InputType, OutputType > > get_executor() const
Returns the attached GpuExecutionContext for further configuration.
std::shared_ptr< GpuExecutionContext< InputType, OutputType > > m_executor
std::string get_analyzer_name() const override
Get analyzer-specific name (derived classes override this)
Concrete UniversalAnalyzer that dispatches entirely via a GpuExecutionContext.
Type-parameterised shell over GpuDispatchCore.
Template-flexible analyzer base with instance-defined I/O types.
AnalysisType
Categories of analysis operations for discovery and organization.
Input/Output container for computation pipeline data flow with structure preservation.
Definition DataIO.hpp:24