lamppp
Loading...
Searching...
No Matches
Classes | Public Member Functions | Friends | List of all members
lmp::tensor::Storage Class Reference

Low-level data manager for Tensor and TensorImpl. More...

#include <storage.hpp>

Classes

class  StorageImpl
 

Public Member Functions

 Storage (size_t byte_size, DeviceType device)
 
void * data () const noexcept
 
size_t byte_size () const noexcept
 
DeviceType device () const noexcept
 
void resize (size_t nsize)
 

Friends

std::ostream & operator<< (std::ostream &os, const Storage &obj)
 

Detailed Description

Low-level data manager for Tensor and TensorImpl.

Storage is what manages the lifetime of the data that Tensor points to, in the form of an array of bytes.

Storage maintains three core properties:

Note
Storage is type-agnostic and operates solely on raw bytes (a void*). Type information is maintained at the Tensor/TensorImpl level, in the form of DataType. Data interpretation must be handled using LMP_DISPATCH_ALL_TYPES at higher levels.
Warning
Direct manipulation of Storage should be avoided in user code. Use Tensor operations instead for type-safe data access and manipulation.
See also
Tensor, DataPtr

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