Module memory

Module memory 

Source
Expand description

Memory management types and helper functions for the Openqudit library.

Traits§

Memorable
A trait for types that can be stored in memory buffers.

Functions§

alloc_zeroed_memory
Allocate a new memory buffer with the given size.
calc_col_stride
Calculate column stride for a matrix with given rows and columns.
calc_mat_stride
Calculate matrix stride for a tensor with given rows, columns, and column stride.
calc_next_stride
Calculates a subtensor’s stride, given its size. We ensure the subtensor is aligned to cachelines.

Type Aliases§

MemoryBuffer
An aligned memory buffer.
MemoryPointer
A pointer to an element in a memory buffer.
MemoryPointerMut
A mutable pointer to an element in a memory buffer.
MemoryPointerNonNull
A const non-null pointer to an element in a memory buffer.