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

Used when we need to dispatch main SDFG elements into a subset of files (like offloaded kernels). More...

#include <sdfg/codegen/code_snippet_factory.h>

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

Public Member Functions

 NestedCodeSnippetFactory (const std::pair< std::filesystem::path, std::filesystem::path > *config=nullptr)
CodeSnippet & require (const std::string &name, const std::string &extension, bool as_file) override
void add_setup (const std::string &snippet) override
void add_teardown (const std::string &snippet) override
void add_global (const std::string &snippet) override
const std::unordered_set< std::string > & setup_snippets () const override
const std::unordered_set< std::string > & teardown_snippets () const override
Public Member Functions inherited from sdfg::codegen::CodeSnippetFactory
 CodeSnippetFactory (const std::pair< std::filesystem::path, std::filesystem::path > *config=nullptr)
virtual ~CodeSnippetFactory ()=default
CodeSnippet & require (const std::string &name, const std::string &extension)
std::unordered_map< std::string, CodeSnippet >::iterator find (const std::string &name)
const std::unordered_map< std::string, CodeSnippet > & snippets () const
const std::filesystem::path & output_path () const
const std::filesystem::path & header_path () const
std::vector< const LibDependency * > get_used_lib_dependencies () const
const std::unordered_set< std::string > & globals_snippets () const
void add_available_dependency (const LibDependency *dependency)
 For the generation process to declare discovered runtime dependencies before the codegen starts.
bool is_available (const LibDependency *dependency) const
 The dependency is either already required or the system knows it is available.
std::optional< std::pair< const std::string &, const LibDependency * > > check_for_conflicts (const LibDependency *dependency) const
 Checks if this dependency would conflict with existing ones.
void require_no_conflicts (const LibDependency *dependency)
 Adds conflicts of this dependency to the list, throws if conflicts exist Warning: not transactional for now!
bool require_dependency (const LibDependency *dependency)
 Ensure that the given dependency is available or throw.

Additional Inherited Members

Protected Attributes inherited from sdfg::codegen::CodeSnippetFactory
std::unordered_map< std::string, CodeSnippet > snippets_
const std::filesystem::path output_path_
const std::filesystem::path header_path_
std::unordered_set< std::string > setup_snippets_
std::unordered_set< std::string > teardown_snippets_
std::unordered_set< std::string > globals_snippets_
std::unordered_map< std::string, const LibDependency * > conflicting_ids_
std::unordered_map< const LibDependency *, DependencyState > dependencies_

Detailed Description

Used when we need to dispatch main SDFG elements into a subset of files (like offloaded kernels).

All outputs of the kernel should be scoped to the kernel, including any libraries etc.

Constructor & Destructor Documentation

◆ NestedCodeSnippetFactory()

sdfg::codegen::NestedCodeSnippetFactory::NestedCodeSnippetFactory ( const std::pair< std::filesystem::path, std::filesystem::path > * config = nullptr)

Member Function Documentation

◆ add_global()

void sdfg::codegen::NestedCodeSnippetFactory::add_global ( const std::string & snippet)
inlineoverridevirtual

Reimplemented from sdfg::codegen::CodeSnippetFactory.

◆ add_setup()

void sdfg::codegen::NestedCodeSnippetFactory::add_setup ( const std::string & snippet)
inlineoverridevirtual

Reimplemented from sdfg::codegen::CodeSnippetFactory.

◆ add_teardown()

void sdfg::codegen::NestedCodeSnippetFactory::add_teardown ( const std::string & snippet)
inlineoverridevirtual

Reimplemented from sdfg::codegen::CodeSnippetFactory.

◆ require()

CodeSnippet & sdfg::codegen::NestedCodeSnippetFactory::require ( const std::string & name,
const std::string & extension,
bool as_file )
inlineoverridevirtual

Reimplemented from sdfg::codegen::CodeSnippetFactory.

◆ setup_snippets()

const std::unordered_set< std::string > & sdfg::codegen::NestedCodeSnippetFactory::setup_snippets ( ) const
inlineoverridevirtual

Reimplemented from sdfg::codegen::CodeSnippetFactory.

◆ teardown_snippets()

const std::unordered_set< std::string > & sdfg::codegen::NestedCodeSnippetFactory::teardown_snippets ( ) const
inlineoverridevirtual

Reimplemented from sdfg::codegen::CodeSnippetFactory.


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