|
IRON 1a5eed49d3c0721a318ac369f725acc96b7c4584
|


Public Member Functions | |
| None | __init__ (self, str name, str|None object_file_name=None, str|None source_file=None, str|None source_string=None, list[type[np.ndarray]|np.dtype]|None arg_types=None, list[str]|None include_dirs=None, list[str]|None compile_flags=None, *str|None symbol_prefix=None, bool use_chess=False) |
| __call__ (self, *args, **kwargs) | |
| int | __hash__ (self) |
| bool | __eq__ (self, object other) |
| str | __repr__ (self) |
Public Member Functions inherited from iron.kernel.Kernel | |
| str | object_file_name (self) |
| None | resolve (self, ir.Location|None loc=None, ir.InsertionPoint|None ip=None) |
Public Member Functions inherited from iron.kernel.BaseKernel | |
| tuple[int,...] | arg_shape (self, int arg_index=0) |
| arg_dtype (self, int arg_index=0) | |
| int | tile_size (self, int arg_index=0) |
| list | arg_types (self) |
Public Member Functions inherited from iron.resolvable.Resolvable | |
| list | tiles (self) |
Static Public Attributes | |
| tuple | mac_dims |
| str | zero : "Kernel" |
| str | get_only : "Kernel" |
| str | put_only : "Kernel" |
| str | put_get : "Kernel" |
Protected Member Functions | |
| None | _validate_arg (self, int index, arg, expected_ty) |
| str | _content_digest (self) |
Protected Member Functions inherited from iron.kernel.BaseKernel | |
| _resolve_arg (self, int arg_index) | |
Protected Attributes | |
| _original_name | |
| _symbol_prefix | |
| _source_file | |
| _source_string | |
| _include_dirs | |
| _compile_flags | |
| _use_chess | |
| _compiled | |
| _object_file_name | |
| _arg_types | |
| _name | |
| _cached_digest | |
Protected Attributes inherited from iron.kernel.Kernel | |
| _object_file_name | |
| _op | |
| _name | |
Protected Attributes inherited from iron.kernel.BaseKernel | |
| _name | |
| _arg_types | |
| _op | |
Static Protected Attributes | |
| set | _instances = set() |
An AIE core function compiled from C/C++ source at JIT time. Each instance is registered in ``_instances`` at construction time so that the ``@jit`` decorator can discover and compile all source files before invoking the MLIR compilation pipeline. ``_instances`` is cleared at the start of each ``@jit`` call to prevent stale registrations from a previous (possibly failed) run. Use the base :class:`Kernel` class instead when you have a pre-built object file.
| None iron.kernel.ExternalFunction.__init__ | ( | self, | |
| str | name, | ||
| str | None | object_file_name = None, |
||
| str | None | source_file = None, |
||
| str | None | source_string = None, |
||
| list[type[np.ndarray] | np.dtype] | None | arg_types = None, |
||
| list[str] | None | include_dirs = None, |
||
| list[str] | None | compile_flags = None, |
||
| *str | None | symbol_prefix = None, |
||
| bool | use_chess = False |
||
| ) |
Args:
name: Symbol name of the function as it will appear in the object
file.
object_file_name: Output object file name. Defaults to
``<effective_name>.o``.
source_file: Path to a C/C++ source file on disk. Mutually
exclusive with ``source_string``.
source_string: Inline C/C++ source code. Mutually exclusive with
``source_file``.
arg_types: Type signature of the function arguments. Defaults to
None (empty list).
include_dirs: Additional ``-I`` directories passed to the chosen
compiler (Peano by default; xchesscc when ``use_chess=True``).
Defaults to None (empty list).
compile_flags: Additional flags passed verbatim to the chosen
compiler. Defaults to None (empty list).
symbol_prefix: Optional prefix for the exported symbol name. When
set, the effective symbol name becomes ``<symbol_prefix>_<name>``
and the object file is named accordingly. The original name is
preserved in ``_original_name`` for source file naming.
use_chess: When ``True``, this ExternalFunction's source is
compiled with ``xchesscc_wrapper`` instead of Peano's
``clang++``. The JIT compile orchestration auto-detects the
design-level toolchain from the registered EFs and switches
aiecc's front-end accordingly; mixing chess + peano EFs in
one design is rejected loudly because aiecc only invokes one
front-end per compile.
Reimplemented from iron.kernel.Kernel.
| iron.kernel.ExternalFunction.__call__ | ( | self, | |
| * | args, | ||
| ** | kwargs | ||
| ) |
Call with argument count and type validation before emitting MLIR. ``**kwargs`` are forwarded to the base ``BaseKernel.__call__`` and ultimately to the MLIR ``func.call`` builder.
Reimplemented from iron.kernel.BaseKernel.
| bool iron.kernel.ExternalFunction.__eq__ | ( | self, | |
| object | other | ||
| ) |
Content-based equality so hash collisions never produce false cache hits.
| int iron.kernel.ExternalFunction.__hash__ | ( | self | ) |
Content-based hash for use as a dict/set key and in cache signatures.
| str iron.kernel.ExternalFunction.__repr__ | ( | self | ) |
Content-based repr so str(ef) is stable across GC cycles. Default ``object.__repr__`` uses the recyclable memory address; two distinct EFs can then alias onto the same _compute_hash cache slot.
|
protected |
Return a 64-bit hex SHA-256 digest of this instance's content. Used by both ``__hash__`` and ``__eq__`` so the two are consistent. Memoised on the instance: source-file reads and stat() calls would otherwise run on every dict lookup and noticeably regress hot compile-cache paths. Instance state is treated as immutable after construction; mutating ``_source_*`` / ``_include_dirs`` / ``_compile_flags`` / ``_arg_types`` afterwards is not supported.
|
protected |
Validate a single argument against its expected type.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
|
static |
|
static |
|
static |