IRON dda37d5934b525fc5832d3d5e94037a8931956aa
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
iron.kernel.ExternalFunction Class Reference
Inheritance diagram for iron.kernel.ExternalFunction:
Inheritance graph
[legend]
Collaboration diagram for iron.kernel.ExternalFunction:
Collaboration graph
[legend]

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] arg_types=[], list[str] include_dirs=[], list[str] compile_flags=[])
 
 __call__ (self, *args, **kwargs)
 
 __hash__ (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
int tile_size (self, int arg_index=0)
 
list arg_types (self)
 

Protected Member Functions

None _validate_arg (self, int index, arg, expected_ty)
 

Protected Attributes

 _source_file
 
 _source_string
 
 _include_dirs
 
 _compile_flags
 
 _compiled
 
 _arg_types
 
 _name
 
- 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()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

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]   arg_types = [],
list[str]   include_dirs = [],
list[str]   compile_flags = [] 
)
Args:
    name: Symbol name of the function as it will appear in the object
        file.
    object_file_name: Output object file name.  Defaults to
        ``<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
        [].
    include_dirs: Additional ``-I`` directories passed to the Peano
        compiler.  Defaults to [].
    compile_flags: Additional flags passed verbatim to the Peano
        compiler.  Defaults to [].

Reimplemented from iron.kernel.Kernel.

Member Function Documentation

◆ __call__()

iron.kernel.ExternalFunction.__call__ (   self,
args,
**  kwargs 
)
Call with argument count and type validation before emitting MLIR.

Reimplemented from iron.kernel.BaseKernel.

◆ __hash__()

iron.kernel.ExternalFunction.__hash__ (   self)
Hash based on source content and compiler options for cache keying.

◆ _validate_arg()

None iron.kernel.ExternalFunction._validate_arg (   self,
int  index,
  arg,
  expected_ty 
)
protected
Validate a single argument against its expected type.

Member Data Documentation

◆ _arg_types

iron.kernel.ExternalFunction._arg_types
protected

◆ _compile_flags

iron.kernel.ExternalFunction._compile_flags
protected

◆ _compiled

iron.kernel.ExternalFunction._compiled
protected

◆ _include_dirs

iron.kernel.ExternalFunction._include_dirs
protected

◆ _instances

set iron.kernel.ExternalFunction._instances = set()
staticprotected

◆ _name

iron.kernel.ExternalFunction._name
protected

◆ _source_file

iron.kernel.ExternalFunction._source_file
protected

◆ _source_string

iron.kernel.ExternalFunction._source_string
protected

The documentation for this class was generated from the following file: