59 std::shared_ptr<CodeSnippetFactory> library_snippet_factory = std::make_shared<CodeSnippetFactory>(),
60 const std::string& externals_prefix =
""
88 virtual bool emit_main_source(std::ostream& out,
const std::filesystem::path& header_path) = 0;
94 virtual bool as_source(
const std::filesystem::path& header_path,
const std::filesystem::path& source_path) = 0;
102 return this->includes_stream_;
107 return this->classes_stream_;
112 return this->globals_stream_;
117 return this->library_snippet_factory_->snippets();
122 return this->main_stream_;
Definition structured_sdfg.h:30
Definition arg_capture_plan.h:36
std::shared_ptr< CodeSnippetFactory > library_snippet_factory_
Stream for library functions.
Definition code_generator.h:45
const PrettyPrinter & classes() const
Get the classes.
Definition code_generator.h:106
PrettyPrinter globals_stream_
Stream for global variables and functions.
Definition code_generator.h:42
ArgCapturePlan & arg_capture_plan_
Definition code_generator.h:33
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
PrettyPrinter classes_stream_
Stream for classes.
Definition code_generator.h:39
analysis::AnalysisManager & analysis_manager_
Analysis manager for the SDFG.
Definition code_generator.h:29
const PrettyPrinter & main() const
Get the main stream.
Definition code_generator.h:121
virtual bool generate()=0
Generate the code.
std::string externals_prefix_
Prefix to use for external functions.
Definition code_generator.h:51
const PrettyPrinter & globals() const
Get the globals.
Definition code_generator.h:111
PrettyPrinter main_stream_
Main stream.
Definition code_generator.h:48
virtual bool emit_main_source(std::ostream &out, const std::filesystem::path &header_path)=0
write the contents of the main source file into out.
InstrumentationPlan & instrumentation_plan_
Instrumentation strategy.
Definition code_generator.h:32
const StructuredSDFG & sdfg() const
Definition code_generator.h:69
virtual ~CodeGenerator()=default
virtual void append_function_source(std::ostream &ofs_source)=0
Generate only the function source code and append it to the source file.
StructuredSDFG & sdfg_
Reference to the schedule.
Definition code_generator.h:26
const PrettyPrinter & includes() const
Get the includes.
Definition code_generator.h:101
virtual std::string function_definition()=0
Generate a function definition for the SDFG.
PrettyPrinter includes_stream_
Stream for includes.
Definition code_generator.h:36
virtual bool as_source(const std::filesystem::path &header_path, const std::filesystem::path &source_path)=0
Generate the SDFG's code into source files.
const std::unordered_map< std::string, CodeSnippet > & library_snippets() const
all created library snippets
Definition code_generator.h:116
virtual bool emit_header(PrettyPrinter &out)=0
write the contents of the main header into out
Definition instrumentation_plan.h:26
Definition argument_registry.h:10
Core type system definitions for sdfglib.