Charms.Intrinsic behaviour (charms v0.1.1)
Behaviour to define intrinsic functions.
Summary
Callbacks
Callback to implement an intrinsic.
Types
Link to this type
intrinsic_return()
Link to this type
ir_return()
@type ir_return() :: MLIR.Value.t() | MLIR.Operation.t()
Link to this type
opt()
@type opt() ::
{:ctx, MLIR.Context.t()}
| {:block, MLIR.Block.t() | {:loc, MLIR.Location.t()}}
Link to this type
opts()
Callbacks
Link to this callback
handle_intrinsic(atom, list, opts)
@callback handle_intrinsic(atom(), [term()], opts()) :: intrinsic_return()
Callback to implement an intrinsic.
Having different return types, there are two kinds of intrinsic functions:
- Regular: returns a MLIR value or operation.
- Higher-order: returns a function that returns a MLIR value or operation.
More on higher-order intrinsic
Higher-order intrinsic function can be variadic, which means it a list will be passed as arguments.