8#include <nlohmann/json.hpp>
11#include <unordered_map>
12#include <unordered_set>
28using json = nlohmann::json;
61 std::unordered_map<std::string, std::unique_ptr<types::IType>>
containers_;
62 std::unordered_map<std::string, std::unique_ptr<types::StructureDefinition>>
structures_;
73 std::unordered_map<std::string, std::string>
metadata_;
89 const std::string&
name()
const;
112 return std::views::keys(this->containers_);
118 return std::views::keys(this->structures_);
149 const std::string&
metadata(
const std::string& key)
const;
152 const std::unordered_map<std::string, std::string>&
metadata()
const;
Array type representation for c-style arrays.
Symbol assumptions for reasoning about bounds, constness, and evolution.
symbolic::SymbolSet parameters() const
bool is_argument(const std::string &name) const
auto containers() const
Definition function.h:111
virtual void validate() const
Validates the function.
size_t element_counter_
Last used element id.
Definition function.h:53
void remove_metadata(const std::string &key)
const symbolic::Assumption & assumption(const symbolic::Symbol symbol) const
const std::string * metadata_if_exists(const std::string &key) const
const std::vector< std::string > & arguments() const
std::string name_
Definition function.h:56
bool is_transient(const std::string &name) const
const symbolic::Assumptions & assumptions() const
symbolic::Assumptions assumptions_
Definition function.h:70
void name(const std::string &name)
LinkageType linkage_type(const std::string &name) const
const std::unordered_map< std::string, std::string > & metadata() const
size_t element_counter() const
The last used element ID.
Function(const Function &function)=delete
std::unordered_map< std::string, std::unique_ptr< types::IType > > containers_
Definition function.h:61
virtual ~Function()=default
FunctionType type_
Definition function.h:57
std::vector< std::string > externals_
Definition function.h:66
symbolic::Assumption & assumption(const symbolic::Symbol symbol)
const std::string & metadata(const std::string &key) const
const types::IType & type(const std::string &name) const
Function(const std::string &name, FunctionType type, const types::IType &return_type)
static const std::unique_ptr< types::Scalar > NVPTX_SYMBOL_TYPE
Definition function.h:84
std::unordered_map< std::string, std::unique_ptr< types::StructureDefinition > > structures_
Definition function.h:62
const types::IType & return_type() const
const types::StructureDefinition & structure(const std::string &name) const
bool is_external(const std::string &name) const
std::unordered_map< std::string, std::string > metadata_
Definition function.h:73
std::unordered_map< std::string, LinkageType > externals_linkage_types_
Definition function.h:67
static const std::unique_ptr< types::Pointer > CONST_POINTER_TYPE
Definition function.h:85
void add_metadata(const std::string &key, const std::string &value)
std::unique_ptr< types::IType > return_type_
Definition function.h:58
FunctionType type() const
std::vector< std::string > arguments_
Definition function.h:65
Function(const std::string &name, FunctionType type)
bool exists(const std::string &name) const
const std::vector< std::string > & externals() const
const std::string & name() const
bool has_assumption(const symbolic::Symbol symbol) const
auto structures() const
Definition function.h:117
Definition exceptions.h:28
Definition function_builder.h:12
Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to...
Definition structured_sdfg_builder.h:44
Represents assumptions about a symbol's properties and behavior.
Definition assumptions.h:61
Map from symbols to their assumptions.
Definition assumptions.h:313
Abstract base interface for all types in the sdfglib type system.
Definition type.h:625
Represents a pointer type.
Definition pointer.h:32
Defines the layout and members of a structure type.
Definition structure.h:120
SymEngine::RCP< const SymEngine::Symbol > Symbol
Reference-counted pointer to a SymEngine Symbol.
Definition symbolic.h:71
std::set< Symbol, SymEngine::RCPBasicKeyLess > SymbolSet
Ordered set of symbols.
Definition symbolic.h:95
nlohmann::json json
Definition interstate_edge.h:14
Definition function_builder.h:10
LinkageType
Definition function.h:41
@ LinkageType_External
Definition function.h:41
@ LinkageType_Internal
Definition function.h:41
FunctionType FunctionType_CPU
Definition function.h:38
FunctionType FunctionType_NV_GLOBAL
Definition function.h:39
StringEnum FunctionType
Definition function.h:37
Pointer type representation.
Scalar (primitive) type representation.
Structure and record type representations.
Symbolic system for integer-based symbol analysis.
Core type system definitions for sdfglib.
Function type representation.