ExCubecl.Command (ExCubecl v0.4.0)

Copy Markdown View Source

A typed struct representing a pipeline command.

Fields

  • :op — the operation type (currently only :run_kernel)
  • :kernel — the kernel name (e.g. "elementwise_add")
  • :inputs — list of input buffer references
  • :output — output buffer reference
  • :params — optional map of kernel parameters (default %{})

Summary

Functions

Creates a new Command struct for running a kernel.

Returns a human-readable string representation of the command.

Types

t()

@type t() :: %ExCubecl.Command{
  inputs: [reference()],
  kernel: String.t(),
  op: :run_kernel | :filter | :overlay | :encode | :read_frame,
  output: reference(),
  params: map()
}

Functions

run_kernel(name, inputs, output, params \\ %{})

@spec run_kernel(String.t(), [reference()], reference(), map()) :: t()

Creates a new Command struct for running a kernel.

Examples

iex> cmd = ExCubecl.Command.run_kernel("elementwise_add", [input_buf], output_buf)
iex> cmd.op
:run_kernel
iex> cmd.kernel
"elementwise_add"

to_string(command)

@spec to_string(t()) :: String.t()

Returns a human-readable string representation of the command.