NIF stubs for the CubeCL Rust backend.
Each function delegates to the Rust NIF implementation.
If the NIF is not loaded, returns {:error, :nif_not_loaded}.
Buffers are managed via Rustler ResourceArc — they are automatically
freed when the Elixir term is garbage collected. No manual free is needed.
Summary
Functions
@spec buffer_new(binary(), [non_neg_integer()], String.t()) :: {:ok, reference()} | {:error, term()}
@spec buffer_shape(reference()) :: {:ok, [non_neg_integer()]} | {:error, term()}
@spec buffer_size(reference()) :: {:ok, non_neg_integer()} | {:error, term()}
@spec device_count() :: {:ok, non_neg_integer()} | {:error, term()}
@spec pipeline_free(non_neg_integer()) :: :ok | {:error, term()}
@spec pipeline_new() :: {:ok, non_neg_integer()} | {:error, term()}
@spec pipeline_run(non_neg_integer()) :: {:ok, [non_neg_integer()]} | {:error, term()}
@spec poll(non_neg_integer()) :: {:ok, :pending | :running | :completed | :failed} | {:error, term()}
@spec submit(String.t()) :: {:ok, non_neg_integer()} | {:error, term()}
@spec wait(non_neg_integer()) :: :ok | {:error, term()}