PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
|
1- or 2-dimensional GPU buffer of numeric types More...
#include <Buffer.h>
Public Types | |
enum class | EType { uint8 , uint16 , uint32 , uint64 , int8 , int16 , int32 , int64 , float32 , float64 } |
Type of the buffer elements. | |
template<class T> | |
using | Data |
Input data type. | |
Public Member Functions | |
PBAT_API | Buffer (GpuIndex dims, GpuIndex n, EType type) |
Construct a new Buffer object of dims rows, n columns, and element type type. | |
Buffer (const Buffer &other)=delete | |
Buffer & | operator= (const Buffer &other)=delete |
PBAT_API | Buffer (Buffer &&other) noexcept |
Move constructor. | |
PBAT_API Buffer & | operator= (Buffer &&other) noexcept |
Move assignment operator. | |
PBAT_API | Buffer (Data< std::uint8_t > const &data) |
Construct a new Buffer object from input data. | |
PBAT_API | Buffer (Data< std::uint16_t > const &data) |
Construct a new Buffer object from input data. | |
PBAT_API | Buffer (Data< std::uint32_t > const &data) |
Construct a new Buffer object from input data. | |
PBAT_API | Buffer (Data< std::uint64_t > const &data) |
Construct a new Buffer object from input data. | |
PBAT_API | Buffer (Data< std::int8_t > const &data) |
Construct a new Buffer object from input data. | |
PBAT_API | Buffer (Data< std::int16_t > const &data) |
Construct a new Buffer object from input data. | |
PBAT_API | Buffer (Data< std::int32_t > const &data) |
Construct a new Buffer object from input data. | |
PBAT_API | Buffer (Data< std::int64_t > const &data) |
Construct a new Buffer object from input data. | |
PBAT_API | Buffer (Data< float > const &data) |
Construct a new Buffer object from input data. | |
PBAT_API | Buffer (Data< double > const &data) |
Construct a new Buffer object from input data. | |
PBAT_API Buffer & | operator= (Data< std::uint8_t > const &data) |
Copy assignment operator. | |
PBAT_API Buffer & | operator= (Data< std::uint16_t > const &data) |
Copy assignment operator. | |
PBAT_API Buffer & | operator= (Data< std::uint32_t > const &data) |
Copy assignment operator. | |
PBAT_API Buffer & | operator= (Data< std::uint64_t > const &data) |
Copy assignment operator. | |
PBAT_API Buffer & | operator= (Data< std::int8_t > const &data) |
Copy assignment operator. | |
PBAT_API Buffer & | operator= (Data< std::int16_t > const &data) |
Copy assignment operator. | |
PBAT_API Buffer & | operator= (Data< std::int32_t > const &data) |
Copy assignment operator. | |
PBAT_API Buffer & | operator= (Data< std::int64_t > const &data) |
Copy assignment operator. | |
PBAT_API Buffer & | operator= (Data< float > const &data) |
Copy assignment operator. | |
PBAT_API Buffer & | operator= (Data< double > const &data) |
Copy assignment operator. | |
GpuIndex | Dims () const |
Get the number of dimensions (i.e. rows) of the buffer. | |
PBAT_API EType | Type () const |
Get the type of the buffer elements. | |
PBAT_API std::size_t | Size () const |
Get the number of elements per dimension in the buffer (i.e. columns) | |
PBAT_API void | Resize (GpuIndex n) |
Resize the buffer to n elements per dimension. | |
PBAT_API void | Resize (GpuIndex dims, GpuIndex n) |
Resize the buffer to dims rows and n columns. | |
PBAT_API void * | Impl () |
Get handle to the buffer implementation. | |
PBAT_API void const * | Impl () const |
Get handle to the buffer implementation. | |
Static Public Attributes | |
static auto constexpr | kMaxDims = 4 |
Maximum number of dimensions. | |
1- or 2-dimensional GPU buffer of numeric types
using pbat::gpu::common::Buffer::Data |
Input data type.
Construct a new Buffer object of dims rows, n columns, and element type type.
dims | Number of rows |
n | Number of columns |
type | Type of the elements |
|
noexcept |
Move constructor.
other | Buffer to move |
PBAT_API pbat::gpu::common::Buffer::Buffer | ( | Data< std::uint8_t > const & | data | ) |
Construct a new Buffer object from input data.
data | Input data |
PBAT_API pbat::gpu::common::Buffer::Buffer | ( | Data< std::uint16_t > const & | data | ) |
Construct a new Buffer object from input data.
data | Input data |
PBAT_API pbat::gpu::common::Buffer::Buffer | ( | Data< std::uint32_t > const & | data | ) |
Construct a new Buffer object from input data.
data | Input data |
PBAT_API pbat::gpu::common::Buffer::Buffer | ( | Data< std::uint64_t > const & | data | ) |
Construct a new Buffer object from input data.
data | Input data |
PBAT_API pbat::gpu::common::Buffer::Buffer | ( | Data< std::int8_t > const & | data | ) |
Construct a new Buffer object from input data.
data | Input data |
PBAT_API pbat::gpu::common::Buffer::Buffer | ( | Data< std::int16_t > const & | data | ) |
Construct a new Buffer object from input data.
data | Input data |
PBAT_API pbat::gpu::common::Buffer::Buffer | ( | Data< std::int32_t > const & | data | ) |
Construct a new Buffer object from input data.
data | Input data |
PBAT_API pbat::gpu::common::Buffer::Buffer | ( | Data< std::int64_t > const & | data | ) |
Construct a new Buffer object from input data.
data | Input data |
PBAT_API pbat::gpu::common::Buffer::Buffer | ( | Data< float > const & | data | ) |
Construct a new Buffer object from input data.
data | Input data |
PBAT_API pbat::gpu::common::Buffer::Buffer | ( | Data< double > const & | data | ) |
Construct a new Buffer object from input data.
data | Input data |
|
inline |
Get the number of dimensions (i.e. rows) of the buffer.
void * pbat::gpu::common::Buffer::Impl | ( | ) |
Get handle to the buffer implementation.
void const * pbat::gpu::common::Buffer::Impl | ( | ) | const |
Get handle to the buffer implementation.
Copy assignment operator.
data | Input data to copy |
Copy assignment operator.
data | Input data to copy |
Copy assignment operator.
data | Input data to copy |
Copy assignment operator.
data | Input data to copy |
Copy assignment operator.
data | Input data to copy |
Copy assignment operator.
data | Input data to copy |
Copy assignment operator.
data | Input data to copy |
Copy assignment operator.
data | Input data to copy |
Copy assignment operator.
data | Input data to copy |
Copy assignment operator.
data | Input data to copy |
Resize the buffer to dims rows and n columns.
dims | Number of rows |
n | Number of columns |
void pbat::gpu::common::Buffer::Resize | ( | GpuIndex | n | ) |
Resize the buffer to n elements per dimension.
n | Number of elements per dimension |
std::size_t pbat::gpu::common::Buffer::Size | ( | ) | const |
Get the number of elements per dimension in the buffer (i.e. columns)
Buffer::EType pbat::gpu::common::Buffer::Type | ( | ) | const |
Get the type of the buffer elements.