Beaver.MLIR.Type (beaver v0.4.0)

This module provides functions to work with MLIR's type system, allowing creation of MLIR type.

Type Categories

Basic Types

Composite Types

Summary

Types

t()

@type t() :: %Beaver.MLIR.Type{ref: term()}

Functions

complex(element_type)

f16(opts \\ [])

f32(opts \\ [])

f64(opts \\ [])

f(bitwidth, opts \\ [])

See Beaver.MLIR.Type.float/2.

float(bitwidth, opts \\ [])

float?(t)

function(inputs, results, opts \\ [])

get(string, opts \\ [])

i1(opts \\ [])

i8(opts \\ [])

i16(opts \\ [])

i32(opts \\ [])

i64(opts \\ [])

i128(opts \\ [])

i(bitwidth, opts \\ [])

See Beaver.MLIR.Type.integer/2.

index(opts \\ [])

index?(t)

integer(bitwidth, opts \\ [signed: false])

integer?(t)

make(value)

memref(shape, element_type, opts \\ [layout: nil, memory_space: nil])

none(opts \\ [])

ranked_tensor(shape, element_type, encoding \\ nil)

tuple(elements, opts \\ [])

Get a tuple type.

Examples

iex> ctx = MLIR.Context.create()
iex> MLIR.Type.tuple([MLIR.Type.i32, MLIR.Type.i32], ctx: ctx) |> MLIR.to_string()
"tuple<i32, i32>"
iex> MLIR.Context.destroy(ctx)

unranked_tensor(element_type)

vector(shape, element_type)

Get a vector type creator.

Examples

iex> ctx = MLIR.Context.create()
iex> MLIR.Type.vector([1, 2, 3], MLIR.Type.i32).(ctx) |> MLIR.to_string()
"vector<1x2x3xi32>"
iex> MLIR.Context.destroy(ctx)