A poor mans base class for an a tensor in the passed address space. More...
#include <TTL_tensors.h>
Public Member Functions | |
TTL_tensor (TENSORTYPE *base, const TTL_shape &shape, const TTL_layout &layout, const TTL_offset &offset, const TTL_dim elem_size) | |
TTL_tensor(TTL_create_, const_2, location, type, sub, _5_params) | |
TTL_tensor () | |
Create an empty location tensor. Empty means it has all dimensions set to zero. | |
TTL_tensor (TENSORTYPE *const base, const TTL_shape &shape, const TTL_layout &layout, const TTL_dim elem_size) | |
Create an empty location tensor. Empty means it has all dimensions set to zero. | |
TTL_tensor (TENSORTYPE *const base, const TTL_shape &shape, const TTL_layout &layout) | |
TTL_tensor(TTL_create_, const_1, location, type, sub, ) | |
TTL_tensor (TENSORTYPE *const base, const TTL_shape &shape, const TTL_dim elem_size) | |
TTL_tensor(TTL_create_, const_1, location, type, sub, ) | |
TTL_tensor (TENSORTYPE *const base, const TTL_shape &shape) | |
TTL_tensor(TTL_create_, const_1, location, type, sub, ) | |
operator TTL_tensor< const TENSORTYPE > () const | |
Cast a TTL_tensor(<em>, const_1, location, type, , ) to a TTL_tensor(TTL, const_1, location, type, , _t) | |
const TENSORTYPE & | read (const unsigned int x, const unsigned int y=0, const unsigned int z=0) const |
Read a value from a tensor. | |
TENSORTYPE | write (const TENSORTYPE value, const unsigned int x, const unsigned int y=0, const unsigned int z=0) |
Write a value to a tensor. | |
bool | empty () |
A Tensor is empty if its shape is empty. | |
Data Fields | |
TENSORTYPE * | base |
TTL_dim | elem_size |
TTL_layout | layout |
TTL_shape | shape |
A poor mans base class for an a tensor in the passed address space.
TTL_tensor contains both the logical dimensions of a tile as well as its physical mapping to memory.
TTL_scope | The scope of the creation can be TTL_global or TTL_local |
const_1 | The const name to place after the prefix - should be empty or const_ |
location | The location of the tensor - should be ext or int |
type | The type of the tensor - should be any valid c type |
const_2 | The const type to create - should be empty or const |
Definition at line 102 of file TTL_cpp/TTL_tensors.h.
|
inline |
TTL_tensor(TTL_create_, const_2, location, type, sub, _5_params)
base | The ## TTL_scope ## base address of the tensor in ## location ## memory |
shape | Description of the shape of the tensor that base points |
layout | The layout of the ## location ## tensor |
offset | The offset of the tensor from the base. |
elem_size | The size of a single element in the |
Definition at line 114 of file TTL_cpp/TTL_tensors.h.
|
inline |
Create an empty location tensor. Empty means it has all dimensions set to zero.
Most operations on an empty tensor should turn into no-ops and so an empty tensor is the safest default state.
Definition at line 125 of file TTL_cpp/TTL_tensors.h.
|
inline |
Create an empty location tensor. Empty means it has all dimensions set to zero.
Most operations on an empty tensor should turn into no-ops and so an empty tensor is the safest default state.
TTL_tensor(TTL_create_, const_1, location, type, sub, )
base | The ## TTL_scope ## base address of the tensor in ## location ## memory |
shape | Description of the shape of the tensor that base points |
layout | The layout of the ## location ## tensor |
elem_size | The size of a single element in the tensor |
The layout of the created tensor will have an offset of (0, 0, 0)
Definition at line 150 of file TTL_cpp/TTL_tensors.h.
|
inline |
TTL_tensor(TTL_create_, const_1, location, type, sub, )
base | A pointer to a global address |
shape | Description of the shape of the tensor that base points |
layout | The layout of the ## location ## tensor |
The layout of the created tensor will have an offset of (0, 0, 0)
The element size is inferred from the base_address pointer type.
Definition at line 166 of file TTL_cpp/TTL_tensors.h.
|
inline |
TTL_tensor(TTL_create_, const_1, location, type, sub, )
base | A pointer to a global address |
shape | Description of the shape of the tensor that base points to |
elem_size | The size of a single element in the tensor |
Layout is inferred from the shape. Offset is taken to be zero.
Definition at line 182 of file TTL_cpp/TTL_tensors.h.
|
inline |
TTL_tensor(TTL_create_, const_1, location, type, sub, )
base | A pointer to a global address |
shape | Description of the shape of the tensor that base points to |
Element size is inferred from the base_address pointer type. Layout is inferred from the shape. Offset is taken to be zero.
Definition at line 198 of file TTL_cpp/TTL_tensors.h.
|
inline |
A Tensor is empty if its shape is empty.
tensor | The tensor to test for emptiness |
Definition at line 252 of file TTL_cpp/TTL_tensors.h.
|
inline |
Cast a TTL_tensor(<em>, const_1, location, type, , ) to a TTL_tensor(TTL, const_1, location, type, , _t)
This is a safe cast, and implimented as a function with helper macro for type safety
tensor | The TTL_tensor(TTL_, , location, type, , <em>t) to be cast to a TTL_tensor(TTL, const_1, location, type, , _t) |
Definition at line 212 of file TTL_cpp/TTL_tensors.h.
|
inline |
Read a value from a tensor.
x | The offset in the x dimension |
y | The offset in the y dimension |
z | The offset in the z dimension |
No bounds checking is performed.
Definition at line 227 of file TTL_cpp/TTL_tensors.h.
|
inline |
Write a value to a tensor.
value | The value to write |
x | The offset in the x dimension |
y | The offset in the y dimension |
z | The offset in the z dimension |
Definition at line 239 of file TTL_cpp/TTL_tensors.h.
TENSORTYPE* TTL_tensor< TENSORTYPE >::base |
The base address of the tensor in the local address space
Definition at line 256 of file TTL_cpp/TTL_tensors.h.
TTL_dim TTL_tensor< TENSORTYPE >::elem_size |
The sizeof the elements in the tensor
Definition at line 257 of file TTL_cpp/TTL_tensors.h.
TTL_layout TTL_tensor< TENSORTYPE >::layout |
TTL_shape TTL_tensor< TENSORTYPE >::shape |
The shape of the tensor in 3 dimensions
Definition at line 259 of file TTL_cpp/TTL_tensors.h.