|
constexpr | StaticTensor (const VType &&values) |
| Construct directly from values. More...
|
|
template<typename Q , int... OtherDims> |
constexpr bool | operator== (const StaticTensor< Q, OtherDims... > &other) const |
| Comparison operators. More...
|
|
template<typename Q , int... OtherDims> |
constexpr bool | operator!= (const StaticTensor< Q, OtherDims... > &other) const |
|
constexpr ThisType | operator- () const |
|
template<typename Q > |
constexpr auto & | operator= (const Q &value) |
| Scalar-fill operator. More...
|
|
constexpr auto & | operator[] (int offset) const |
|
constexpr auto & | operator[] (int offset) |
|
constexpr void | hFlip () |
| Invert the matrix horizontally. More...
|
|
constexpr void | vFlip () |
| Invert the matrix vertically. More...
|
|
template<int I, int J, typename F > |
constexpr void | map (const F &f) |
| Apply an element-wise operation using a templated loop, to guarantee unrolling. More...
|
|
constexpr auto | transpose () const |
| Get the transpose of this matrix. More...
|
|
constexpr auto | rowVec (int targetRow) const |
| Get the I'th row. TODO: Implement submatrix views, so assignment can work nicely. More...
|
|
constexpr sp::Vec< T, DimsVec[0]> | colVec (int targetCol) const |
| Get a copy of the I'th column, as a Vec. More...
|
|
template<int Dummy = 0> |
constexpr auto | row (int targetRow) |
| Get a TensorLike representing the requested row. More...
|
|
template<int Dummy = 0> |
constexpr auto | col (int targetCol) |
| Get a TensorLike representing the requested column. More...
|
|
constexpr T * | ptr (const sp::Vec< int, Rank > &d) |
|
constexpr T * | ptr (const sp::Vec< int, Rank > &d) const |
|
auto | dims () const |
|
bool | boundsCheck (const Vec< int, Rank > &pos) const |
|
auto | vectorRead (const Vec< int, Rank > &pos) const |
|
auto | vectorOffsetRead (const Vec< int, Rank > &base, const Vec< int, Rank > &offset) const |
|
auto | maskedVectorRead (const Vec< int, Rank > &pos) const |
|
void | vectorWrite (const Vec< int, Rank > &pos, const Vec< T, L > &values) |
|
void | maskedVectorWrite (const Vec< int, Rank > &pos, const Vec< T, L > &values) |
|
int | sizeQuantisation () const |
|
int | totalSize () const |
| Get the total memory occupied by the Tensor , in terms of elements. More...
|
|
auto | getView (const sp::Vec< int, Rank > &start, const sp::Vec< int, Rank > &size) |
| Get an object that represents (and aliases) a portion of this object. More...
|
|
int | dim (int d) const |
| Behaviour common to all TensorLikes ///. More...
|
|
auto | read (const Vec< int, Rank > &pos) const |
| Get the element at a given position. More...
|
|
void | write (const Vec< int, Rank > &pos, const T &value) |
| Set a single element. More...
|
|
int | size () const |
|
void | boundsCheckAccess (Vec< int, Rank > pos) const |
| Bounds-check an L-element vector read at pos . More...
|
|
|
constexpr auto | dimsImpl () const |
|
template<int L, CacheMode Mode> |
constexpr sp::Vec< T, L > | vectorReadImpl (const Vec< int, Rank > &pos) const |
|
template<int L, CacheMode Mode, typename Q > |
constexpr void | vectorWriteImpl (const Vec< int, Rank > &pos, const Vec< Q, L > &inValues) |
|
auto | dimsImpl () const |
| Get an sp::Vec<int, X> representing the dimensions of the object. More...
|
|
bool | boundsCheckImpl (const sp::Vec< int, Rank > &) const |
| Return true iff the given coordinates are inside the object (Default implementation below) More...
|
|
int | sizeQuantisationImpl () const |
| The last dimension is rounded up to the next multiple of this value for the purposes of bounds checks. More...
|
|
auto | vectorReadImpl (const Vec< int, Rank > &) const |
| Read L elements, adjacent in the last dimension, starting at the given position. More...
|
|
auto | vectorOffsetReadImpl (const Vec< int, Rank > &base, const Vec< int, Rank > &offset) const |
| Read L elements, adjacent in the last dimension, from position base + offset . More...
|
|
auto | maskedVectorReadImpl (const Vec< int, Rank > &pos) const |
| Do a vectorRead that copes with the possibility of part of the vector being out of bounds. More...
|
|
void | maskedVectorWriteImpl (const Vec< int, Rank > &pos, const Vec< T, L > &values) |
| Do a vectorWrite that copes with the possibility of part of the vector being out of bounds. More...
|
|
void | vectorWriteImpl (const Vec< int, Rank > &pos, const Vec< T, L > &values) |
| Write L elements, adjacent in the last dimension, starting at the given position. More...
|
|
auto | getViewImpl (const sp::Vec< int, Rank > &start, const sp::Vec< int, Rank > &size) |
| The default implementation just makes a TensorView . Not hugely fast, but always works. More...
|
|
template<typename T, int... Dims>
class sp::StaticTensor< T, Dims >
A Tensor
that has constexpr dimensions.
This allows it to exist on the stack, in registers, or even be used in constexpr contexts.