Skip to main content

Crate edgefirst_tensor

Crate edgefirst_tensor 

Source
Expand description

EdgeFirst HAL - Tensor Module

The edgefirst_tensor crate provides a unified interface for managing multi-dimensional arrays (tensors) with support for different memory types, including Direct Memory Access (DMA), POSIX Shared Memory (Shm), and system memory. The crate defines traits and structures for creating, reshaping, and mapping tensors into memory.

§Examples

use edgefirst_tensor::{Error, Tensor, TensorMemory, TensorTrait};
let tensor = Tensor::<f32>::new(&[2, 3, 4], Some(TensorMemory::Mem), Some("test_tensor"))?;
assert_eq!(tensor.memory(), TensorMemory::Mem);
assert_eq!(tensor.name(), "test_tensor");

§Overview

The main structures and traits provided by the edgefirst_tensor crate is the TensorTrait and TensorMapTrait traits, which define the behavior of Tensors and their memory mappings, respectively. The Tensor enum encapsulates different tensor implementations based on the memory type, while the TensorMap enum provides access to the underlying data.

Structs§

DmaMap
DmaTensor
A tensor backed by DMA (Direct Memory Access) memory.
MemMap
MemTensor
ShmMap
ShmTensor

Enums§

Error
Tensor
TensorMap
TensorMemory

Traits§

TensorMapTrait
TensorTrait

Functions§

is_dma_available
Check if DMA memory allocation is available on this system.
is_shm_available
Check if POSIX shared memory allocation is available on this system.

Type Aliases§

Result