Originally started out as a handler for additional source files, like hardware-accelerator kernels that are called from the main code, it has morphed more into a CodegenState That also includes library dependencies and header definitions that could be used with the existing arguments given to any dispatcher.
More...
#include <sdfg/codegen/code_snippet_factory.h>
Originally started out as a handler for additional source files, like hardware-accelerator kernels that are called from the main code, it has morphed more into a CodegenState That also includes library dependencies and header definitions that could be used with the existing arguments given to any dispatcher.
◆ CodeSnippetFactory()
| sdfg::codegen::CodeSnippetFactory::CodeSnippetFactory |
( |
const std::pair< std::filesystem::path, std::filesystem::path > * | config = nullptr | ) |
|
◆ ~CodeSnippetFactory()
| virtual sdfg::codegen::CodeSnippetFactory::~CodeSnippetFactory |
( |
| ) |
|
|
virtualdefault |
◆ add_available_dependency()
| void sdfg::codegen::CodeSnippetFactory::add_available_dependency |
( |
const LibDependency * | dependency | ) |
|
For the generation process to declare discovered runtime dependencies before the codegen starts.
Reasons could be: user code requires that it exists, it has been found in the filesystem or the config says it is always available For example tenstorrent debug support, only available if compiled this way locally, then the headers of it may be relied upon. Otherwise it would crash
◆ add_global()
| virtual void sdfg::codegen::CodeSnippetFactory::add_global |
( |
const std::string & | snippet | ) |
|
|
virtual |
◆ add_setup()
| virtual void sdfg::codegen::CodeSnippetFactory::add_setup |
( |
const std::string & | snippet | ) |
|
|
virtual |
◆ add_teardown()
| virtual void sdfg::codegen::CodeSnippetFactory::add_teardown |
( |
const std::string & | snippet | ) |
|
|
virtual |
◆ check_for_conflicts()
| std::optional< std::pair< const std::string &, const LibDependency * > > sdfg::codegen::CodeSnippetFactory::check_for_conflicts |
( |
const LibDependency * | dependency | ) |
const |
Checks if this dependency would conflict with existing ones.
- Returns
- conflict if any: {conflicting ID, source of that ID}
◆ find()
| std::unordered_map< std::string, CodeSnippet >::iterator sdfg::codegen::CodeSnippetFactory::find |
( |
const std::string & | name | ) |
|
◆ get_used_lib_dependencies()
| std::vector< const LibDependency * > sdfg::codegen::CodeSnippetFactory::get_used_lib_dependencies |
( |
| ) |
const |
◆ globals_snippets()
| const std::unordered_set< std::string > & sdfg::codegen::CodeSnippetFactory::globals_snippets |
( |
| ) |
const |
◆ header_path()
| const std::filesystem::path & sdfg::codegen::CodeSnippetFactory::header_path |
( |
| ) |
const |
|
inline |
◆ is_available()
| bool sdfg::codegen::CodeSnippetFactory::is_available |
( |
const LibDependency * | dependency | ) |
const |
The dependency is either already required or the system knows it is available.
◆ output_path()
| const std::filesystem::path & sdfg::codegen::CodeSnippetFactory::output_path |
( |
| ) |
const |
|
inline |
◆ require() [1/2]
| CodeSnippet & sdfg::codegen::CodeSnippetFactory::require |
( |
const std::string & | name, |
|
|
const std::string & | extension ) |
|
inline |
◆ require() [2/2]
| virtual CodeSnippet & sdfg::codegen::CodeSnippetFactory::require |
( |
const std::string & | name, |
|
|
const std::string & | extension, |
|
|
bool | as_file ) |
|
virtual |
◆ require_dependency()
| bool sdfg::codegen::CodeSnippetFactory::require_dependency |
( |
const LibDependency * | dependency | ) |
|
Ensure that the given dependency is available or throw.
- Returns
- true if the dependency is now newly used
◆ require_no_conflicts()
| void sdfg::codegen::CodeSnippetFactory::require_no_conflicts |
( |
const LibDependency * | dependency | ) |
|
Adds conflicts of this dependency to the list, throws if conflicts exist Warning: not transactional for now!
◆ setup_snippets()
| virtual const std::unordered_set< std::string > & sdfg::codegen::CodeSnippetFactory::setup_snippets |
( |
| ) |
const |
|
virtual |
◆ snippets()
| const std::unordered_map< std::string, CodeSnippet > & sdfg::codegen::CodeSnippetFactory::snippets |
( |
| ) |
const |
◆ teardown_snippets()
| virtual const std::unordered_set< std::string > & sdfg::codegen::CodeSnippetFactory::teardown_snippets |
( |
| ) |
const |
|
virtual |
◆ conflicting_ids_
| std::unordered_map<std::string, const LibDependency*> sdfg::codegen::CodeSnippetFactory::conflicting_ids_ |
|
protected |
◆ dependencies_
◆ globals_snippets_
| std::unordered_set<std::string> sdfg::codegen::CodeSnippetFactory::globals_snippets_ |
|
protected |
◆ header_path_
| const std::filesystem::path sdfg::codegen::CodeSnippetFactory::header_path_ |
|
protected |
◆ output_path_
| const std::filesystem::path sdfg::codegen::CodeSnippetFactory::output_path_ |
|
protected |
◆ setup_snippets_
| std::unordered_set<std::string> sdfg::codegen::CodeSnippetFactory::setup_snippets_ |
|
protected |
◆ snippets_
| std::unordered_map<std::string, CodeSnippet> sdfg::codegen::CodeSnippetFactory::snippets_ |
|
protected |
◆ teardown_snippets_
| std::unordered_set<std::string> sdfg::codegen::CodeSnippetFactory::teardown_snippets_ |
|
protected |
The documentation for this class was generated from the following file: