Public Member Functions | Public Attributes | List of all members
MLCommon::Matrix::Data< Type > Struct Template Reference

This is a helper wrapper around the multi-gpu data blocks owned by a worker. It's design is NOT final. Its so written this way to get something concrete in a short span of time. More...

#include <data.hpp>

Collaboration diagram for MLCommon::Matrix::Data< Type >:
Collaboration graph

Public Member Functions

 Data ()
 
 Data (Type *_ptr, size_t _n_elements)
 
size_t numElements () const
 

Public Attributes

Type * ptr = nullptr
 
size_t totalSize = (size_t)0
 

Detailed Description

template<typename Type>
struct MLCommon::Matrix::Data< Type >

This is a helper wrapper around the multi-gpu data blocks owned by a worker. It's design is NOT final. Its so written this way to get something concrete in a short span of time.

Todo:
add support for custom allocators

Constructor & Destructor Documentation

◆ Data() [1/2]

template<typename Type >
MLCommon::Matrix::Data< Type >::Data ( )
inline

◆ Data() [2/2]

template<typename Type >
MLCommon::Matrix::Data< Type >::Data ( Type *  _ptr,
size_t  _n_elements 
)
inline

Member Function Documentation

◆ numElements()

template<typename Type >
size_t MLCommon::Matrix::Data< Type >::numElements ( ) const
inline

Return the number of elements of Type in ptr.

Member Data Documentation

◆ ptr

template<typename Type >
Type* MLCommon::Matrix::Data< Type >::ptr = nullptr

actual data block. This is just a linearly laid out buffer of all blocks owned by this worker

◆ totalSize

template<typename Type >
size_t MLCommon::Matrix::Data< Type >::totalSize = (size_t)0

total size (in bytes) of this buffer. In future, this will be passed to the dealloc function underneath


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