Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
98b98cc
Make OpenMP no_create a documented no-op instead of aborting fypp
claude Aug 12, 2026
d7736ff
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
engineer-scientist Aug 12, 2026
3a8410b
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
engineer-scientist Aug 13, 2026
23eec44
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
sbryngelson Aug 15, 2026
a7907c9
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
engineer-scientist Aug 16, 2026
89c0f71
fix(omp): do not emit a clause-less `!$omp target data`, and correct …
sbryngelson Aug 18, 2026
d384a0d
Drop the ellipses from the new fypp comments; lint_source flags them …
sbryngelson Aug 18, 2026
2317a81
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
sbryngelson Aug 19, 2026
67270fd
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
sbryngelson Aug 20, 2026
e064f1f
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
sbryngelson Aug 22, 2026
a2459a9
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
sbryngelson Aug 23, 2026
ec99e88
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
sbryngelson Aug 24, 2026
daa2335
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
sbryngelson Aug 27, 2026
3bdac82
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
sbryngelson Aug 27, 2026
845b3a9
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
sbryngelson Aug 28, 2026
7f391aa
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
sbryngelson Aug 28, 2026
bf01a89
Fix inaccurate defaultmap comment and narrow the empty-clause guard
sbryngelson Aug 29, 2026
f13e62a
Merge branch 'master' into claude/mflowcode-issue-1687-yic86y
engineer-scientist Aug 30, 2026
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
6 changes: 3 additions & 3 deletions docs/documentation/gpuParallelization.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ This wraps the lines in `code` with parallelization calls to openACC or openMP,
| `copyinReadOnly` | string list | None | Allocates and copies readonly data to GPU and then deallocated on exit |
| `copyout` | string list | None | Allocates data on GPU on entrance and then deallocates and copies to CPU on exit |
| `create` | string list | None | Allocates data on GPU on entrance and then deallocates on exit |
| `no_create` | string list | None | Use data in CPU memory unless data is already in GPU memory |
| `no_create` | string list | None | Use data in CPU memory unless data is already in GPU memory (OpenACC only) |
| `present` | string list | None | Data that must be present in GPU memory. Increment counter on entrance, decrement on exit |
| `deviceptr` | string list | None | Pointer variables that are already allocated on GPU memory |
| `attach` | string list | None | Attaches device pointer to device targets on entrance, then detach on exit |
Expand Down Expand Up @@ -184,7 +184,7 @@ Uses FYPP call directive using `#:call`
| `copyinReadOnly` | string list | None | Allocates and copies readonly data to GPU and then deallocated on exit |
| `copyout` | string list | None | Allocates data on GPU on entrance and then deallocates and copies to CPU on exit |
| `create` | string list | None | Allocates data on GPU on entrance and then deallocates on exit |
| `no_create` | string list | None | Use data in CPU memory unless data is already in GPU memory |
| `no_create` | string list | None | Use data in CPU memory unless data is already in GPU memory (OpenACC only) |
| `present` | string list | None | Data that must be present in GPU memory. Increment counter on entrance, decrement on exit |
| `deviceptr` | string list | None | Pointer variables that are already allocated on GPU memory |
| `attach` | string list | None | Attaches device pointer to device targets on entrance, then detach on exit |
Expand Down Expand Up @@ -247,7 +247,7 @@ Uses FYPP call directive using `#:call`
| `copyinReadOnly` | string list | None | Allocates and copies a readonly variable to GPU and then deallocated on exit |
| `copyout` | string list | None | Allocates data on GPU on entrance and then deallocates and copies to CPU on exit |
| `create` | string list | None | Allocates data on GPU on entrance and then deallocates on exit |
| `no_create` | string list | None | Use data in CPU memory unless data is already in GPU memory |
| `no_create` | string list | None | Use data in CPU memory unless data is already in GPU memory (OpenACC only) |
| `present` | string list | None | Data that must be present in GPU memory. Increment counter on entrance, decrement on exit |
| `deviceptr` | string list | None | Pointer variables that are already allocated on GPU memory |
| `attach` | string list | None | Attaches device pointer to device targets on entrance, then detach on exit |
Expand Down
36 changes: 31 additions & 5 deletions src/common/include/omp_macros.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@
#:enddef

#:def OMP_NOCREATE_STR(no_create)
#:if no_create is not None
#:stop 'no_create is not supported yet'
#:endif
#! OpenMP has no no_create equivalent, so this is a documented no-op: the variable is
#! left to whatever mapping the enclosing region already applies to it. Note that is
#! NOT equivalent to no_create on most targets -- OMP_DEFAULT_STR emits nothing unless
#! the caller passes default='present', and even then only CCE maps allocatables and
#! pointers as present; NVHPC/PGI and the fallback map them tofrom, which copies rather
#! than reuses, and LLVMFlang emits nothing at all.
#! Do NOT #:stop here: GPU_DATA expands both backends before #if selects one, so
#! aborting would break OpenACC builds, where no_create is supported natively.
#:set no_create_val = ''
$:no_create_val
#:enddef
Expand Down Expand Up @@ -275,11 +280,32 @@
& no_create_val.strip('\n') + present_val.strip('\n') + &
& deviceptr_val.strip('\n') + attach_val.strip('\n') + &
& default_val.strip('\n')
#! An OpenMP `target data` region must carry at least one map, use_device_ptr or
#! use_device_addr clause. no_create contributes none (it is a no-op here), and
#! `default` is None by default, so GPU_DATA(no_create=x) with no other clause left
#! clause_val empty and emitted a bare `!$omp target data` that no compiler accepts.
#! Emit the body alone in that case -- a data region with nothing to map has nothing
#! to do, which is what GPU_DATA's own #else branch already does when neither backend
#! is enabled. A #:stop is not an option here, for the reason in OMP_NOCREATE_STR.
#! Only no_create earns that silence. If the caller asked for some other clause and
#! the backend produced nothing for it -- default='present' on LLVMFlang, where
#! OMP_DEFAULT_STR returns an empty string -- keep emitting the bare directive so the
#! build fails loudly rather than silently discarding a region that was asked for.
#:set other_clause_requested = copy is not None or copyin is not None or &
& copyinReadOnly is not None or copyout is not None or create is not None or &
& present is not None or deviceptr is not None or attach is not None or &
& default is not None
#:set emitted_clause = clause_val.strip() != '' or extraOmpArgs_val.strip() != ''
#:set has_clauses = emitted_clause or other_clause_requested
#:set omp_directive = '!$omp target data ' + clause_val + extraOmpArgs_val.strip('\n')
#:set end_omp_directive = '!$omp end target data'
$:omp_directive
#:if has_clauses
$:omp_directive
#:endif
$:code
$:end_omp_directive
#:if has_clauses
$:end_omp_directive
#:endif
#:enddef

#:def OMP_ENTER_DATA(copyin=None, copyinReadOnly=None, create=None, attach=None, extraOmpArgs=None)
Expand Down
Loading