docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
c_style_base_code_generator.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
7
8namespace sdfg {
9namespace codegen {
10
12protected:
14
16
19
22
23 virtual void dispatch_globals() = 0;
24
25 virtual void dispatch_schedule() = 0;
26
27public:
30 analysis::AnalysisManager& analysis_manager,
31 InstrumentationPlan& instrumentation_plan,
32 ArgCapturePlan& arg_capture_plan,
33 std::shared_ptr<CodeSnippetFactory> library_snippet_factory = std::make_shared<CodeSnippetFactory>(),
34 const std::string& externals_prefix = ""
35 );
36
37 bool generate() override;
38
39 bool emit_header(PrettyPrinter& out) override;
40
41 bool emit_main_source(std::ostream& out, const std::filesystem::path& header_path) override;
42
43 bool as_source(const std::filesystem::path& header_path, const std::filesystem::path& source_path) override;
44
45 void append_function_source(std::ostream& ofs_source) override;
46
47 virtual void emit_capture_context_init(std::ostream& ofs_source) const = 0;
48};
49
50} // namespace codegen
51} // namespace sdfg
Definition structured_sdfg.h:30
Definition analysis.h:53
Definition arg_capture_plan.h:36
bool generate() override
Generate the code.
virtual void dispatch_header_structures(PrettyPrinter &out)=0
virtual LanguageExtension & language_extension()=0
void append_function_source(std::ostream &ofs_source) override
Generate only the function source code and append it to the source file.
void dispatch_header(PrettyPrinter &out)
virtual void emit_capture_context_init(std::ostream &ofs_source) const =0
bool emit_header(PrettyPrinter &out) override
write the contents of the main header into out
bool emit_main_source(std::ostream &out, const std::filesystem::path &header_path) override
write the contents of the main source file into out.
virtual void dispatch_header_includes(PrettyPrinter &out)=0
bool as_source(const std::filesystem::path &header_path, const std::filesystem::path &source_path) override
Generate the SDFG's code into source files.
CStyleBaseCodeGenerator(StructuredSDFG &sdfg, analysis::AnalysisManager &analysis_manager, InstrumentationPlan &instrumentation_plan, ArgCapturePlan &arg_capture_plan, std::shared_ptr< CodeSnippetFactory > library_snippet_factory=std::make_shared< CodeSnippetFactory >(), const std::string &externals_prefix="")
CodeGenerator(StructuredSDFG &sdfg, analysis::AnalysisManager &analysis_manager, InstrumentationPlan &instrumentation_plan, ArgCapturePlan &arg_capture_plan, std::shared_ptr< CodeSnippetFactory > library_snippet_factory=std::make_shared< CodeSnippetFactory >(), const std::string &externals_prefix="")
Definition code_generator.h:54
Definition instrumentation_plan.h:26
Definition language_extension.h:39
Definition utils.h:16
Definition argument_registry.h:10
Definition analysis.h:7