diff --git a/lib/beaver/mlir/capi.ex b/lib/beaver/mlir/capi.ex index 7d5f40c6..1cecc5e3 100644 --- a/lib/beaver/mlir/capi.ex +++ b/lib/beaver/mlir/capi.ex @@ -10,10 +10,10 @@ defmodule Beaver.MLIR.CAPI do - `mlirPassManagerRunOnOp`: the MLIR pass implemented in Elixir. - `mlirOperationVerify`, `mlirAttributeParseGet`, `mlirTypeParseGet`, `mlirModuleCreateParse`: the diagnostic handler implemented in Elixir. """ - @nifs use Kinda.CodeGen, - with: Beaver.MLIR.CAPI.CodeGen, - root: __MODULE__, - forward: Beaver.Native + use Kinda.CodeGen, + with: Beaver.MLIR.CAPI.CodeGen, + root: __MODULE__, + forward: Beaver.Native @on_load :load_nif @@ -56,8 +56,7 @@ defmodule Beaver.MLIR.CAPI do def beaver_raw_registered_ops(_ctx), do: :erlang.nif_error(:not_loaded) def beaver_raw_registered_dialects(_ctx), do: :erlang.nif_error(:not_loaded) - @nifs @nifs ++ - (for f <- ~w{ + for f <- ~w{ StringRef Attribute Type @@ -72,10 +71,10 @@ defmodule Beaver.MLIR.CAPI do Identifier Diagnostic } do - f = :"beaver_raw_to_string_#{f}" - def unquote(f)(_), do: :erlang.nif_error(:not_loaded) - {f, 1} - end) + f = :"beaver_raw_to_string_#{f}" + def unquote(f)(_), do: :erlang.nif_error(:not_loaded) + {f, 1} + end def beaver_raw_get_string_ref(_), do: :erlang.nif_error(:not_loaded) def beaver_raw_read_opaque_ptr(_, _), do: :erlang.nif_error(:not_loaded) @@ -96,27 +95,4 @@ defmodule Beaver.MLIR.CAPI do def beaver_raw_mlir_type_of_enif_obj(_ctx, _obj), do: :erlang.nif_error(:not_loaded) def beaver_raw_string_printer_callback(), do: :erlang.nif_error(:not_loaded) def beaver_raw_string_printer_flush(_sp), do: :erlang.nif_error(:not_loaded) - - @nifs @nifs ++ - [ - beaver_raw_create_mlir_pass: 5, - beaver_raw_logical_mutex_token_signal_success: 1, - beaver_raw_logical_mutex_token_signal_failure: 1, - beaver_raw_registered_ops: 1, - beaver_raw_registered_dialects: 1, - beaver_raw_get_string_ref: 1, - beaver_raw_read_opaque_ptr: 2, - beaver_raw_deallocate_opaque_ptr: 1, - beaver_raw_get_null_ptr: 0, - beaver_raw_context_attach_diagnostic_handler: 2, - beaver_raw_jit_invoke_with_terms: 3, - beaver_raw_jit_invoke_with_terms_cpu_bound: 3, - beaver_raw_jit_invoke_with_terms_io_bound: 3, - beaver_raw_jit_register_enif: 1, - beaver_raw_enif_signatures: 1, - beaver_raw_enif_functions: 0, - beaver_raw_mlir_type_of_enif_obj: 2, - beaver_raw_string_printer_callback: 0, - beaver_raw_string_printer_flush: 1 - ] end