Skip to content

Commit 3d0fc6e

Browse files
committed
handle some more review comments
1 parent 258637f commit 3d0fc6e

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6920,9 +6920,9 @@ defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stri
69206920
def fhermetic_module_files : Flag<["-"], "fhermetic-module-files">, Group<f_Group>,
69216921
HelpText<"Emit hermetic module files (no nested USE association)">;
69226922

6923-
def do_concurrent_to_openmp_EQ : Joined<["-"], "fdo-concurrent-to-openmp=">,
6923+
def fdo_concurrent_to_openmp_EQ : Joined<["-"], "fdo-concurrent-to-openmp=">,
69246924
HelpText<"Try to map `do concurrent` loops to OpenMP [none|host|device]">,
6925-
Values<"none,host,device">;
6925+
Values<"none, host, device">;
69266926
} // let Visibility = [FC1Option, FlangOption]
69276927

69286928
def J : JoinedOrSeparate<["-"], "J">,

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void Flang::addCodegenOptions(const ArgList &Args,
153153
CmdArgs.push_back("-fversion-loops-for-stride");
154154

155155
Args.addAllArgs(CmdArgs,
156-
{options::OPT_do_concurrent_to_openmp_EQ,
156+
{options::OPT_fdo_concurrent_to_openmp_EQ,
157157
options::OPT_flang_experimental_hlfir,
158158
options::OPT_flang_deprecated_no_hlfir,
159159
options::OPT_fno_ppc_native_vec_elem_order,

flang/docs/DoConcurrentConversionToOpenMP.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
-->
88

9-
# `DO CONCURENT` mapping to OpenMP
9+
# `DO CONCURRENT` mapping to OpenMP
1010

1111
```{contents}
1212
---
@@ -17,20 +17,20 @@ local:
1717
This document seeks to describe the effort to parallelize `do concurrent` loops
1818
by mapping them to OpenMP worksharing constructs. The goals of this document
1919
are:
20-
* Describing how to instruct `flang` to map `DO CONCURENT` loops to OpenMP
20+
* Describing how to instruct `flang` to map `DO CONCURRENT` loops to OpenMP
2121
constructs.
2222
* Tracking the current status of such mapping.
23-
* Describing the limitations of the current implmenentation.
23+
* Describing the limitations of the current implementation.
2424
* Describing next steps.
2525
* Tracking the current upstreaming status (from the AMD ROCm fork).
2626

2727
## Usage
2828

2929
In order to enable `do concurrent` to OpenMP mapping, `flang` adds a new
3030
compiler flag: `-fdo-concurrent-to-openmp`. This flag has 3 possible values:
31-
1. `host`: this maps `do concurent` loops to run in parallel on the host CPU.
31+
1. `host`: this maps `do concurrent` loops to run in parallel on the host CPU.
3232
This maps such loops to the equivalent of `omp parallel do`.
33-
2. `device`: this maps `do concurent` loops to run in parallel on a target device.
33+
2. `device`: this maps `do concurrent` loops to run in parallel on a target device.
3434
This maps such loops to the equivalent of
3535
`omp target teams distribute parallel do`.
3636
3. `none`: this disables `do concurrent` mapping altogether. In that case, such
@@ -42,6 +42,8 @@ enable it:
4242
```
4343
flang ... -fopenmp -fdo-concurrent-to-openmp=[host|device|none] ...
4444
```
45+
For mapping to device, the target device architecture must be specified as well.
46+
See `-fopenmp-targets` and `-foffload-arch` for more info.
4547

4648
## Current status
4749

@@ -249,7 +251,7 @@ either treated as `shared` in case of mapping to `host`, or mapped into the
249251
`target` region using a `map` clause in case of mapping to `device`. The only
250252
exceptions to this are:
251253
1. the loop's iteration variable(s) (IV) of **perfect** loop nests. In that
252-
case, for each IV, we allocate a local copy as shown the by the mapping
254+
case, for each IV, we allocate a local copy as shown by the mapping
253255
examples above.
254256
1. any values that are from allocations outside the loop nest and used
255257
exclusively inside of it. In such cases, a local privatized

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static bool parseDoConcurrentMapping(Fortran::frontend::CodeGenOptions &opts,
161161
llvm::opt::ArgList &args,
162162
clang::DiagnosticsEngine &diags) {
163163
llvm::opt::Arg *arg =
164-
args.getLastArg(clang::driver::options::OPT_do_concurrent_to_openmp_EQ);
164+
args.getLastArg(clang::driver::options::OPT_fdo_concurrent_to_openmp_EQ);
165165
if (!arg)
166166
return true;
167167

0 commit comments

Comments
 (0)