|
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=[]) |
|
| __enter__ (self) |
|
| __exit__ (self, exc_type, exc_value, traceback) |
|
str | bin_name (self) |
|
int | tile_size (self, int arg_index=0) |
|
list | arg_types (self) |
|
None | resolve (self, ir.Location|None loc=None, ir.InsertionPoint|None ip=None) |
|
| __call__ (self, *args, **kwargs) |
|
|
None | _setup_source (self, str|None source_file, str|None source_string) |
|
◆ __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 = [] |
|
) |
| |
An ExternalFunction is a C/C++ source file that gets compiled to an object file and eventually resolves to a FuncOp.
If it is called, a CallOp will be generated.
Args:
name (str): The name of the function
object_file_name (str, optional): The name of the object file. If None, it will be name.o.
source_file (str): Path to the C/C++ source file
source_string (str): C/C++ source code as a string
arg_types (list[type[np.ndarray] | np.dtype], optional): The type signature of the function. Defaults to [].
include_dirs (list[str], optional): Additional include directories. Defaults to [].
compile_flags (list[str], optional): Additional compilation flags. Defaults to [].
Reimplemented from iron.kernel.BaseKernel.
◆ __call__()
iron.kernel.ExternalFunction.__call__ |
( |
|
self, |
|
|
* |
args, |
|
|
** |
kwargs |
|
) |
| |
◆ __enter__()
iron.kernel.ExternalFunction.__enter__ |
( |
|
self | ) |
|
◆ __exit__()
iron.kernel.ExternalFunction.__exit__ |
( |
|
self, |
|
|
|
exc_type, |
|
|
|
exc_value, |
|
|
|
traceback |
|
) |
| |
◆ _setup_source()
None iron.kernel.ExternalFunction._setup_source |
( |
|
self, |
|
|
str | None |
source_file, |
|
|
str | None |
source_string |
|
) |
| |
|
protected |
Set up the source file for compilation.
◆ arg_types()
list iron.kernel.ExternalFunction.arg_types |
( |
|
self | ) |
|
Get the argument types of the ExternalFunction.
◆ bin_name()
str iron.kernel.ExternalFunction.bin_name |
( |
|
self | ) |
|
◆ resolve()
None iron.kernel.ExternalFunction.resolve |
( |
|
self, |
|
|
ir.Location | None |
loc = None , |
|
|
ir.InsertionPoint | None |
ip = None |
|
) |
| |
◆ tile_size()
int iron.kernel.ExternalFunction.tile_size |
( |
|
self, |
|
|
int |
arg_index = 0 |
|
) |
| |
Get the tile size from the specified array argument type.
Args:
arg_index (int): Index of the argument to get tile size from. Defaults to 0.
Returns:
int: The tile size (first dimension) of the specified argument.
◆ _compile_flags
iron.kernel.ExternalFunction._compile_flags |
|
protected |
◆ _compiled
iron.kernel.ExternalFunction._compiled |
|
protected |
◆ _include_dirs
iron.kernel.ExternalFunction._include_dirs |
|
protected |
◆ _instances
iron.kernel.ExternalFunction._instances = set() |
|
staticprotected |
◆ _object_file_name
iron.kernel.ExternalFunction._object_file_name |
|
protected |
◆ _op
iron.kernel.ExternalFunction._op |
|
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: