Beaver.Composer (beaver v0.4.8)

Copy Markdown

This module provide functions to compose and run passes.

Summary

Types

composer()

@type composer() :: t()

operation()

@type operation() :: Beaver.MLIR.Module.t() | Beaver.MLIR.Operation.t()

run_option()

@type run_option() ::
  {:debug, boolean()}
  | {:print, boolean()}
  | {:timing, boolean()}
  | {:verifier, boolean()}

run_result()

@type run_result() :: {:ok, any()} | {:error, String.t()}

t()

@type t() :: %Beaver.Composer{ctx: term(), op: operation(), passes: [any()]}

Functions

append(composer_or_op, pass)

init(composer, opts \\ [debug: false, print: false, timing: false, verifier: true])

nested(composer_or_op, op_name, passes)

new(composer)

run(composer, opts \\ [debug: false, print: false, timing: false, verifier: true])

@spec run(composer(), [run_option()]) :: run_result()

Run the passes on the operation.

Elixir callback safety

Native pipelines and Elixir passes use the context's shared elastic LLVM thread pool outside BEAM scheduler threads. Nested callback work can expand the pool rather than starving it.

run!(composer, opts \\ [debug: false, print: false, timing: false, verifier: true])

@spec run!(composer(), [run_option()]) :: operation()

to_pipeline(composer)