Beaver. MLIR. UnrankedMemRefDescriptor
(beaver v0.4.8)
Copy Markdown
This module defines functions working with MLIR UnrankedMemRefDescriptor runtime ABI.
UnrankedMemRefDescriptor represents an unranked memref descriptor that can hold memory reference information for dynamically shaped arrays. It provides access to the rank, sizes, strides, and offset of the memory reference. Due to the lack of a ctypes/libffi equivalent in Elixir, in Beaver we use unranked memref descriptors primarily as ABI.
Summary
Functions
Creates an empty unranked memref descriptor with the specified rank.
Frees the memory allocated for the unranked memref descriptor if it was allocated by the runtime. This is useful when the memory was allocated by a JIT-compiled function and needs to be freed after use.
Gets the offset of the unranked memref descriptor.
Gets the rank of the unranked memref descriptor.
Gets the sizes of the unranked memref descriptor as a list.
Gets the strides of the unranked memref descriptor as a list.
Types
@type t() :: %Beaver.MLIR.UnrankedMemRefDescriptor{ref: term()}
Functions
Creates an empty unranked memref descriptor with the specified rank.
Frees the memory allocated for the unranked memref descriptor if it was allocated by the runtime. This is useful when the memory was allocated by a JIT-compiled function and needs to be freed after use.
The deallocator parameter specifies the deallocation method:
:c- uses standard Cfreefunction.:enif- uses Erlang NIF'senif_freefunction.
Gets the offset of the unranked memref descriptor.
Gets the rank of the unranked memref descriptor.
Gets the sizes of the unranked memref descriptor as a list.
For rank 0 descriptors, returns an empty list.
Gets the strides of the unranked memref descriptor as a list.
For rank 0 descriptors, returns an empty list.