docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::codegen::CCodeGenerator Class Reference

#include <sdfg/codegen/code_generators/c_code_generator.h>

Inheritance diagram for sdfg::codegen::CCodeGenerator:
[legend]

Public Member Functions

 CCodeGenerator (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="")
std::string function_definition () override
 Generate a function definition for the SDFG.
void emit_capture_context_init (std::ostream &ofs_source) const override
Public Member Functions inherited from sdfg::codegen::CStyleBaseCodeGenerator
 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="")
bool generate () override
 Generate the code.
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.
bool as_source (const std::filesystem::path &header_path, const std::filesystem::path &source_path) override
 Generate the SDFG's code into source files.
void append_function_source (std::ostream &ofs_source) override
 Generate only the function source code and append it to the source file.
Public Member Functions inherited from sdfg::codegen::CodeGenerator
 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="")
virtual ~CodeGenerator ()=default
const StructuredSDFG & sdfg () const
const PrettyPrinter & includes () const
 Get the includes.
const PrettyPrinter & classes () const
 Get the classes.
const PrettyPrinter & globals () const
 Get the globals.
const std::unordered_map< std::string, CodeSnippet > & library_snippets () const
 all created library snippets
const PrettyPrinter & main () const
 Get the main stream.

Protected Member Functions

void dispatch_header_includes (PrettyPrinter &out) override
void dispatch_header_structures (PrettyPrinter &out) override
void dispatch_globals () override
void dispatch_schedule () override
LanguageExtension & language_extension () override
Protected Member Functions inherited from sdfg::codegen::CStyleBaseCodeGenerator
void dispatch_header (PrettyPrinter &out)
void dispatch_includes ()
void dispatch_structures ()

Additional Inherited Members

Protected Attributes inherited from sdfg::codegen::CodeGenerator
StructuredSDFG & sdfg_
 Reference to the schedule.
analysis::AnalysisManager & analysis_manager_
 Analysis manager for the SDFG.
InstrumentationPlan & instrumentation_plan_
 Instrumentation strategy.
ArgCapturePlan & arg_capture_plan_
PrettyPrinter includes_stream_
 Stream for includes.
PrettyPrinter classes_stream_
 Stream for classes.
PrettyPrinter globals_stream_
 Stream for global variables and functions.
std::shared_ptr< CodeSnippetFactory > library_snippet_factory_
 Stream for library functions.
PrettyPrinter main_stream_
 Main stream.
std::string externals_prefix_
 Prefix to use for external functions.

Constructor & Destructor Documentation

◆ CCodeGenerator()

sdfg::codegen::CCodeGenerator::CCodeGenerator ( 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 = "" )
inlineexplicit

Member Function Documentation

◆ dispatch_globals()

void sdfg::codegen::CCodeGenerator::dispatch_globals ( )
overrideprotectedvirtual

◆ dispatch_header_includes()

void sdfg::codegen::CCodeGenerator::dispatch_header_includes ( PrettyPrinter & out)
overrideprotectedvirtual

◆ dispatch_header_structures()

void sdfg::codegen::CCodeGenerator::dispatch_header_structures ( PrettyPrinter & out)
overrideprotectedvirtual

◆ dispatch_schedule()

void sdfg::codegen::CCodeGenerator::dispatch_schedule ( )
overrideprotectedvirtual

◆ emit_capture_context_init()

void sdfg::codegen::CCodeGenerator::emit_capture_context_init ( std::ostream & ofs_source) const
overridevirtual

◆ function_definition()

std::string sdfg::codegen::CCodeGenerator::function_definition ( )
overridevirtual

Generate a function definition for the SDFG.

Implements sdfg::codegen::CodeGenerator.

◆ language_extension()

LanguageExtension & sdfg::codegen::CCodeGenerator::language_extension ( )
inlineoverrideprotectedvirtual

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