|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Namespaces | |
| namespace | builder |
Classes | |
| class | Array |
| Represents a c-style array type. More... | |
| class | Function |
| Represents a function type. More... | |
| class | Pointer |
| Represents a pointer type. More... | |
| class | Scalar |
| Represents a scalar primitive type. More... | |
| class | Structure |
| Represents a structure type (similar to C struct). More... | |
| class | StructureDefinition |
| Defines the layout and members of a structure type. More... | |
| class | Tensor |
| class | StorageType |
| Represents the storage location and management characteristics of data. More... | |
| class | IType |
| Abstract base interface for all types in the sdfglib type system. More... | |
Enumerations | |
| enum | PrimitiveType { Void , Bool , Int8 , Int16 , Int32 , Int64 , Int128 , UInt8 , UInt16 , UInt32 , UInt64 , UInt128 , Half , BFloat , Float , Double , X86_FP80 , FP128 , PPC_FP128 } |
| Enumeration of all primitive data types supported by sdfglib. More... | |
| enum class | TypeID { Scalar , Array , Structure , Pointer , Reference , Function , Tensor } |
| Enumeration of high-level type categories. More... | |
Functions | |
| constexpr const char * | primitive_type_to_string (PrimitiveType e) |
| Converts a PrimitiveType to its string representation. | |
| constexpr PrimitiveType | primitive_type_from_string (std::string_view e) |
| Converts a string to its corresponding PrimitiveType. | |
| constexpr size_t | bit_width (PrimitiveType e) |
| Returns the bit width of a PrimitiveType. | |
| constexpr bool | is_floating_point (PrimitiveType e) noexcept |
| Checks if a PrimitiveType is a floating-point type. | |
| constexpr bool | is_integer (PrimitiveType e) noexcept |
| Checks if a PrimitiveType is an integer type. | |
| constexpr bool | is_signed (PrimitiveType e) noexcept |
| Checks if a PrimitiveType is a signed integer type. | |
| constexpr bool | is_unsigned (PrimitiveType e) noexcept |
| Checks if a PrimitiveType is an unsigned integer type. | |
| constexpr PrimitiveType | as_signed (PrimitiveType e) noexcept |
| Converts an unsigned integer type to its signed equivalent. | |
| constexpr PrimitiveType | as_unsigned (PrimitiveType e) noexcept |
| Converts a signed integer type to its unsigned equivalent. | |
| std::unique_ptr< types::IType > | infer_type (const sdfg::Function &function, const types::IType &type, const data_flow::Subset &subset) |
| Infers the type resulting from accessing a subset of data. | |
| std::unique_ptr< types::IType > | recombine_array_type (const types::IType &type, uint depth, const types::IType &inner_type) |
| Reconstructs an array type with a new inner element type. | |
| const IType & | peel_to_innermost_element (const IType &type, int follow_ptr=PEEL_TO_INNERMOST_ELEMENT_FOLLOW_ONLY_OUTER_PTR) |
| Returns the innermost element type of a (potentially multi-dimensional) array. | |
| symbolic::Expression | get_contiguous_element_size (const types::IType &type, bool allow_comp_time_eval=true) |
| Returns the size in bytes of one contiguous element. | |
| symbolic::Expression | get_type_size (const types::IType &type, bool allow_comp_time_eval=true) |
| Returns the size of a type in bytes. | |
| const types::IType * | peel_to_next_element (const types::IType &type) |
| Returns the next element type inside an array/pointer/reference. | |
| bool | is_contiguous_type (const types::IType &type, StructuredSDFG &sdfg) |
| Checks if a type is contiguous in memory. | |
| PrimitiveType | get_primitive_type_to_hold_upper_bound (const symbolic::Expression &expr) |
| Return a good primitive type that can hold the expressions maximum value. | |
| PrimitiveType | get_primitive_type_to_hold_lower_bound (const symbolic::Expression &expr) |
| Return a good primitive type that can hold the expressions minimum value. | |
| PrimitiveType | get_primitive_type_to_hold (PrimitiveType a, PrimitiveType b) |
| Return the primitive type that can hold the contents of both a and b without any risk of loss (respecting C-style signed-overflow is undefined and need not be considered. | |
Variables | |
| constexpr int | PEEL_TO_INNERMOST_ELEMENT_FOLLOW_ONLY_OUTER_PTR = -100 |
| Special value indicating to follow only an outermost pointer when peeling. | |
Enumeration of all primitive data types supported by sdfglib.
This enum defines all the basic scalar types that can be used in the type system, including integer types (signed and unsigned), floating-point types, and void.
|
strong |
Enumeration of high-level type categories.
This enum is used for runtime type identification of IType-derived classes.
| Enumerator | |
|---|---|
| Scalar | Scalar primitive type. |
| Array | Array type (c-style arrays). |
| Structure | Structure/record type. |
| Pointer | Pointer type. |
| Reference | Reference type. |
| Function | Function type. |
| Tensor | Tensor type (multi-dimensional arrays). |
|
constexprnoexcept |
Converts an unsigned integer type to its signed equivalent.
| e | The PrimitiveType to convert |
|
constexprnoexcept |
Converts a signed integer type to its unsigned equivalent.
| e | The PrimitiveType to convert |
|
constexpr |
Returns the bit width of a PrimitiveType.
| e | The PrimitiveType to query |
| std::invalid_argument | if the primitive type is invalid |
| symbolic::Expression sdfg::types::get_contiguous_element_size | ( | const types::IType & | type, |
| bool | allow_comp_time_eval = true ) |
Returns the size in bytes of one contiguous element.
This computes the size of a single element according to peel_to_innermost_element. This is useful for calculating strides and offsets in array indexing.
| type | The type to query |
| allow_comp_time_eval | Whether to emit compiler-time sizeof expressions if static size is unknown (default: true) |
| PrimitiveType sdfg::types::get_primitive_type_to_hold | ( | PrimitiveType | a, |
| PrimitiveType | b ) |
Return the primitive type that can hold the contents of both a and b without any risk of loss (respecting C-style signed-overflow is undefined and need not be considered.
but unsigned overflow does)
| PrimitiveType sdfg::types::get_primitive_type_to_hold_lower_bound | ( | const symbolic::Expression & | expr | ) |
Return a good primitive type that can hold the expressions minimum value.
Current limited impl: will evaluate the expression. If result is immediate and fits into Int32, then that, otherwise falls back to Int64
| PrimitiveType sdfg::types::get_primitive_type_to_hold_upper_bound | ( | const symbolic::Expression & | expr | ) |
Return a good primitive type that can hold the expressions maximum value.
Current limited impl: will evaluate the expression. If result is immediate and fits into Int32, then that, otherwise falls back to Int64
| symbolic::Expression sdfg::types::get_type_size | ( | const types::IType & | type, |
| bool | allow_comp_time_eval = true ) |
Returns the size of a type in bytes.
Computes the total size of the given type. For arrays, this includes all elements. For structures, this includes all members with padding.
| type | The type to query |
| allow_comp_time_eval | Whether to emit compiler-time sizeof expressions if static size is unknown (default: true) |
| std::unique_ptr< types::IType > sdfg::types::infer_type | ( | const sdfg::Function & | function, |
| const types::IType & | type, | ||
| const data_flow::Subset & | subset ) |
Infers the type resulting from accessing a subset of data.
Given a type and a subset (index expressions), this function determines what type results from that access. For example, accessing an element of an array returns the element type, while accessing a full array returns the array type.
| function | The function context |
| type | The type being accessed |
| subset | The subset/index expressions defining the access |
| bool sdfg::types::is_contiguous_type | ( | const types::IType & | type, |
| StructuredSDFG & | sdfg ) |
Checks if a type is contiguous in memory.
This function determines if the given type represents a contiguous memory layout. Non-contiguous types include types with nested pointers. Outermost pointers are allowed as they can still point to contiguous memory.
| type | The type to check |
| sdfg | The StructuredSDFG context, to access structure definitions if needed |
|
constexprnoexcept |
Checks if a PrimitiveType is a floating-point type.
| e | The PrimitiveType to check |
|
constexprnoexcept |
Checks if a PrimitiveType is an integer type.
| e | The PrimitiveType to check |
|
constexprnoexcept |
Checks if a PrimitiveType is a signed integer type.
| e | The PrimitiveType to check |
|
constexprnoexcept |
Checks if a PrimitiveType is an unsigned integer type.
| e | The PrimitiveType to check |
| const IType & sdfg::types::peel_to_innermost_element | ( | const IType & | type, |
| int | follow_ptr = PEEL_TO_INNERMOST_ELEMENT_FOLLOW_ONLY_OUTER_PTR ) |
Returns the innermost element type of a (potentially multi-dimensional) array.
This function recursively unwraps array and pointer types to find the innermost element type. The follow_ptr parameter controls how pointers are handled during unwrapping.
| type | The type to unwrap |
| follow_ptr | Controls pointer following behavior:
|
| const types::IType * sdfg::types::peel_to_next_element | ( | const types::IType & | type | ) |
Returns the next element type inside an array/pointer/reference.
This function unwraps one level of array, pointer, or reference type to get the type of the element it contains or points to.
| type | The type to peel |
|
constexpr |
Converts a string to its corresponding PrimitiveType.
| e | The string representation of the primitive type |
| std::invalid_argument | if the string does not match any primitive type |
|
constexpr |
Converts a PrimitiveType to its string representation.
| e | The PrimitiveType to convert |
| std::invalid_argument | if the primitive type is invalid |
| std::unique_ptr< types::IType > sdfg::types::recombine_array_type | ( | const types::IType & | type, |
| uint | depth, | ||
| const types::IType & | inner_type ) |
Reconstructs an array type with a new inner element type.
This function is used to rebuild array types after transformations. It reconstructs the array type hierarchy to a specified depth with a new innermost element type.
| type | The original type |
| depth | The depth to which to reconstruct the array type |
| inner_type | The new innermost element type |
|
inlineconstexpr |
Special value indicating to follow only an outermost pointer when peeling.