Tensor Tiling Library
 
Loading...
Searching...
No Matches
TTL_tensors.h File Reference
#include "TTL_types.h"
Include dependency graph for TTL_cpp/TTL_tensors.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TTL_layout
 Description of a Tensor layout in memory. More...
 
struct  TTL_tensor< TENSORTYPE >
 A poor mans base class for an a tensor in the passed address space. More...
 
struct  TTL_sub_tensor< TENSORTYPE >
 A tensor plus its reference to its parent tensor. More...
 
struct  TTL_sub_tensor< TENSORTYPE >::Origin
 

Macros

#define TTL_SIZEOF(type)
 opencl doesn't like sizeof(void) so for it to be 1 like normal c
 

Functions

static TTL_offset_dim TTL_linearize (const TTL_offset &offset, const TTL_layout &layout)
 Calculate the absolute linear offset in elements, based on a given tensor offset and layout.
 

Macro Definition Documentation

◆ TTL_SIZEOF

#define TTL_SIZEOF ( type)
Value:
sizeof(type)

opencl doesn't like sizeof(void) so for it to be 1 like normal c

OpenCl will produce error: invalid application of 'sizeof' to a void type

This will need to be expanded with more types - or a different language used!

Definition at line 36 of file TTL_cpp/TTL_tensors.h.

Function Documentation

◆ TTL_linearize()

static TTL_offset_dim TTL_linearize ( const TTL_offset & offset,
const TTL_layout & 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 81 of file TTL_cpp/TTL_tensors.h.