|
|
using | PtrType = typename Base::PtrType |
| |
|
using | ValueType = std::remove_const_t< T > |
| |
|
using | Opts = Options |
| |
|
template<typename NewT > |
| using | InValueType = PackedTriangularMat< Upper, NewT, Options > |
| |
|
using | ThisType = MemTensorLike< PackedTriangularMat< Upper, T, DefaultPackedTriangularTensorOpts >, T, TensorRank, DefaultPackedTriangularTensorOpts > |
| |
|
using | ValueType = sp::remove_cvref_t< sp::remove_addrspace_t< T > > |
| |
|
using | Type = T |
| |
|
using | Opts = DefaultPackedTriangularTensorOpts |
| |
|
using | Base = TensorLike< PackedTriangularMat< Upper, T, DefaultPackedTriangularTensorOpts >, TensorRank > |
| |
|
using | InValueType = MemTensorLike< PackedTriangularMat< Upper, T, DefaultPackedTriangularTensorOpts >, NewT, TensorRank, DefaultPackedTriangularTensorOpts > |
| |
| using | PtrType = T * |
| | The type of the data pointer. More...
|
| |
|
| | PackedTriangularMat (PtrType data, int n) |
| | Construct an n * n packed triangular matrix, stored at data. More...
|
| |
| | PackedTriangularMat (PtrType data, const Vec< int, 2 > &sizes) |
| | Construct a packed triangular matrix from a data pointer and a size vector (which must be square). More...
|
| |
|
auto | getSizes () const |
| |
|
void | setSizes (sp::Vec< int, Rank > sz) |
| |
|
auto & | getSize (int n) |
| |
|
const auto & | getSize (int n) const |
| |
|
auto | getStrides () const |
| |
|
void | setStrides (sp::Vec< int, getNumStrides()> sz) |
| |
|
auto & | getStride (int n) |
| |
|
const auto & | getStride (int n) const |
| |
|
auto & | getTotalSize () |
| |
|
const auto & | getTotalSize () const |
| |
|
auto & | sizeQuantisation () |
| |
|
const auto & | sizeQuantisation () const |
| |
|
void | setDefaultSizeQuantisation () |
| |
|
sp::Vec< int, Rank > | getDimsWithPadding () |
| |
|
void | validateFields () |
| |
| void | computeStrides () |
| | Compute strides in the default way. More...
|
| |
| int | totalSizeImpl () const |
| | Get the total memory occupied by the Tensor, in terms of elements. More...
|
| |
| sp::Vec< int, Rank > | stridesImpl () const |
| | Default implementation of the stride-getter. More...
|
| |
|
sp::Vec< int, Rank > | strides () const |
| |
|
int | stride (int i) const |
| |
| | MemTensorLike (PtrType ptr, const Vec< int, Rank > &sizes) |
| | Create a Tensor. More...
|
| |
| | MemTensorLike (PtrType ptr, const Vec< int, Rank > &sizes, const Vec< int, Rank > &strides) |
| | Create a Tensor with specified strides. More...
|
| |
| int | computeOffsetImpl (const Vec< int, Rank > &pos) const |
| | Calculate the offset from the start of the buffer that a particular element can be found at. More...
|
| |
|
int | computeOffset (const Vec< int, Rank > &pos) const |
| |
| const PtrType | ptr (const Vec< int, Rank > &pos) const |
| | Get a pointer to a particular element. More...
|
| |
|
PtrType | ptr (const Vec< int, Rank > &pos) |
| |
| const PtrType | ptr () const |
| | Get a pointer to the start of the underlying buffer. More...
|
| |
|
PtrType | ptr () |
| |
|
auto | begin () const |
| |
|
auto | end () const |
| |
| auto | getViewImpl (const sp::Vec< int, Rank > &start, const sp::Vec< int, Rank > &size) |
| | Create a view into this Tensor using identical striding. More...
|
| |
| auto & | operator[] (int idx) |
| | Handy 1D subscript operator. More...
|
| |
|
const auto & | operator[] (int idx) const |
| |
| void | setSizeQuantisation (int x) |
| | Set the size quantisation for the bounds checks. More...
|
| |
|
auto | dims () const |
| |
|
bool | boundsCheck (const Vec< int, Rank > &pos) const |
| |
|
template<int L, CacheMode Mode = CacheMode::DEFAULT> |
| auto | vectorRead (const Vec< int, Rank > &pos) const |
| |
|
template<int L, CacheMode Mode = CacheMode::DEFAULT> |
| auto | vectorOffsetRead (const Vec< int, Rank > &base, const Vec< int, Rank > &offset) const |
| |
|
template<int L, CacheMode Mode = CacheMode::DEFAULT> |
| auto | maskedVectorRead (const Vec< int, Rank > &pos) const |
| |
|
template<int L, CacheMode Mode = CacheMode::DEFAULT, typename T > |
| void | vectorWrite (const Vec< int, Rank > &pos, const Vec< T, L > &values) |
| |
|
template<int L, CacheMode Mode = CacheMode::DEFAULT, typename T > |
| 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...
|
| |
| template<CacheMode Mode = CacheMode::DEFAULT> |
| auto | read (const Vec< int, Rank > &pos) const |
| | Get the element at a given position. More...
|
| |
| template<CacheMode Mode = CacheMode::DEFAULT, typename T > |
| void | write (const Vec< int, Rank > &pos, const T &value) |
| | Set a single element. More...
|
| |
|
template<int Dummy = 0> |
| int | size () const |
| |
| template<int L> |
| void | boundsCheckAccess (Vec< int, Rank > pos) const |
| | Bounds-check an L-element vector read at pos. More...
|
| |
|
| int | computeOffsetImpl (const Vec< int, 2 > &pos) const |
| | Map 2D logical coordinates to the underlying packed buffer. More...
|
| |
|
bool | boundsCheckImpl (const Vec< int, 2 > &pos) const |
| |
|
int | totalSizeImpl () const |
| |
|
sp::Vec< int, Rank > | dimsImpl () const |
| |
|
int | sizeQuantisationImpl () const |
| |
| Vec< ValueType, L > | vectorReadImpl (const Vec< int, Rank > &pos) const |
| | This will yield a vector load instruction if the alignment permits. More...
|
| |
|
void | vectorWriteImpl (const Vec< int, Rank > &pos, const Vec< ValueType, L > &values) |
| |
| template<typename Dummy = void*> |
| 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...
|
| |
| template<int L, CacheMode Mode = CacheMode::DEFAULT> |
| auto | vectorReadImpl (const Vec< int, Rank > &) const |
| | Read L elements, adjacent in the last dimension, starting at the given position. More...
|
| |
| template<int L, CacheMode Mode = CacheMode::DEFAULT> |
| 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...
|
| |
| template<int L, CacheMode Mode = CacheMode::DEFAULT> |
| 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...
|
| |
| template<int L, CacheMode Mode = CacheMode::DEFAULT, typename T > |
| 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...
|
| |
| template<int L, CacheMode Mode, typename T > |
| 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<bool Upper, typename T, typename Options = DefaultPackedTriangularTensorOpts>
class sp::PackedTriangularMat< Upper, T, Options >
Represents a packed triangular matrix.
Uses only (n+1)*n / 2 storage, vs the naive n^2 by not storing the known zeros. The downside is that address calculations are a bit more expensive, so this might be counterproductive if the matrix is small.