|
docc 0.8.3 (0d44999b)
C++ API Reference
|
#include <sdfg/types/tensor.h>
Public Member Functions | |
| Tensor (const Scalar &element_type, const symbolic::MultiExpression &shape) | |
| Tensor (const Scalar &element_type, const math::tensor::TensorLayout &layout) | |
| Tensor (const Scalar &element_type, const symbolic::MultiExpression &shape, const symbolic::MultiExpression &strides, const symbolic::Expression &offset=symbolic::zero()) | |
| Tensor (StorageType storage_type, size_t alignment, const std::string &initializer, const Scalar &element_type, const math::tensor::TensorLayout &layout) | |
| Tensor (StorageType storage_type, size_t alignment, const std::string &initializer, const Scalar &element_type, const symbolic::MultiExpression &shape, const symbolic::MultiExpression &strides, const symbolic::Expression &offset=symbolic::zero()) | |
| virtual PrimitiveType | primitive_type () const override |
| Returns the primitive type for this type. | |
| virtual TypeID | type_id () const override |
| Returns the TypeID for runtime type identification. | |
| virtual bool | is_symbol () const override |
| Checks if this type represents a symbolic/integer type. | |
| bool | is_pointer_like () const override |
| Checks if this is a pointer or a structure behaves like a pointer. | |
| const Scalar & | element_type () const |
| const math::tensor::TensorLayout & | layout () const |
| const symbolic::MultiExpression & | shape () const |
| const symbolic::MultiExpression & | strides () const |
| const symbolic::Expression & | offset () const |
| symbolic::Expression | total_elements () const |
| symbolic::Expression | total_size () const |
| bool | is_scalar () const |
| bool | is_contiguous () const |
| bool | is_tight () const |
| virtual bool | operator== (const IType &other) const override |
| Compares two types for equality. | |
| virtual std::unique_ptr< IType > | clone () const override |
| Creates a deep copy of this type. | |
| virtual std::string | print () const override |
| Returns a string representation of this type. | |
| std::unique_ptr< Tensor > | newaxis (size_t axis) const |
| std::unique_ptr< Tensor > | flip (size_t axis) const |
| std::unique_ptr< Tensor > | unsqueeze (size_t axis) const |
| std::unique_ptr< Tensor > | squeeze (size_t axis) const |
| std::unique_ptr< Tensor > | squeeze () const |
| std::unique_ptr< Tensor > | reshape (const symbolic::MultiExpression &new_shape) const |
| std::unique_ptr< Tensor > | broadcast (const symbolic::MultiExpression &ref_shape) const |
| Broadcast this tensor to a bigger shape with strides correctly set. | |
| virtual void | replace_symbols (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override |
| Replace symbolic expressions on this type. | |
| virtual void | replace_symbols (const symbolic::ExpressionMapping &replacements) override |
| Public Member Functions inherited from sdfg::types::IType | |
| IType (StorageType storage_type=StorageType::CPU_Stack(), size_t alignment=0, const std::string &initializer="") | |
| Constructs an IType with optional storage, alignment, and initializer. | |
| virtual | ~IType ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
| StorageType | storage_type () const |
| Gets the storage type (const version). | |
| StorageType & | storage_type () |
| Gets the storage type (mutable reference). | |
| void | storage_type (const StorageType &storage_type) |
| Sets the storage type. | |
| size_t | alignment () const |
| Gets the alignment requirement in bytes. | |
| void | alignment (size_t alignment) |
| Sets the alignment requirement in bytes. | |
| std::string | initializer () const |
| Gets the initializer expression. | |
| void | initializer (const std::string &initializer) |
| Sets the initializer expression. | |
Static Public Member Functions | |
| static symbolic::MultiExpression | strides_from_shape (const symbolic::MultiExpression &shape) |
Additional Inherited Members | |
| Protected Attributes inherited from sdfg::types::IType | |
| StorageType | storage_type_ |
| Where and how the data is stored. | |
| size_t | alignment_ |
| Memory alignment requirement in bytes. | |
| std::string | initializer_ |
| Optional initializer expression. | |
| sdfg::types::Tensor::Tensor | ( | const Scalar & | element_type, |
| const symbolic::MultiExpression & | shape ) |
| sdfg::types::Tensor::Tensor | ( | const Scalar & | element_type, |
| const math::tensor::TensorLayout & | layout ) |
| sdfg::types::Tensor::Tensor | ( | const Scalar & | element_type, |
| const symbolic::MultiExpression & | shape, | ||
| const symbolic::MultiExpression & | strides, | ||
| const symbolic::Expression & | offset = symbolic::zero() ) |
| sdfg::types::Tensor::Tensor | ( | StorageType | storage_type, |
| size_t | alignment, | ||
| const std::string & | initializer, | ||
| const Scalar & | element_type, | ||
| const math::tensor::TensorLayout & | layout ) |
| sdfg::types::Tensor::Tensor | ( | StorageType | storage_type, |
| size_t | alignment, | ||
| const std::string & | initializer, | ||
| const Scalar & | element_type, | ||
| const symbolic::MultiExpression & | shape, | ||
| const symbolic::MultiExpression & | strides, | ||
| const symbolic::Expression & | offset = symbolic::zero() ) |
| std::unique_ptr< Tensor > sdfg::types::Tensor::broadcast | ( | const symbolic::MultiExpression & | ref_shape | ) | const |
Broadcast this tensor to a bigger shape with strides correctly set.
|
overridevirtual |
Creates a deep copy of this type.
Implements sdfg::types::IType.
| const Scalar & sdfg::types::Tensor::element_type | ( | ) | const |
| std::unique_ptr< Tensor > sdfg::types::Tensor::flip | ( | size_t | axis | ) | const |
| bool sdfg::types::Tensor::is_contiguous | ( | ) | const |
|
inlineoverridevirtual |
Checks if this is a pointer or a structure behaves like a pointer.
Some structures may have pointer-like semantics in certain contexts.
Implements sdfg::types::IType.
| bool sdfg::types::Tensor::is_scalar | ( | ) | const |
|
overridevirtual |
Checks if this type represents a symbolic/integer type.
Symbolic types are integer types that can be used in symbolic expressions and loop bounds.
Implements sdfg::types::IType.
| bool sdfg::types::Tensor::is_tight | ( | ) | const |
| const math::tensor::TensorLayout & sdfg::types::Tensor::layout | ( | ) | const |
| std::unique_ptr< Tensor > sdfg::types::Tensor::newaxis | ( | size_t | axis | ) | const |
| const symbolic::Expression & sdfg::types::Tensor::offset | ( | ) | const |
|
overridevirtual |
Compares two types for equality.
| other | The type to compare with |
Implements sdfg::types::IType.
|
overridevirtual |
Returns the primitive type for this type.
For scalar types, this returns the actual primitive type. For composite types (arrays, pointers, etc.), this returns the primitive type of the innermost element.
Implements sdfg::types::IType.
|
overridevirtual |
Returns a string representation of this type.
Implements sdfg::types::IType.
|
overridevirtual |
Replace symbolic expressions on this type.
| old_expression | Expression to replace |
| new_expression | Replacement expression |
Replaces occurrences of symbolic expressions on the type.
Implements sdfg::types::IType.
|
overridevirtual |
Implements sdfg::types::IType.
| std::unique_ptr< Tensor > sdfg::types::Tensor::reshape | ( | const symbolic::MultiExpression & | new_shape | ) | const |
| const symbolic::MultiExpression & sdfg::types::Tensor::shape | ( | ) | const |
| std::unique_ptr< Tensor > sdfg::types::Tensor::squeeze | ( | ) | const |
| std::unique_ptr< Tensor > sdfg::types::Tensor::squeeze | ( | size_t | axis | ) | const |
| const symbolic::MultiExpression & sdfg::types::Tensor::strides | ( | ) | const |
|
static |
| symbolic::Expression sdfg::types::Tensor::total_elements | ( | ) | const |
| symbolic::Expression sdfg::types::Tensor::total_size | ( | ) | const |
|
overridevirtual |
Returns the TypeID for runtime type identification.
Implements sdfg::types::IType.
| std::unique_ptr< Tensor > sdfg::types::Tensor::unsqueeze | ( | size_t | axis | ) | const |