docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
function_builder.h
Go to the documentation of this file.
1#pragma once
2
3#include <utility>
4
6#include "sdfg/function.h"
7#include "sdfg/types/type.h"
8
9namespace sdfg {
10namespace builder {
11
13protected:
14 virtual Function& function() const = 0;
15
16 size_t new_element_id() const;
17
18 size_t new_element_id_batch(size_t batch) const;
19
20public:
21 virtual ~FunctionBuilder() = default;
22
23 /***** Section: Containers *****/
24
25 void set_return_type(const types::IType& type) const;
26
28 const std::string& name, const types::IType& type, bool is_argument = false, bool is_external = false
29 ) const;
30
31 const types::IType& add_external(const std::string& name, const types::IType& type, LinkageType linkage_type) const;
32
33 void remove_container(const std::string& name) const;
34
35 void change_type(const std::string& name, const types::IType& type) const;
36
37 virtual void rename_container(const std::string& old_name, const std::string& new_name) const;
38
39 types::StructureDefinition& add_structure(const std::string& name, bool is_packed) const;
40
41 std::unique_ptr<types::Structure> create_vector_type(const types::Scalar& element_type, size_t vector_size);
42
43 std::string find_new_name(std::string prefix = "tmp_") const;
44
45 void set_element_counter(size_t element_counter);
46
52 virtual void replace_symbols(const symbolic::Expression old_expression, const symbolic::Expression new_expression);
53 virtual void replace_symbols(const symbolic::ExpressionMapping& replacements);
54
56
58};
59
60} // namespace builder
61} // namespace sdfg
Definition function.h:43
Definition function_builder.h:12
size_t new_element_id_batch(size_t batch) const
virtual void rename_container(const std::string &old_name, const std::string &new_name) const
const types::IType & add_container(const std::string &name, const types::IType &type, bool is_argument=false, bool is_external=false) const
types::StructureDefinition & add_structure(const std::string &name, bool is_packed) const
std::string find_new_name(std::string prefix="tmp_") const
virtual void replace_symbols(const symbolic::Expression old_expression, const symbolic::Expression new_expression)
Replace symbolic expressions on the whole SDFG.
void set_element_counter(size_t element_counter)
virtual void replace_symbols(const symbolic::ExpressionMapping &replacements)
void remove_container(const std::string &name) const
std::unique_ptr< types::Structure > create_vector_type(const types::Scalar &element_type, size_t vector_size)
void update_tasklet(data_flow::Tasklet &tasklet, const data_flow::TaskletCode code)
Common Dataflow Operations.
virtual Function & function() const =0
void set_return_type(const types::IType &type) const
virtual ~FunctionBuilder()=default
void change_type(const std::string &name, const types::IType &type) const
const types::IType & add_external(const std::string &name, const types::IType &type, LinkageType linkage_type) const
Simple computational operation in the dataflow graph.
Definition tasklet.h:348
Abstract base interface for all types in the sdfglib type system.
Definition type.h:625
Represents a scalar primitive type.
Definition scalar.h:27
Defines the layout and members of a structure type.
Definition structure.h:120
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
SymEngine::map_basic_basic ExpressionMapping
Definition symbolic.h:109
Definition function_builder.h:10
TaskletCode
Operation codes for tasklet computations.
Definition tasklet.h:94
Definition analysis.h:7
LinkageType
Definition function.h:41
Simple computational operations in the dataflow graph.
Core type system definitions for sdfglib.