Skip to content

[OpenMPIRBuilder] NFC: Improve description of IsTargetDevice and IsGPU #79322

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

Merged
merged 1 commit into from
Jan 30, 2024
Merged
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
15 changes: 12 additions & 3 deletions llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down