|
XArith
|
This is a convenience header that includes all public xarith components. More...
Files | |
| file | version.hpp |
| XArith header and linked device library version information. | |
Classes | |
| class | mu::vdma::VpeContext |
| Vector Processing Engine Context. More... | |
Typedefs | |
| using | mu::vdma::dim_t = uint32_t |
| Element count for a vector operation. More... | |
Enumerations | |
| enum class | mu::vdma::DataType : uint64_t { mu::vdma::Fp32 , mu::vdma::Fp16 } |
| Element data type for VPE operations. More... | |
| enum class | mu::vdma::VpeIdStrategy { mu::vdma::ByThreadId , mu::vdma::ByClusterId } |
| VPE assignment strategy for load balancing. More... | |
Functions | |
| constexpr uint64_t | mu::vdma::elementSize (DataType dt) |
| Byte size of one element of the given DataType. More... | |
This is a convenience header that includes all public xarith components.
Users can include this single header to get access to all functionality.
The xarith library is a device-side C++ library designed for XCENA's MX1 accelerator device. It works alongside the MU library to build high-performance MU kernels that run on the MX1 device's VPE (Vector Processing Engine). The library provides a high-level interface for Vector Process Engine (VPE) operations, including buffer management, data transfer between DRAM and SRAM, and various vector operations (dot product, arithmetic, reduction, comparison).
The xarith library offers:
| using mu::vdma::dim_t = typedef uint32_t |
Element count for a vector operation.
The number of elements an operation processes, distinct from the byte sizes and SRAM offsets that buffer management works in (those stay uint64_t). 32 bits is ample: the hardware descriptor carries the dimension in a 16-bit field (max 65535), and the per-VPE SRAM pool (80 KB) bounds a single buffer below that regardless. The alias keeps the choice in one place should the hardware limit ever change.
Definition at line 50 of file vpe_types.hpp.
|
strong |
Element data type for VPE operations.
Selects the FP32 or FP16 element layout for buffers and vector operations. FP16 reductions accumulate in FP32, so reduce results (dot(), *Reduce()) are always returned as float.
| Enumerator | |
|---|---|
| Fp32 | 32-bit IEEE 754 single-precision float (4 bytes per element) |
| Fp16 | 16-bit IEEE 754 half-precision float (2 bytes per element); reductions accumulate in FP32 |
Definition at line 21 of file vpe_types.hpp.
|
strong |
VPE assignment strategy for load balancing.
Selects how a context is assigned to a VPE so that concurrent work is distributed across the available engines. Each strategy targets a different parallelization pattern:
ByThreadId (Default):
ByClusterId:
| Enumerator | |
|---|---|
| ByThreadId | default; spreads concurrent threads in one unit across engines |
| ByClusterId | spreads work from different clusters across engines |
Definition at line 76 of file vpe_types.hpp.
|
inlineconstexpr |
Byte size of one element of the given DataType.
Fp32 → 4 bytes, Fp16 → 2 bytes. Used to compute a buffer's payload size (dimension * elementSize(dataType)).
Definition at line 34 of file vpe_types.hpp.