Skip to content

Commit fdac7d0

Browse files
authored
[OpenMPIRBuilder] NFC: Improve description of IsTargetDevice and IsGPU (#79322)
This patch tries to better explain the differences between the `IsTargetDevice` and `IsGPU` flags of the `OpenMPIRBuilderConfig`.
1 parent 683bc94 commit fdac7d0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,20 @@ BasicBlock *splitBBWithSuffix(IRBuilderBase &Builder, bool CreateBranch,
8383
/// are ones that are not dependent on the configuration.
8484
class OpenMPIRBuilderConfig {
8585
public:
86-
/// Flag for specifying if the compilation is done for embedded device code
87-
/// or host code.
86+
/// Flag to define whether to generate code for the role of the OpenMP host
87+
/// (if set to false) or device (if set to true) in an offloading context. It
88+
/// is set when the -fopenmp-is-target-device compiler frontend option is
89+
/// specified.
8890
std::optional<bool> IsTargetDevice;
8991

90-
/// Flag for specifying if the compilation is done for an accelerator.
92+
/// Flag for specifying if the compilation is done for an accelerator. It is
93+
/// set according to the architecture of the target triple and currently only
94+
/// true when targeting AMDGPU or NVPTX. Today, these targets can only perform
95+
/// the role of an OpenMP target device, so `IsTargetDevice` must also be true
96+
/// if `IsGPU` is true. This restriction might be lifted if an accelerator-
97+
/// like target with the ability to work as the OpenMP host is added, or if
98+
/// the capabilities of the currently supported GPU architectures are
99+
/// expanded.
91100
std::optional<bool> IsGPU;
92101

93102
// Flag for specifying if offloading is mandatory.

0 commit comments

Comments
 (0)