|
XArith
|
Vector Processing Engine Context. More...
#include <vpe_context.hpp>
Classes | |
| struct | Dot2Result |
| Pair of scalar dot-product results returned by dot2(). More... | |
Public Member Functions | |
| VpeContext (VpeIdStrategy strategy=VpeIdStrategy::ByThreadId, DataType dataType=DataType::Fp32) | |
| Constructor with default strategy (ByThreadId) and element type (Fp32) More... | |
| VpeContext (VpeIdStrategy strategy, DataType dataType, volatile uint32_t *lockAddr) | |
| Constructor with an explicit lock address. More... | |
| ~VpeContext () | |
| Destructor - automatically frees all allocated buffers. More... | |
| VpeContext (const VpeContext &)=delete | |
| VpeContext & | operator= (const VpeContext &)=delete |
| VpeContext (VpeContext &&)=delete | |
| VpeContext & | operator= (VpeContext &&)=delete |
Buffer Management | |
Allocation works in bytes. A buffer of | |
| uint64_t | allocateBuffer (uint64_t byteSize) |
| Allocate a buffer in SRAM. More... | |
| bool | tryAllocateBuffers (uint32_t count, uint64_t byteSize, uint64_t *outBuffers) |
Atomically allocate count equally-sized SRAM buffers (all-or-nothing) More... | |
| bool | tryAllocateBuffersWithSizes (uint32_t count, const uint64_t *byteSizes, uint64_t *outBuffers) |
Atomically allocate count SRAM buffers of per-buffer byte sizes. More... | |
| uint64_t | waitAllocateBuffer (uint64_t byteSize) |
| Allocate a buffer, waiting until it fits. More... | |
| bool | waitAllocateBuffers (uint32_t count, uint64_t byteSize, uint64_t *outBuffers) |
Allocate count equally-sized buffers, waiting until they fit (all-or-nothing) More... | |
| bool | waitAllocateBuffersWithSizes (uint32_t count, const uint64_t *byteSizes, uint64_t *outBuffers) |
Allocate count buffers of per-buffer sizes, waiting until they fit (all-or-nothing) More... | |
| void | freeBuffer (uint64_t buffer) |
| Free a previously allocated buffer. More... | |
| void | freeBuffers (uint32_t count, const uint64_t *buffers) |
| Free multiple previously allocated buffers in a single atomic operation. More... | |
Data Transfer | |
| void | load (const void *srcDram, uint64_t dstBuffer, dim_t dimension) |
| Load vector data from DRAM to SRAM buffer (synchronous). More... | |
| void | store (uint64_t srcBuffer, void *dstDram, dim_t dimension) |
| Store vector data from SRAM buffer to DRAM (synchronous). More... | |
| void | copy (uint64_t src, uint64_t dst, dim_t dimension) |
| Copy a vector between two SRAM buffers (synchronous). More... | |
| void | fillZero (uint64_t dst, dim_t dimension) |
| Fill an SRAM buffer with the value zero (synchronous). More... | |
| void | fillOne (uint64_t dst, dim_t dimension) |
| Fill an SRAM buffer with the value one (synchronous). More... | |
Vector Operations | |
Every operation processes | |
| float | dot (uint64_t src1, uint64_t src2, dim_t dimension) |
| Compute dot product of two vectors (synchronous) More... | |
| Dot2Result | dot2 (uint64_t shared, uint64_t src1, uint64_t src2, dim_t dimension) |
| Compute two dot products that share one operand in a single fused operation (synchronous). More... | |
| void | add (uint64_t src1, uint64_t src2, uint64_t dst, dim_t dimension) |
| Element-wise addition: dst = src1 + src2 (synchronous) More... | |
| void | sub (uint64_t src1, uint64_t src2, uint64_t dst, dim_t dimension) |
| Element-wise subtraction: dst = src1 - src2 (synchronous) More... | |
| void | mul (uint64_t src1, uint64_t src2, uint64_t dst, dim_t dimension) |
| Element-wise multiplication: dst = src1 * src2 (synchronous) More... | |
| void | div (uint64_t src1, uint64_t src2, uint64_t dst, dim_t dimension) |
| Element-wise division: dst = src1 / src2 (synchronous) More... | |
| void | square (uint64_t src, uint64_t dst, dim_t dimension) |
| Element-wise square: dst = src * src (synchronous) More... | |
| void | bitwiseXor (uint64_t src1, uint64_t src2, uint64_t dst, dim_t dimension) |
| Element-wise bitwise XOR: dst = src1 ^ src2 (synchronous) More... | |
Reduce Operations | |
| float | addReduce (uint64_t src1, uint64_t src2, dim_t dimension) |
| Sum of element-wise addition: result = Σ(src1[i] + src2[i]) (synchronous) More... | |
| float | subReduce (uint64_t src1, uint64_t src2, dim_t dimension) |
| Sum of element-wise subtraction: result = Σ(src1[i] - src2[i]) (synchronous) More... | |
| float | divReduce (uint64_t src1, uint64_t src2, dim_t dimension) |
| Sum of element-wise division: result = Σ(src1[i] / src2[i]) (synchronous) More... | |
Scalar-Vector Operations | |
Element-wise ops between a broadcast scalar and a vector, in the hardware's native order The caller supplies the scalar in SPB. The mx1p VPER has no scalar- immediate field – it reads the scalar from the first element of an SPB buffer. So before calling, load the scalar into a (>= 1 element) buffer yourself – e.g. Scalar-LHS only. Only | |
| void | scalarAdd (uint64_t scalar, uint64_t src, uint64_t dst, dim_t dimension) |
| Add a scalar to every element: dst = scalar + src (synchronous) More... | |
| void | scalarSub (uint64_t scalar, uint64_t src, uint64_t dst, dim_t dimension) |
| Subtract each element from a scalar: dst = scalar - src (synchronous) More... | |
| void | scalarMul (uint64_t scalar, uint64_t src, uint64_t dst, dim_t dimension) |
| Multiply every element by a scalar: dst = scalar * src (synchronous) More... | |
| void | scalarDiv (uint64_t scalar, uint64_t src, uint64_t dst, dim_t dimension) |
| Divide a scalar by each element: dst = scalar / src (synchronous) More... | |
| void | scalarXor (uint64_t scalar, uint64_t src, uint64_t dst, dim_t dimension) |
| Bitwise XOR every element with a scalar mask: dst = scalar ^ src (synchronous) More... | |
| float | scalarDot (uint64_t scalar, uint64_t src, dim_t dimension) |
| Scalar-weighted sum: result = Σ(scalar * src[i]) (synchronous) More... | |
Comparison Operations | |
| bool | equals (uint64_t src1, uint64_t src2, dim_t dimension) |
| Check if two vectors are equal element-wise (synchronous) More... | |
| bool | isAllZero (uint64_t src, dim_t dimension) |
| Check if all elements in a vector are zero (synchronous) More... | |
Accessors | |
| uint64_t | bytesForDimension (dim_t dimension) const |
Bytes occupied by dimension elements of this context's DataType. More... | |
| DataType | getDataType () const |
| Get the element data type configured for this context. More... | |
Static Public Member Functions | |
Internal / Experimental | |
| static void | _reset () |
| [DANGEROUS] Reset the entire SRAM allocator state for the calling thread's execution unit More... | |
Static Public Attributes | |
| static constexpr uint32_t | MAX_TRACKED_BUFFERS = 160 |
| static constexpr uint64_t | INVALID_BUFFER = static_cast<uint64_t>(-1) |
Vector Processing Engine Context.
VpeContext integrates SRAM buffer allocation and vector functions into a single easy-to-use interface. It manages SRAM buffer allocation and provides synchronous vector operations (dot product, arithmetic, reduction, comparison).
This class provides automatic resource management with RAII semantics: all allocated buffers are automatically freed when the context is destroyed.
Two unit conventions, deliberately separated:
dimension and processes dimension * elementSize(dataType) bytes, which must fit within the buffer's allocated bytes. The DataType, fixed at construction, is the single source of truth for the element width and has no per-call override.Use bytesForDimension() to size an allocation for a given element count.
allocatedOffsets_ tracker, however, is not synchronized; sharing one VpeContext between threads will race on the tracker even though the shared allocator state itself stays consistent.b bytes occupies ceil(b / 512) contiguous chunks, so the upper bound on simultaneous buffers is the chunk pool divided by the per-buffer chunk count (160 buffers for payloads <= 512 B). Attempting to allocate beyond that returns INVALID_BUFFER.Usage example:
Definition at line 82 of file vpe_context.hpp.
|
explicit |
Constructor with default strategy (ByThreadId) and element type (Fp32)
| strategy | VPE assignment strategy (default: ByThreadId) |
| dataType | Element data type (default: Fp32). Fixed for the lifetime of the context: it is the per-element width used by every operation and by bytesForDimension(), and has no per-call override. |
| mu::vdma::VpeContext::VpeContext | ( | VpeIdStrategy | strategy, |
| DataType | dataType, | ||
| volatile uint32_t * | lockAddr | ||
| ) |
Constructor with an explicit lock address.
| strategy | VPE assignment strategy |
| dataType | Element data type |
| lockAddr | Custom lock address (if nullptr, uses the default) |
| mu::vdma::VpeContext::~VpeContext | ( | ) |
Destructor - automatically frees all allocated buffers.
|
delete |
|
delete |
|
static |
[DANGEROUS] Reset the entire SRAM allocator state for the calling thread's execution unit
Clears all allocator state owned by the execution unit that the calling thread runs on, marking every buffer it tracks as free. The reset covers the full unit, not just the caller's own VPE.
| void mu::vdma::VpeContext::add | ( | uint64_t | src1, |
| uint64_t | src2, | ||
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Element-wise addition: dst = src1 + src2 (synchronous)
| src1 | First source buffer offset |
| src2 | Second source buffer offset |
| dst | Destination buffer offset |
| dimension | Element count |
| float mu::vdma::VpeContext::addReduce | ( | uint64_t | src1, |
| uint64_t | src2, | ||
| dim_t | dimension | ||
| ) |
Sum of element-wise addition: result = Σ(src1[i] + src2[i]) (synchronous)
| src1 | First source buffer offset |
| src2 | Second source buffer offset |
| dimension | Element count |
| uint64_t mu::vdma::VpeContext::allocateBuffer | ( | uint64_t | byteSize | ) |
Allocate a buffer in SRAM.
| byteSize | Buffer size in bytes; must be > 0. Rounded up to whole 512 B chunks. Use bytesForDimension() to size for an element count. |
| void mu::vdma::VpeContext::bitwiseXor | ( | uint64_t | src1, |
| uint64_t | src2, | ||
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Element-wise bitwise XOR: dst = src1 ^ src2 (synchronous)
| src1 | First source buffer offset |
| src2 | Second source buffer offset |
| dst | Destination buffer offset |
| dimension | Element count |
|
inline |
Bytes occupied by dimension elements of this context's DataType.
| dimension | Element count |
dimension * elementSize(getDataType()). Pass the result to allocateBuffer()/tryAllocateBuffers() to size a buffer for that many elements. Definition at line 918 of file vpe_context.hpp.
| void mu::vdma::VpeContext::copy | ( | uint64_t | src, |
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Copy a vector between two SRAM buffers (synchronous).
Copies dimension * elementSize(getDataType()) bytes from src to dst entirely within SRAM (no DRAM round-trip). The source buffer is left unchanged – this is a copy, not a move of ownership.
| src | Source buffer offset (from allocateBuffer()). |
| dst | Destination buffer offset (from allocateBuffer()). |
| dimension | Number of elements to copy. |
src and dst must be valid offsets from allocateBuffer(), each with capacity for at least dimension elements (bytesForDimension(dimension) bytes). dst holds a copy of the first dimension elements of src; src is unchanged.| void mu::vdma::VpeContext::div | ( | uint64_t | src1, |
| uint64_t | src2, | ||
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Element-wise division: dst = src1 / src2 (synchronous)
| src1 | First source buffer offset (dividend) |
| src2 | Second source buffer offset (divisor) |
| dst | Destination buffer offset |
| dimension | Element count |
| float mu::vdma::VpeContext::divReduce | ( | uint64_t | src1, |
| uint64_t | src2, | ||
| dim_t | dimension | ||
| ) |
Sum of element-wise division: result = Σ(src1[i] / src2[i]) (synchronous)
| src1 | First source buffer offset (dividend) |
| src2 | Second source buffer offset (divisor) |
| dimension | Element count |
| float mu::vdma::VpeContext::dot | ( | uint64_t | src1, |
| uint64_t | src2, | ||
| dim_t | dimension | ||
| ) |
Compute dot product of two vectors (synchronous)
| src1 | First vector buffer offset |
| src2 | Second vector buffer offset |
| dimension | Element count |
| Dot2Result mu::vdma::VpeContext::dot2 | ( | uint64_t | shared, |
| uint64_t | src1, | ||
| uint64_t | src2, | ||
| dim_t | dimension | ||
| ) |
Compute two dot products that share one operand in a single fused operation (synchronous).
Computes both shared.src1 and shared.src2 in a single fused operation. Behaves like the other sync ops – blocks until done, returns both scalars – but yields roughly 2x the throughput of two separate dot products since one operation produces both reductions.
| shared | Buffer offset of the operand shared by both products |
| src1 | Buffer offset of the first non-shared operand |
| src2 | Buffer offset of the second non-shared operand |
| dimension | Element count shared by all three operands |
| bool mu::vdma::VpeContext::equals | ( | uint64_t | src1, |
| uint64_t | src2, | ||
| dim_t | dimension | ||
| ) |
Check if two vectors are equal element-wise (synchronous)
| src1 | First buffer offset |
| src2 | Second buffer offset |
| dimension | Element count |
| void mu::vdma::VpeContext::fillOne | ( | uint64_t | dst, |
| dim_t | dimension | ||
| ) |
Fill an SRAM buffer with the value one (synchronous).
Writes the numeric value 1 to dimension elements starting at dst, using the context DataType as the element width: 1.0f for FP32 (bit pattern 0x3F800000) and FP16 1.0 (0x3C00). This is a numeric fill, not an all-ones bit pattern – the hardware Set1 function writes the element value 1 (confirmed on device). Useful for initializing a ones vector or a running accumulator.
| dst | Destination buffer offset (from allocateBuffer()). |
| dimension | Number of elements to fill. |
dst must be a valid offset from allocateBuffer() with capacity for at least dimension elements. dimension elements of dst each equal 1.| void mu::vdma::VpeContext::fillZero | ( | uint64_t | dst, |
| dim_t | dimension | ||
| ) |
Fill an SRAM buffer with the value zero (synchronous).
Writes the numeric value 0 to dimension elements starting at dst, using the context DataType as the element width (0.0f for FP32, FP16 +0.0). Equivalently, all-zero bytes over dimension * elementSize(getDataType()) bytes.
| dst | Destination buffer offset (from allocateBuffer()). |
| dimension | Number of elements to clear. |
dst must be a valid offset from allocateBuffer() with capacity for at least dimension elements. dimension elements of dst each equal 0.| void mu::vdma::VpeContext::freeBuffer | ( | uint64_t | buffer | ) |
Free a previously allocated buffer.
| buffer | Buffer offset returned by allocateBuffer() |
| void mu::vdma::VpeContext::freeBuffers | ( | uint32_t | count, |
| const uint64_t * | buffers | ||
| ) |
Free multiple previously allocated buffers in a single atomic operation.
| count | Number of buffers to free |
| buffers | Array of buffer offsets to free |
|
inline |
Get the element data type configured for this context.
Definition at line 926 of file vpe_context.hpp.
| bool mu::vdma::VpeContext::isAllZero | ( | uint64_t | src, |
| dim_t | dimension | ||
| ) |
Check if all elements in a vector are zero (synchronous)
| src | Buffer offset |
| dimension | Element count |
| void mu::vdma::VpeContext::load | ( | const void * | srcDram, |
| uint64_t | dstBuffer, | ||
| dim_t | dimension | ||
| ) |
Load vector data from DRAM to SRAM buffer (synchronous).
Transfers dimension * elementSize(getDataType()) bytes. The context's DataType is the single source of truth for the per-element width, so there is no element-typed overload – the DRAM endpoint is a raw byte pointer.
| srcDram | Source buffer holding at least dimension elements of the context's DataType. |
| dstBuffer | Destination buffer offset (from allocateBuffer()). |
| dimension | Number of elements to transfer. |
srcDram points to at least dimension * elementSize(getDataType()) readable bytes. The bytes are interpreted as the context's DataType without conversion. The API does not check the DRAM buffer length; a smaller buffer can be read out of bounds. dstBuffer must be a valid offset from allocateBuffer() with capacity for at least dimension elements (bytesForDimension(dimension) bytes). dstBuffer contains a copy of the data from srcDram.| void mu::vdma::VpeContext::mul | ( | uint64_t | src1, |
| uint64_t | src2, | ||
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Element-wise multiplication: dst = src1 * src2 (synchronous)
| src1 | First source buffer offset |
| src2 | Second source buffer offset |
| dst | Destination buffer offset |
| dimension | Element count |
|
delete |
|
delete |
| void mu::vdma::VpeContext::scalarAdd | ( | uint64_t | scalar, |
| uint64_t | src, | ||
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Add a scalar to every element: dst = scalar + src (synchronous)
| scalar | SPB buffer the caller has pre-loaded with the scalar (element 0) |
| src | Source vector buffer offset |
| dst | Destination buffer offset |
| dimension | Element count |
| void mu::vdma::VpeContext::scalarDiv | ( | uint64_t | scalar, |
| uint64_t | src, | ||
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Divide a scalar by each element: dst = scalar / src (synchronous)
A true per-element hardware divide (not a reciprocal-multiply), so it has no reciprocal-precision caveat.
| scalar | SPB buffer the caller has pre-loaded with the scalar (element 0) |
| src | Source vector buffer offset (the per-element divisor) |
| dst | Destination buffer offset |
| dimension | Element count |
src / scalar, load 1/scalar and use scalarMul(). | float mu::vdma::VpeContext::scalarDot | ( | uint64_t | scalar, |
| uint64_t | src, | ||
| dim_t | dimension | ||
| ) |
Scalar-weighted sum: result = Σ(scalar * src[i]) (synchronous)
| scalar | SPB buffer the caller has pre-loaded with the scalar (element 0) |
| src | Source vector buffer offset |
| dimension | Element count |
| void mu::vdma::VpeContext::scalarMul | ( | uint64_t | scalar, |
| uint64_t | src, | ||
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Multiply every element by a scalar: dst = scalar * src (synchronous)
| scalar | SPB buffer the caller has pre-loaded with the scalar (element 0) |
| src | Source vector buffer offset |
| dst | Destination buffer offset |
| dimension | Element count |
| void mu::vdma::VpeContext::scalarSub | ( | uint64_t | scalar, |
| uint64_t | src, | ||
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Subtract each element from a scalar: dst = scalar - src (synchronous)
| scalar | SPB buffer the caller has pre-loaded with the scalar (element 0) |
| src | Source vector buffer offset |
| dst | Destination buffer offset |
| dimension | Element count |
src - scalar, load -scalar and use scalarAdd(). | void mu::vdma::VpeContext::scalarXor | ( | uint64_t | scalar, |
| uint64_t | src, | ||
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Bitwise XOR every element with a scalar mask: dst = scalar ^ src (synchronous)
| scalar | SPB buffer the caller has pre-loaded with the raw mask bits (element 0) |
| src | Source vector buffer offset |
| dst | Destination buffer offset |
| dimension | Element count |
| void mu::vdma::VpeContext::square | ( | uint64_t | src, |
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Element-wise square: dst = src * src (synchronous)
| src | Source buffer offset |
| dst | Destination buffer offset |
| dimension | Element count |
| void mu::vdma::VpeContext::store | ( | uint64_t | srcBuffer, |
| void * | dstDram, | ||
| dim_t | dimension | ||
| ) |
Store vector data from SRAM buffer to DRAM (synchronous).
Transfers dimension * elementSize(getDataType()) bytes, using the context's DataType as the single source of truth for the per-element width (no element-typed overload).
| srcBuffer | Source buffer offset (from allocateBuffer()). |
| dstDram | Destination buffer with space for at least dimension elements of the context's DataType. |
| dimension | Number of elements to transfer. |
dstDram points to at least dimension * elementSize(getDataType()) writable bytes. The bytes use the context's DataType without conversion. The API does not check the DRAM buffer length; a smaller buffer can be written out of bounds. | void mu::vdma::VpeContext::sub | ( | uint64_t | src1, |
| uint64_t | src2, | ||
| uint64_t | dst, | ||
| dim_t | dimension | ||
| ) |
Element-wise subtraction: dst = src1 - src2 (synchronous)
| src1 | First source buffer offset |
| src2 | Second source buffer offset |
| dst | Destination buffer offset |
| dimension | Element count |
| float mu::vdma::VpeContext::subReduce | ( | uint64_t | src1, |
| uint64_t | src2, | ||
| dim_t | dimension | ||
| ) |
Sum of element-wise subtraction: result = Σ(src1[i] - src2[i]) (synchronous)
| src1 | First source buffer offset |
| src2 | Second source buffer offset |
| dimension | Element count |
| bool mu::vdma::VpeContext::tryAllocateBuffers | ( | uint32_t | count, |
| uint64_t | byteSize, | ||
| uint64_t * | outBuffers | ||
| ) |
Atomically allocate count equally-sized SRAM buffers (all-or-nothing)
Attempts to reserve count buffers under a single lock acquisition. Either all buffers are allocated or none are – preventing partial allocation that can lead to deadlock when multiple tasks compete for limited SRAM.
| count | Number of buffers to allocate, up to MAX_TRACKED_BUFFERS (the chunk pool bounds how many actually fit). 0 is accepted and returns true immediately (nothing to reserve). | |
| byteSize | Byte size for every buffer in this batch; must be > 0 | |
| [out] | outBuffers | Array of at least count elements to receive buffer offsets |
| bool mu::vdma::VpeContext::tryAllocateBuffersWithSizes | ( | uint32_t | count, |
| const uint64_t * | byteSizes, | ||
| uint64_t * | outBuffers | ||
| ) |
Atomically allocate count SRAM buffers of per-buffer byte sizes.
Like tryAllocateBuffers(count, byteSize, outBuffers), but each buffer gets its own size from byteSizes[i] – e.g. one query buffer plus two smaller candidate buffers, reserved all-or-nothing.
| count | Number of buffers, up to MAX_TRACKED_BUFFERS. 0 is accepted and returns true immediately (nothing to reserve). | |
| byteSizes | Per-buffer byte sizes; every entry must be > 0 | |
| [out] | outBuffers | Array of at least count buffer offsets |
| uint64_t mu::vdma::VpeContext::waitAllocateBuffer | ( | uint64_t | byteSize | ) |
Allocate a buffer, waiting until it fits.
The blocking counterpart of allocateBuffer(). Where a caller would otherwise write while ((b = allocateBuffer(n)) == INVALID_BUFFER) {}, this waits between attempts instead of retrying flat out.
That matters for more than throughput. A flat-out retry loop issues allocator atomics continuously, and on MX1 those are served by the same L3 ALUs the buffer holders need to run and free – a full pool plus enough spinners can starve the holders badly enough that nobody makes progress. Backing off removes that feedback loop.
| byteSize | Buffer size in bytes; must be > 0. Rounded up to whole 512 B chunks. |
warning)| bool mu::vdma::VpeContext::waitAllocateBuffers | ( | uint32_t | count, |
| uint64_t | byteSize, | ||
| uint64_t * | outBuffers | ||
| ) |
Allocate count equally-sized buffers, waiting until they fit (all-or-nothing)
The blocking counterpart of tryAllocateBuffers(); replaces the while (!tryAllocateBuffers(...)) {} idiom. Each attempt is all-or-nothing, so the caller holds nothing while waiting and the loop cannot deadlock against its peers.
| count | Number of buffers to allocate, up to MAX_TRACKED_BUFFERS. 0 is accepted and returns immediately (nothing to reserve). | |
| byteSize | Byte size for every buffer in this batch; must be > 0 | |
| [out] | outBuffers | Array of at least count elements to receive buffer offsets |
warning)count == 0 is a vacuous success – it returns true, matching tryAllocateBuffers(). Any request that could eventually fit is waited on indefinitely – this call does not time out.| bool mu::vdma::VpeContext::waitAllocateBuffersWithSizes | ( | uint32_t | count, |
| const uint64_t * | byteSizes, | ||
| uint64_t * | outBuffers | ||
| ) |
Allocate count buffers of per-buffer sizes, waiting until they fit (all-or-nothing)
Like waitAllocateBuffers(), but each buffer gets its own size from byteSizes[i].
| count | Number of buffers, up to MAX_TRACKED_BUFFERS. 0 is accepted and returns immediately (nothing to reserve). | |
| byteSizes | Per-buffer byte sizes; every entry must be > 0 | |
| [out] | outBuffers | Array of at least count buffer offsets |
count == 0 returning true.
|
staticconstexpr |
Definition at line 92 of file vpe_context.hpp.
|
staticconstexpr |
Definition at line 91 of file vpe_context.hpp.