[llvm] [OpenMPIRBuilder] NFC: Improve description of IsTargetDevice and IsGPU (PR #79322)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 24 08:29:28 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-openmp
Author: Sergio Afonso (skatrak)
<details>
<summary>Changes</summary>
This patch tries to better explain the differences between the `IsTargetDevice` and `IsGPU` flags of the `OpenMPIRBuilderConfig`.
---
Full diff: https://github.com/llvm/llvm-project/pull/79322.diff
1 Files Affected:
- (modified) llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h (+12-3)
``````````diff
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
index 669104307fa0e23..2288969ecc95c47 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
@@ -83,11 +83,20 @@ BasicBlock *splitBBWithSuffix(IRBuilderBase &Builder, bool CreateBranch,
/// are ones that are not dependent on the configuration.
class OpenMPIRBuilderConfig {
public:
- /// Flag for specifying if the compilation is done for embedded device code
- /// or host code.
+ /// Flag to define whether to generate code for the role of the OpenMP host
+ /// (if set to false) or device (if set to true) in an offloading context. It
+ /// is set when the -fopenmp-is-target-device compiler frontend option is
+ /// specified.
std::optional<bool> IsTargetDevice;
- /// Flag for specifying if the compilation is done for an accelerator.
+ /// Flag for specifying if the compilation is done for an accelerator. It is
+ /// set according to the architecture of the target triple and currently only
+ /// true when targeting AMDGPU or NVPTX. Today, these targets can only perform
+ /// the role of an OpenMP target device, so `IsTargetDevice` must also be true
+ /// if `IsGPU` is true. This restriction might be lifted if an accelerator-
+ /// like target with the ability to work as the OpenMP host is added, or if
+ /// the capabilities of the currently supported GPU architectures are
+ /// expanded.
std::optional<bool> IsGPU;
// Flag for specifying if offloading is mandatory.
``````````
</details>
https://github.com/llvm/llvm-project/pull/79322
More information about the llvm-commits
mailing list