[ingress][mlir-gen] Merge gpu payload generation methods to mlir-gen#61
[ingress][mlir-gen] Merge gpu payload generation methods to mlir-gen#61
Conversation
|
|
||
|
|
||
| def convert_datatype(input, output): | ||
| in_width = input.type.element_type.width |
There was a problem hiding this comment.
Maybe assert that truncf/extf are valid, or rename the func so that it doesn't sound as if it can do arbitrary conversion.
|
|
||
| @func.func(memref_dyn_t, name="gpu_dealloc_" + suffix) | ||
| def dealloc_func(memref): | ||
| @func_cif(memref_dyn_t, name="gpu_dealloc_" + suffix) |
There was a problem hiding this comment.
I wonder if we can come up with a less fragile way of relying on the generated function name. The payload function name is parametrizable, this here (as well as other util funcs) are hard-coded here and "guessed" on usage. Not a show-stopper, but the current approach is not very nice (same in the mlp-mpi example and probably others).
There was a problem hiding this comment.
Yes, I agree. At least when with respect to alloc/dealloc functions I hope a MemoryManager abstraction will fix this. The manager creates the helper funcs and also calls them, so the naming scheme is defined in one single place.
adam-smnk
left a comment
There was a problem hiding this comment.
Good reorg, perfectly fits the mlir-gen module.
Merges "gpu" payload generation methods to mlir-gen.
ingress/gpu/*files toingress/mlir_gen/and refactored code to use shared methods.