Tensor Tiling Library
 
Loading...
Searching...
No Matches
TTL_tensors_common.h File Reference

Go to the source code of this file.

Data Structures

struct  TTL_layout_t
 Description of a Tensor layout in memory. More...
 

Functions

static TTL_layout_t TTL_create_layout (const TTL_dim_t row_spacing, const TTL_dim_t plane_spacing)
 Create a 3D Description of a Tensor layout in memory.
 
static TTL_layout_t TTL_create_layout (const TTL_dim_t row_spacing)
 Create a 2D Description of a Tensor layout in memory.
 
static TTL_layout_t TTL_create_layout (void)
 Create a 1D Description of a Tensor layout in memory.
 
static TTL_offset_dim_t TTL_linearize (const TTL_offset_t offset, const TTL_layout_t layout)
 Calculate the absolute linear offset in elements, based on a given tensor offset and layout.
 

Function Documentation

◆ TTL_create_layout() [1/3]

static TTL_layout_t TTL_create_layout ( const TTL_dim_t row_spacing)
inlinestatic

Create a 2D Description of a Tensor layout in memory.

See also
TTL_layout_t for more information.
Parameters
row_spacingThe distance between the start of consequtive rows in units of elements.

The plane spacing is set to 0 - as no planes exist to be spaced.

Returns
A TTL_layout_t describing in 3D the layout requested.

Definition at line 82 of file TTL_tensors_common.h.

◆ TTL_create_layout() [2/3]

static TTL_layout_t TTL_create_layout ( const TTL_dim_t row_spacing,
const TTL_dim_t plane_spacing )
inlinestatic

Create a 3D Description of a Tensor layout in memory.

See also
TTL_layout_t for more information.
Parameters
row_spacing;The distance between the start of consequtive rows in units of elements.
plane_spacing;The distance between the start of consequtive planes in units of elements.
Returns
A TTL_layout_t describing in 3D the layout requested.

Definition at line 65 of file TTL_tensors_common.h.

◆ TTL_create_layout() [3/3]

static TTL_layout_t TTL_create_layout ( void )
inlinestatic

Create a 1D Description of a Tensor layout in memory.

See also
TTL_layout_t for more information.

The row spacing is set to 0 - as no rows exist to be spaced. The plane spacing is set to 0 - as no planes exist to be spaced.

Returns
A TTL_layout_t describing in 3D the layout requested.

Definition at line 96 of file TTL_tensors_common.h.

◆ TTL_linearize()

static TTL_offset_dim_t TTL_linearize ( const TTL_offset_t offset,
const TTL_layout_t layout )
inlinestatic

Calculate the absolute linear offset in elements, based on a given tensor offset and layout.

Parameters
offsetThe 3D offset of the required linear offset.
layoutThe layout of the offset being calculated
Returns
The offset in linear address space of the 3D offset

Definition at line 109 of file TTL_tensors_common.h.