VPP  0.8
A high-level modern C++ API for Vulkan
vpp::WArray2< ItemT > Class Template Reference

Declares workgroup-scoped variable of two-dimensional array type. More...

#include <vppLangAggregates.hpp>

Public Member Functions

 WArray2 (int nRows, int nColumns)
 Constructs a shared 2-dimensional array with specified number of rows and columns. More...
 
template<typename IndexT >
WArray< ItemT > operator[] (IndexT index) const
 Allows read/write access to individual rows of the array. More...
 
template<typename IndexT >
auto operator() (IndexT iRow, IndexT iCol) const
 Allows read/write access to elements of the array.
 
Int Size () const
 Returns GPU-level value equal to number of rows in the array.
 
int size () const
 Returns CPU-level value equal to number of rows in the array.
 
Int Rows () const
 Returns GPU-level value equal to number of rows in the array.
 
int rows () const
 Returns CPU-level value equal to number of rows in the array.
 
Int Cols () const
 Returns GPU-level value equal to number of columns in the array.
 
int cols () const
 Returns CPU-level value equal to number of columns in the array.
 

Detailed Description

template<class ItemT>
class vpp::WArray2< ItemT >

Declares workgroup-scoped variable of two-dimensional array type.

This is the same as WArray, but with two dimensions instead of one.

Can be used to represent a matrix of moderate size. Total size of the array should fit in shared memory block, which typically treanslates to ca. 128x128 matrix or slightly less.

Arrangement of the matrix is row-major.

Constructor & Destructor Documentation

◆ WArray2()

template<class ItemT>
vpp::WArray2< ItemT >::WArray2 ( int  nRows,
int  nColumns 
)

Constructs a shared 2-dimensional array with specified number of rows and columns.

The sizes may come from CPU-level variable. They can not be changed after constructing the array.

The lifetime of constructed array is until the end of the shader. Consider reusing the array if possible in order to avoid overflow of the shared memory block.

Member Function Documentation

◆ operator[]()

template<class ItemT>
template<typename IndexT >
WArray< ItemT > vpp::WArray2< ItemT >::operator[] ( IndexT  index) const

Allows read/write access to individual rows of the array.

The rows are presented as WArray objects, allowing to use group algorithms on them.


The documentation for this class was generated from the following file: