docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
mlir::sdfg::TensorInfo Class Reference

#include <mlir/Target/SDFG/SDFGTranslator.h>

Public Member Functions

 TensorInfo ()
 TensorInfo (std::vector< int64_t > shape, std::vector< int64_t > strides, int64_t offset=0)
const std::vector< int64_t > & shape () const
const std::vector< int64_t > & strides () const
int64_t offset () const
TensorInfo transpose (ArrayRef< int64_t > permutation) const
 Create transposed view: output_strides[i] = input_strides[perm[i]].
TensorInfo flip (ArrayRef< int64_t > axes) const
 Create flipped view: negate stride and adjust offset for each flipped axis.
bool is_reshape_valid (ArrayRef< int64_t > new_shape) const
 Returns true iff a reshape is valid (contiguous layout, same element count).
bool has_basic_strides () const
 Returns true iff the tensor has basic C-order contiguous strides.
bool has_transposed_strides_last_two_dims () const
 Returns true iff the tensor is transposed in the last two dimensions.
TensorInfo reshape (ArrayRef< int64_t > new_shape) const
 Create reshaped view (only valid for contiguous tensors).
std::string shape_str () const
 return shape as string for metadata
std::unique_ptr<::sdfg::types::Tensor > get_sdfg_tensor (const ::sdfg::types::Scalar &element_type) const
 Create SDFG tensor type.
::sdfg::math::tensor::TensorLayout get_tensor_layout () const
 Create SDFG tensor layout.
std::string toStr () const
 Return string representation of tensor info (for debug purposes).

Static Public Member Functions

static std::vector< int64_t > compute_strides (const std::vector< int64_t > &shape)
 Compute C-order contiguous strides from shape.
static TensorInfo from_tensor_type (TensorType type)
 Create TensorInfo from a tensor type (assumes C-order contiguous).
static bool has_basic_strides (ArrayRef< int64_t > shape, ArrayRef< int64_t > strides)
 Returns true iff the tensor has basic C-order contiguous strides.

Constructor & Destructor Documentation

◆ TensorInfo() [1/2]

mlir::sdfg::TensorInfo::TensorInfo ( )

◆ TensorInfo() [2/2]

mlir::sdfg::TensorInfo::TensorInfo ( std::vector< int64_t > shape,
std::vector< int64_t > strides,
int64_t offset = 0 )

Member Function Documentation

◆ compute_strides()

std::vector< int64_t > mlir::sdfg::TensorInfo::compute_strides ( const std::vector< int64_t > & shape)
static

Compute C-order contiguous strides from shape.

◆ flip()

TensorInfo mlir::sdfg::TensorInfo::flip ( ArrayRef< int64_t > axes) const

Create flipped view: negate stride and adjust offset for each flipped axis.

◆ from_tensor_type()

TensorInfo mlir::sdfg::TensorInfo::from_tensor_type ( TensorType type)
static

Create TensorInfo from a tensor type (assumes C-order contiguous).

◆ get_sdfg_tensor()

std::unique_ptr<::sdfg::types::Tensor > mlir::sdfg::TensorInfo::get_sdfg_tensor ( const ::sdfg::types::Scalar & element_type) const

Create SDFG tensor type.

◆ get_tensor_layout()

::sdfg::math::tensor::TensorLayout mlir::sdfg::TensorInfo::get_tensor_layout ( ) const

Create SDFG tensor layout.

◆ has_basic_strides() [1/2]

bool mlir::sdfg::TensorInfo::has_basic_strides ( ) const

Returns true iff the tensor has basic C-order contiguous strides.

◆ has_basic_strides() [2/2]

bool mlir::sdfg::TensorInfo::has_basic_strides ( ArrayRef< int64_t > shape,
ArrayRef< int64_t > strides )
static

Returns true iff the tensor has basic C-order contiguous strides.

◆ has_transposed_strides_last_two_dims()

bool mlir::sdfg::TensorInfo::has_transposed_strides_last_two_dims ( ) const

Returns true iff the tensor is transposed in the last two dimensions.

◆ is_reshape_valid()

bool mlir::sdfg::TensorInfo::is_reshape_valid ( ArrayRef< int64_t > new_shape) const

Returns true iff a reshape is valid (contiguous layout, same element count).

◆ offset()

int64_t mlir::sdfg::TensorInfo::offset ( ) const

◆ reshape()

TensorInfo mlir::sdfg::TensorInfo::reshape ( ArrayRef< int64_t > new_shape) const

Create reshaped view (only valid for contiguous tensors).

◆ shape()

const std::vector< int64_t > & mlir::sdfg::TensorInfo::shape ( ) const

◆ shape_str()

std::string mlir::sdfg::TensorInfo::shape_str ( ) const

return shape as string for metadata

◆ strides()

const std::vector< int64_t > & mlir::sdfg::TensorInfo::strides ( ) const

◆ toStr()

std::string mlir::sdfg::TensorInfo::toStr ( ) const

Return string representation of tensor info (for debug purposes).

◆ transpose()

TensorInfo mlir::sdfg::TensorInfo::transpose ( ArrayRef< int64_t > permutation) const

Create transposed view: output_strides[i] = input_strides[perm[i]].


The documentation for this class was generated from the following file: