'streamtensor' Module
Introduction¶
import streamtensor
export_connectivity(module, file_object, connectivity_name=...)
¶
export_connectivity(module: MlirModule, file_object: object, connectivity_name: str = '') -> bool
Export the connectivity configuration for the given module.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
module
|
MlirModule
|
The module to export. |
required |
file_object
|
object
|
The file object to write the configuration to. |
required |
connectivity_name
|
str
|
The name of the connectivity configuration. |
...
|
Returns:
Type | Description |
---|---|
bool
|
True if the export was successful. |
export_cpp(module, file_object, top_func_name=..., omit_global_constants=...)
¶
export_cpp(module: MlirModule, file_object: object, top_func_name: str = '', omit_global_constants: bool = True) -> bool
Export the HLS C++ code for the given module.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
module
|
MlirModule
|
The module to export. |
required |
file_object
|
object
|
The file object to write the code to. |
required |
top_func_name
|
str
|
The name of the top function. |
...
|
omit_global_constants
|
bool
|
Omit global constants if true. |
...
|
Returns:
Type | Description |
---|---|
bool
|
True if the export was successful. |
export_global_binary(module, export_path)
¶
export_global_binary(module: MlirModule, export_path: str) -> bool
Export globals as binary files for the given module.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
module
|
MlirModule
|
The module to export. |
required |
export_path
|
str
|
The path to export the globals to. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the export was successful. |
get_permutation(affine_map_attr)
¶
get_permutation(affine_map_attr: MlirAttribute) -> list
Get the permutation of an AffineMap
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
affine_map_attr
|
MlirAttribute
|
The |
required |
Returns:
Type | Description |
---|---|
list
|
A list of int representing the permutation map. |
get_static_loop_ranges(linalg_op)
¶
get_static_loop_ranges(linalg_op: MlirOperation) -> list
Get the static loop tripcounts of a linalg generic operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
linalg_op
|
MlirOperation
|
The |
required |
Returns:
Type | Description |
---|---|
list
|
A list of loop tripcounts. |
post_walk_operation(self, callback)
¶
post_walk_operation(self: MlirOperation, callback: Callable[[MlirOperation], None]) -> None
Walk the operation in post-order and call the callback function for each operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
self
|
MlirOperation
|
The operation to walk. |
required |
callback
|
Callable[[MlirOperation], None]
|
The callback function to call for each operation. |
required |
register_everything(context)
¶
register_everything(context: object) -> None
Register all StreamTensor dialects, extensions, and passes with the given context.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
context
|
object
|
The |
required |
walk_operation(self, callback)
¶
walk_operation(self: MlirOperation, callback: Callable[[MlirOperation], None]) -> None
Walk the operation in pre-order and call the callback function for each operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
self
|
MlirOperation
|
The operation to walk. |
required |
callback
|
Callable[[MlirOperation], None]
|
The callback function to call for each operation. |
required |