Skip to content

Add OpenMP versions of axpby, bincount, dwconv, pointerchase, and sundials - #310

Open
zjin-lcf wants to merge 8 commits into
masterfrom
new-omp-programs
Open

Add OpenMP versions of axpby, bincount, dwconv, pointerchase, and sundials#310
zjin-lcf wants to merge 8 commits into
masterfrom
new-omp-programs

Conversation

@zjin-lcf

@zjin-lcf zjin-lcf commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Adds OpenMP target-offload versions of five existing benchmarks, each with the usual Makefile, Makefile.aomp, Makefile.nvc, and CMakeLists.txt.

  • axpby-omp and pointerchase-omp are self-contained.
  • bincount-omp reuses bincount-cuda/reference.h for verification.
  • sundials-omp compiles main.cpp and utils.cpp from sundials-cuda and provides its own kernels.cpp.
  • dwconv-omp reuses dwconv-cuda/reference.h for verification.

Two changes to existing benchmarks are included because the new programs depend on them:

  • [dwconv] replaces checksum reporting with reference-based validation. dwconv-cuda/reference.h is new here, and dwconv-omp includes it, so it cannot be split out. The CUDA, HIP, and SYCL versions are updated to use the same reference so all four report PASS/FAIL consistently.
  • [sundials-cuda] drops "CUDA" from a printed message, since sundials-omp compiles that same main.cpp.

Test plan

  • All five OpenMP programs build with AOMP (ROCm 7.1.1, amdclang++, ARCH=gfx90a).
  • dwconv-hip builds with hipcc; dwconv-sycl builds for the CUDA backend.
  • Runtime verification on an AMD GPU (no AMD device on the machine used here).
@zjin-lcf

zjin-lcf commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

@spophale @mhalk could you please review these new OpenMP programs? Thanks.

@zjin-lcf zjin-lcf self-assigned this Aug 7, 2026
@zjin-lcf
zjin-lcf requested a review from Geekdude August 13, 2026 20:30
@Geekdude
Geekdude requested a balanced review from Copilot August 13, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds OpenMP target-offload implementations for five existing benchmarks.

Changes:

  • Adds axpby, bincount, dwconv, pointerchase, and SUNDIALS OpenMP variants.
  • Adds portable build configurations for Intel, AOMP, NVHPC, and CMake.
  • Introduces shared reference-based DWConv validation across backends.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/sundials-omp/Makefile.nvc Adds NVHPC build.
src/sundials-omp/Makefile.aomp Adds AOMP build.
src/sundials-omp/Makefile Adds Intel build.
src/sundials-omp/LICENSE Adds licensing information.
src/sundials-omp/kernels.cpp Implements OpenMP SUNDIALS kernels.
src/sundials-omp/CMakeLists.txt Registers the CMake target.
src/sundials-cuda/main.cpp Makes the shared banner backend-neutral.
src/pointerchase-omp/Makefile.nvc Adds NVHPC build.
src/pointerchase-omp/Makefile.aomp Adds AOMP build.
src/pointerchase-omp/Makefile Adds Intel build.
src/pointerchase-omp/main.cpp Implements OpenMP pointer chasing.
src/pointerchase-omp/CMakeLists.txt Registers the CMake target.
src/dwconv-sycl/Makefile Adds reference-header support.
src/dwconv-sycl/main.cpp Adds reference validation.
src/dwconv-sycl/CMakeLists.txt Adds the reference include path.
src/dwconv-omp/Makefile.nvc Adds NVHPC build.
src/dwconv-omp/Makefile.aomp Adds AOMP build.
src/dwconv-omp/Makefile Adds Intel build.
src/dwconv-omp/main.cpp Implements OpenMP depthwise convolution.
src/dwconv-omp/CMakeLists.txt Registers the CMake target.
src/dwconv-hip/Makefile Adds reference-header support.
src/dwconv-hip/main.cu Adds reference validation.
src/dwconv-hip/CMakeLists.txt Adds the reference include path.
src/dwconv-cuda/reference.h Adds shared CPU reference logic.
src/dwconv-cuda/Makefile Tracks the reference header.
src/dwconv-cuda/main.cu Adds reference validation.
src/bincount-omp/Makefile.nvc Adds NVHPC build.
src/bincount-omp/Makefile.aomp Adds AOMP build.
src/bincount-omp/Makefile Adds Intel build and precision flags.
src/bincount-omp/main.cpp Implements OpenMP histogram kernels.
src/bincount-omp/CMakeLists.txt Registers the CMake target.
src/axpby-omp/Makefile.nvc Adds NVHPC build.
src/axpby-omp/Makefile.aomp Adds AOMP build.
src/axpby-omp/Makefile Adds Intel build.
src/axpby-omp/main.cpp Implements chunked OpenMP AXPBY.
src/axpby-omp/CMakeLists.txt Registers the CMake target.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/pointerchase-omp/main.cpp Outdated
Comment thread src/bincount-omp/main.cpp Outdated
// Per-team histogram. Declaring it in the teams region makes it
// shared by the team's threads and lets the compiler place it in
// team-local memory (LDS/SLM).
output_t smem[sharedMemoryCapacity / sizeof(output_t)];

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The bincount-omp example is updated without using OMP5 dynamic allocation.

Comment thread src/bincount-omp/CMakeLists.txt
Comment thread src/dwconv-omp/main.cpp
Comment thread src/dwconv-cuda/main.cu
Comment thread src/dwconv-hip/main.cu
Comment thread src/dwconv-sycl/main.cpp
Remove the nonportable pointer-chase benchmark, make bincount adapt across GPU memory hierarchies, and ensure DWConv validation rejects NaNs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants