Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MLIR][OpenMP] Introduce host_eval clause to omp.target #178

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

skatrak
Copy link

@skatrak skatrak commented Oct 10, 2024

This patch defines a map-like clause named host_eval used to capture host values for use inside of target regions on restricted cases:

  • As num_teams or thread_limit of a nested omp.target operation.
  • As num_threads of a nested omp.parallel operation or as bounds or steps of a nested omp.loop_nest, if it is a target SPMD kernel.

This replaces the following omp.target arguments: trip_count, num_threads, num_teams_lower, num_teams_upper and teams_thread_limit.

Since it's an entry block argument-generating clause, custom region parsers/printers and the BlockArgOpenMPOpInterface are updated.

@skatrak skatrak force-pushed the users/skatrak/target-passthrough-02-mlir branch from 44b6230 to 719e50c Compare October 11, 2024 13:10
@skatrak skatrak changed the base branch from users/skatrak/target-passthrough-01-block-args to amd-trunk-dev October 11, 2024 13:10
@skatrak skatrak force-pushed the users/skatrak/target-passthrough-02-mlir branch from 719e50c to bc6485b Compare October 22, 2024 15:47
Copy link

@bhandarkar-pranav bhandarkar-pranav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR, @skatrak. I have one nit in the code and 2-3 suggestions in the docs part of the PR. Of course, the suggestions for the docs are entirely subjective, so please take with a grain of salt. Otherwise, LGTM.

mlir/docs/Dialects/OpenMPDialect/_index.md Outdated Show resolved Hide resolved
mlir/docs/Dialects/OpenMPDialect/_index.md Outdated Show resolved Hide resolved
mlir/docs/Dialects/OpenMPDialect/_index.md Outdated Show resolved Hide resolved
mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp Show resolved Hide resolved
@skatrak skatrak force-pushed the users/skatrak/target-passthrough-02-mlir branch from bc6485b to ad391a1 Compare October 23, 2024 14:31
@skatrak
Copy link
Author

skatrak commented Oct 23, 2024

Thanks for the review @bhandarkar-pranav, your comments should be addressed now.

@skatrak skatrak force-pushed the users/skatrak/target-passthrough-02-mlir branch from ad391a1 to 595f1ae Compare October 29, 2024 14:59
This patch defines a map-like clause named `host_eval` used to capture host
values for use inside of target regions on restricted cases:
  - As `num_teams` or `thread_limit` of a nested `omp.target` operation.
  - As `num_threads` of a nested `omp.parallel` operation or as bounds or steps
of a nested `omp.loop_nest`, if it is a target SPMD kernel.

This replaces the following `omp.target` arguments: `trip_count`,
`num_threads`, `num_teams_lower`, `num_teams_upper` and `teams_thread_limit`.
@skatrak skatrak force-pushed the users/skatrak/target-passthrough-02-mlir branch from 595f1ae to f33594a Compare November 5, 2024 13:34
@skatrak skatrak merged commit 2f3acbd into amd-trunk-dev Nov 7, 2024
2 of 4 checks passed
@skatrak skatrak deleted the users/skatrak/target-passthrough-02-mlir branch November 7, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants