TensorStorage Class Reference#
2 min read time
Applies to Linux
roccv::TensorStorage Class Reference
Stores the underlying data of a tensor and is responsible for allocation/freeing of tensor memory. Agnostic to the tensor's metadata (shape, datatype, etc.) More...
#include <tensor_storage.hpp>
Public Member Functions | |
void * | data () const |
Retrieves a raw pointer to the underlying tensor data. More... | |
const eDeviceType | device () const |
Retrieves the device that the tensor data is allocated on. More... | |
TensorStorage (size_t bytes, eDeviceType device) | |
Creates a new TensorStorage object and allocates the requested number of bytes. More... | |
TensorStorage (void *data, eDeviceType device, eOwnership ownership=eOwnership::OWNING) | |
Creates a new TensorStorage object and takes ownership of the data pointer. More... | |
~TensorStorage () | |
Detailed Description
Stores the underlying data of a tensor and is responsible for allocation/freeing of tensor memory. Agnostic to the tensor's metadata (shape, datatype, etc.)
Constructor & Destructor Documentation
◆ TensorStorage() [1/2]
|
explicit |
Creates a new TensorStorage object and takes ownership of the data pointer.
- Parameters
-
data A pointer to allocated memory. device The device which the allocated memory is on. ownership Whether this object should own <data> (responsible for freeing it once it goes out of scope). Default is eOwnership::OWNING.
◆ TensorStorage() [2/2]
|
explicit |
Creates a new TensorStorage object and allocates the requested number of bytes.
- Parameters
-
bytes Number of bytes to allocate. device The device to allocate the memory on.
◆ ~TensorStorage()
roccv::TensorStorage::~TensorStorage | ( | ) |
Member Function Documentation
◆ data()
void* roccv::TensorStorage::data | ( | ) | const |
Retrieves a raw pointer to the underlying tensor data.
- Returns
- void*
◆ device()
const eDeviceType roccv::TensorStorage::device | ( | ) | const |
Retrieves the device that the tensor data is allocated on.
- Returns
- const eDeviceType
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/tensor_storage.hpp