mlir.runtime

Submodules

Attributes

Classes

C128

A ctype representation for MLIR's Double Complex.

C64

A ctype representation for MLIR's Float Complex.

F16

A ctype representation for MLIR's Float16.

BF16

A ctype representation for MLIR's BFloat16.

F8E5M2

A ctype representation for MLIR's Float8E5M2.

UnrankedMemRefDescriptor

Creates a ctype struct for memref descriptor

Functions

as_ctype(dtp)

Converts dtype to ctype.

to_numpy(array)

Converts ctypes array back to numpy dtype array.

make_nd_memref_descriptor(rank, dtype)

make_zero_d_memref_descriptor(dtype)

get_ranked_memref_descriptor(nparray)

Returns a ranked memref descriptor for the given numpy array.

get_unranked_memref_descriptor(nparray)

Returns a generic/unranked memref descriptor for the given numpy array.

move_aligned_ptr_by_offset(aligned_ptr, offset)

Moves the supplied ctypes pointer ahead by offset elements.

unranked_memref_to_numpy(unranked_memref, np_dtype)

Converts unranked memrefs to numpy arrays.

ranked_memref_to_numpy(ranked_memref)

Converts ranked memrefs to numpy arrays.

Package Contents

mlir.runtime.ml_dtypes = None
class mlir.runtime.C128

Bases: ctypes.Structure

A ctype representation for MLIR’s Double Complex.

_fields_
class mlir.runtime.C64

Bases: ctypes.Structure

A ctype representation for MLIR’s Float Complex.

_fields_
class mlir.runtime.F16

Bases: ctypes.Structure

A ctype representation for MLIR’s Float16.

_fields_
class mlir.runtime.BF16

Bases: ctypes.Structure

A ctype representation for MLIR’s BFloat16.

_fields_
class mlir.runtime.F8E5M2

Bases: ctypes.Structure

A ctype representation for MLIR’s Float8E5M2.

_fields_
mlir.runtime.as_ctype(dtp)

Converts dtype to ctype.

mlir.runtime.to_numpy(array)

Converts ctypes array back to numpy dtype array.

mlir.runtime.make_nd_memref_descriptor(rank, dtype)
mlir.runtime.make_zero_d_memref_descriptor(dtype)
class mlir.runtime.UnrankedMemRefDescriptor

Bases: ctypes.Structure

Creates a ctype struct for memref descriptor

_fields_
mlir.runtime.get_ranked_memref_descriptor(nparray)

Returns a ranked memref descriptor for the given numpy array.

mlir.runtime.get_unranked_memref_descriptor(nparray)

Returns a generic/unranked memref descriptor for the given numpy array.

mlir.runtime.move_aligned_ptr_by_offset(aligned_ptr, offset)

Moves the supplied ctypes pointer ahead by offset elements.

mlir.runtime.unranked_memref_to_numpy(unranked_memref, np_dtype)

Converts unranked memrefs to numpy arrays.

mlir.runtime.ranked_memref_to_numpy(ranked_memref)

Converts ranked memrefs to numpy arrays.