Skip to content

Initial OpenMP/GPU support#228

Open
pbartholomew08 wants to merge 35 commits into
xcompact3d:mainfrom
pbartholomew08:omp_gpu
Open

Initial OpenMP/GPU support#228
pbartholomew08 wants to merge 35 commits into
xcompact3d:mainfrom
pbartholomew08:omp_gpu

Conversation

@pbartholomew08

Copy link
Copy Markdown
Member

This branch implements the basic offloading of data using openMP with the ability to perform the vecadd operation.

@ia267 ia267 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of things to address before merging.

Comment thread tests/omptgt/test_omptgt_allocator.f90 Outdated
Comment thread src/CMakeLists.txt Outdated
Comment thread tests/CMakeLists.txt
Comment thread src/backend/omp/target/allocator.f90 Outdated
Comment thread tests/performance/perf_cuda_reorder.f90 Outdated
Comment thread src/backend/omp/target/backend.f90 Outdated
Comment thread CMakeLists.txt
Comment thread src/backend/omp/target/allocator.f90 Outdated
Comment thread tests/CMakeLists.txt Outdated
As libx3d2_backends links libx3d2 and xcompact/tests link both the
linking order must be libx3d2_backends then libx3d2 to prevent
duplicate symbols during linking.
This is to allow initialisation of the base class whether called
by OMP/CPU or the OMP/TGT object
The code runs through the test successfully - need to confirm
offload and check for data movement
Note this is only working on AMD GPUs (although it should be supported
on NVIDIA GPUs w/Cray compiler)
The Cray environment should handle this automatically
The user must now set OMP_TGT_ARCH when building code for OpenMP
target offloading using -DOMP_TGT_ARCH
As they have a finalise procedure the constructor pattern will
cause a deallocation on the temporary object returned (Fortran lacks
copy constructors) and the received object lacks attached GPU memory
Comment thread src/backend/omp/target/allocator.f90
Comment thread src/backend/omp/target/allocator.f90

@ia267 ia267 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 small changes to be made - rest of the stuff we can do it in a separate issue.

Comment thread tests/CMakeLists.txt
Comment thread tests/CMakeLists.txt
Comment thread tests/CMakeLists.txt Outdated
@pbartholomew08

Copy link
Copy Markdown
Member Author

I believe all issues are addressed

@ia267 ia267 self-requested a review July 7, 2026 15:02

@ia267 ia267 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved - please merge

@ia267 ia267 added this to the OpenMP GPU backend milestone Jul 7, 2026
@ia267 ia267 added enhancement New feature or request core Issue affecting core mechanisms of the software labels Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issue affecting core mechanisms of the software enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants