Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion projects/eudsl-python-extras/mlir/extras/runtime/passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def acc_bind_routine(self, device_type: "mlir::acc::DeviceType" = None):
For calls inside offload regions that target a function with an
`acc routine` directive and a `bind(name)` clause, rewrite the
call to use the bound symbol so device code calls the correct
call target.
call target. String-valued bind targets must first be created by
`acc-materialize-routine-bind-targets`.

Args:
device_type: Target device type. One use case is ensuring that device_type-specific clauses are considered. Another is device-specific specializations.
Expand Down Expand Up @@ -368,6 +369,24 @@ def acc_loop_tiling(self, default_tile_size: int = None):
self.add_pass("acc-loop-tiling", **{"default-tile-size": default_tile_size})
return self

def acc_materialize_routine_bind_targets(
self, device_type: "mlir::acc::DeviceType" = None
):
"""Materialize string-bound ACC routine call targets

Materialize declarations for string-valued `acc routine bind` targets in
the current symbol table. This parent-level pass must run before
`acc-bind-routine`, which can then rewrite calls in parallel without
mutating a parent operation.

Args:
device_type: Target device type. One use case is ensuring that device_type-specific clauses are considered. Another is device-specific specializations.
"""
self.add_pass(
"acc-materialize-routine-bind-targets", **{"device-type": device_type}
)
return self

def acc_recipe_materialization(self):
"""Materialize OpenACC private, firstprivate and reduction recipes

Expand Down
21 changes: 20 additions & 1 deletion projects/mlir-python-mcp/mlir_python_mcp/passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def acc_bind_routine(self, device_type: "mlir::acc::DeviceType" = None):
For calls inside offload regions that target a function with an
`acc routine` directive and a `bind(name)` clause, rewrite the
call to use the bound symbol so device code calls the correct
call target.
call target. String-valued bind targets must first be created by
`acc-materialize-routine-bind-targets`.

Args:
device_type: Target device type. One use case is ensuring that device_type-specific clauses are considered. Another is device-specific specializations.
Expand Down Expand Up @@ -368,6 +369,24 @@ def acc_loop_tiling(self, default_tile_size: int = None):
self.add_pass("acc-loop-tiling", **{"default-tile-size": default_tile_size})
return self

def acc_materialize_routine_bind_targets(
self, device_type: "mlir::acc::DeviceType" = None
):
"""Materialize string-bound ACC routine call targets

Materialize declarations for string-valued `acc routine bind` targets in
the current symbol table. This parent-level pass must run before
`acc-bind-routine`, which can then rewrite calls in parallel without
mutating a parent operation.

Args:
device_type: Target device type. One use case is ensuring that device_type-specific clauses are considered. Another is device-specific specializations.
"""
self.add_pass(
"acc-materialize-routine-bind-targets", **{"device-type": device_type}
)
return self

def acc_recipe_materialization(self):
"""Materialize OpenACC private, firstprivate and reduction recipes

Expand Down
2 changes: 1 addition & 1 deletion third_party/llvm-project
Submodule llvm-project updated 1093 files
Loading