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] Add the tgt_entry_info attribute #78223

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fabianmcg
Copy link
Contributor

This patch adds the omp.tgt_entry_info attribute. This attribute provides
information to identify offload entries uniquely and partially reflects the
information in the llvm::TargetRegionEntryInfo struct.

An info parameter was added to TargetOp to specify the offload entry
information from the operation explicitly. Both the host and device versions
must have the same info attribute; otherwise, the constructs won't correctly
map between each other.

This patch is required to enable JIT compilation for the OMP dialect, as
the entry array has to be fully constructed in the IR instead of using
sections to implicitly construct it.

Note: Ignore the base commits.

…entry manager

This patch adds an optional field in the create target method to store the
offload entry in a custom location and not register the entry in the entry
manager.
This change is required to enable JIT compilation in MLIR for OpenMP target
offload ops, as arrays of entries are handled differently for standalone MLIR
compilation.
This patch adds the `OffloadHandler` utility class for creating LLVM offload
entries.
LLVM offload entries hold information on offload symbols; for example, for a
GPU kernel, this includes its host address to identify the kernel and the kernel
identifier in the binary. Arrays of offload entries can be used to register
functions within the CUDA/HIP runtime. Libomptarget also uses these entries to
register OMP target offload kernels and variables.

This patch is 1/4 on introducing the `OffloadEmbeddingAttr` GPU translation
attribute.
This patch adds the `omp.tgt_entry_info` attribute. This attribute provides
information to identify offload entries uniquely and partially reflects the
information in the `llvm::TargetRegionEntryInfo` struct.

An `info` parameter was added to `TargetOp` to specify the offload entry
information from the operation explicitly. Both the host and device versions
must have the same `info` attribute; otherwise, the constructs won't correctly
map between each other.

This patch is required to enable JIT compilation for the OMP dialect, as
the entry array has to be fully constructed in the IR instead of using
sections to implicitly construct it.

Note: Ignore the base commits.
fabianmcg added a commit to fabianmcg/llvm-project that referenced this pull request Jan 16, 2024
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.

None yet

1 participant