From 98b98ccd007ed71ab5c1def239d83cb1c8dd1f5a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 12 Aug 2026 03:58:10 +0000 Subject: [PATCH] Make OpenMP no_create a documented no-op instead of aborting fypp OMP_NOCREATE_STR called #:stop whenever no_create was set. GPU_PARALLEL, GPU_PARALLEL_LOOP and GPU_DATA expand both the ACC and OMP directive strings at fypp time and let the compile-time #if select one, so the abort fired on OpenACC-only builds too -- making a documented parameter unusable on every backend. OpenMP has no no_create equivalent, and OMP_DEFAULT_STR already emits a present-by-default mapping, so emitting nothing is the closest safe behavior. Document the clause as OpenACC-only, matching the existing GPU_CACHE note. Generated Fortran is byte-identical across all 109 .fpp files in the three targets: every call site passes no_create=None, which already took the empty-string path. Closes #1687 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_016xc51kikzrKdHDfXf8VV5p --- docs/documentation/gpuParallelization.md | 6 +++--- src/common/include/omp_macros.fpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/documentation/gpuParallelization.md b/docs/documentation/gpuParallelization.md index 3023ac788..a83eb4724 100644 --- a/docs/documentation/gpuParallelization.md +++ b/docs/documentation/gpuParallelization.md @@ -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 | @@ -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 | @@ -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 | diff --git a/src/common/include/omp_macros.fpp b/src/common/include/omp_macros.fpp index ff3d97fe5..b03bd6583 100644 --- a/src/common/include/omp_macros.fpp +++ b/src/common/include/omp_macros.fpp @@ -67,9 +67,9 @@ #: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; OMP_DEFAULT_STR already maps + #! present-by-default, so emit nothing. Aborting here would also break + #! OpenACC builds, which expand both backends before #if selects one. #:set no_create_val = '' $:no_create_val #:enddef