|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Defines the layout and members of a structure type. More...
#include <sdfg/types/structure.h>
Public Member Functions | |
| StructureDefinition (const std::string &name, bool is_packed) | |
| Constructs a StructureDefinition with the specified name and packing. | |
| std::unique_ptr< StructureDefinition > | clone () const |
| Creates a deep copy of this structure definition. | |
| const std::string & | name () const |
| Gets the name of this structure. | |
| bool | is_packed () const |
| Checks if this structure is packed. | |
| size_t | num_members () const |
| Gets the number of members in this structure. | |
| const IType & | member_type (symbolic::Integer index) const |
| Gets the type of a member at the specified index. | |
| void | add_member (const IType &member_type) |
| Adds a member to this structure. | |
| bool | is_vector () const |
| Checks if this structure represents a SIMD vector type. | |
| const Scalar & | vector_element_type () const |
| Gets the element type of a vector structure. | |
| const size_t | vector_size () const |
| Gets the size of a vector structure. | |
| void | replace_symbols (const symbolic::Expression old_expression, const symbolic::Expression new_expression) |
| Replace symbolic expressions on the members. | |
| void | replace_symbols (const symbolic::ExpressionMapping &replacements) |
Static Public Member Functions | |
| static const Structure & | create_vector_type (const builder::FunctionBuilder &builder, const Scalar &element_type, size_t vector_size) |
| Creates or retrieves a vector type structure. | |
Defines the layout and members of a structure type.
StructureDefinition contains the complete definition of a structure, including all member types in order and layout information (packed vs. unpacked).
This class also supports creating and identifying SIMD vector types, which are represented as structures with homogeneous scalar members.
| sdfg::types::StructureDefinition::StructureDefinition | ( | const std::string & | name, |
| bool | is_packed ) |
Constructs a StructureDefinition with the specified name and packing.
| name | The name of the structure |
| is_packed | Whether the structure should be packed (no padding between members) |
| void sdfg::types::StructureDefinition::add_member | ( | const IType & | member_type | ) |
Adds a member to this structure.
| member_type | The type of the member to add |
| std::unique_ptr< StructureDefinition > sdfg::types::StructureDefinition::clone | ( | ) | const |
Creates a deep copy of this structure definition.
|
static |
Creates or retrieves a vector type structure.
| builder | The function builder context |
| element_type | The scalar type of vector elements |
| vector_size | The number of elements in the vector |
| bool sdfg::types::StructureDefinition::is_packed | ( | ) | const |
Checks if this structure is packed.
| bool sdfg::types::StructureDefinition::is_vector | ( | ) | const |
Checks if this structure represents a SIMD vector type.
A structure is considered a vector if all its members are scalar types of the same primitive type.
| const IType & sdfg::types::StructureDefinition::member_type | ( | symbolic::Integer | index | ) | const |
Gets the type of a member at the specified index.
| index | The zero-based index of the member |
| const std::string & sdfg::types::StructureDefinition::name | ( | ) | const |
Gets the name of this structure.
| size_t sdfg::types::StructureDefinition::num_members | ( | ) | const |
Gets the number of members in this structure.
| void sdfg::types::StructureDefinition::replace_symbols | ( | const symbolic::Expression | old_expression, |
| const symbolic::Expression | new_expression ) |
Replace symbolic expressions on the members.
| old_expression | Expression to replace |
| new_expression | Replacement expression |
Replaces occurrences of symbolic expressions on the member types.
| void sdfg::types::StructureDefinition::replace_symbols | ( | const symbolic::ExpressionMapping & | replacements | ) |
| const Scalar & sdfg::types::StructureDefinition::vector_element_type | ( | ) | const |
Gets the element type of a vector structure.
| const size_t sdfg::types::StructureDefinition::vector_size | ( | ) | const |
Gets the size of a vector structure.