Skip to content

Comments

Fix GPU example, compiler matrix, and AMD flang in CLAUDE.md docs#1256

Merged
sbryngelson merged 1 commit intomasterfrom
fix-claude-md-docs
Feb 24, 2026
Merged

Fix GPU example, compiler matrix, and AMD flang in CLAUDE.md docs#1256
sbryngelson merged 1 commit intomasterfrom
fix-claude-md-docs

Conversation

@sbryngelson
Copy link
Member

@sbryngelson sbryngelson commented Feb 24, 2026

User description

Summary

Follow-up to #1255. Fixes accuracy issues found during review of the CLAUDE.md and .claude/rules/ documentation:

  • Replace misleading GPU example: The GPU_PARALLEL + GPU_LOOP block macro example showed a pattern not used anywhere in the codebase (0 occurrences). Replaced with the real GPU_PARALLEL_LOOP / END_GPU_PARALLEL_LOOP pattern (750+ occurrences across 33 files). Added warning that GPU_LOOP emits empty directives on Cray and AMD compilers, causing silent serial execution.
  • Fix compiler-backend matrix: Marked Intel ifx and GNU gfortran as "Experimental" for --gpu mp (CMake has code paths but they're not CI-tested). Previously marked as "No" despite CMake support.
  • Resolve AMD flang inconsistency: AMD flang was simultaneously absent from the "four required compilers" list and listed as a GPU compiler. Now consistently described as "additionally supported for GPU builds but not in the CI matrix" across all three files.

Test plan

  • Documentation-only change — no code impact
  • Verify GPU macro example matches real codebase patterns
  • Verify compiler matrix matches CMakeLists.txt support

🤖 Generated with Claude Code


CodeAnt-AI Description

Fix GPU example and clarify compiler/GPU support across docs

What Changed

  • Replaced a misleading GPU_PARALLEL + GPU_LOOP example with the actual GPU_PARALLEL_LOOP / END_GPU_PARALLEL_LOOP pattern used across the codebase
  • Added explicit warning that GPU_LOOP emits empty directives on Cray and AMD compilers, which can cause silent serial execution for spatial loops
  • Clarified that GPU_PARALLEL is intended for scalar reductions, not for spatial loop parallelism
  • Marked CI-gated compilers (gfortran, nvfortran, Cray ftn, Intel ifx) and noted AMD flang is supported for OpenMP/GPU builds but is not part of the CI matrix
  • Updated compiler matrix to show GNU gfortran and Intel ifx as "Experimental" for OpenMP target offload and adjusted entries for AMD flang

Impact

✅ Clearer GPU loop guidance
✅ Fewer silent serial executions on Cray/AMD
✅ Clearer compiler support and CI expectations

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • Documentation
    • Updated compiler support guidance to clarify CI-gated compilers and expanded AMD flang availability for GPU builds.
    • Clarified GPU_PARALLEL macro semantics and updated guidance for scalar reductions and spatial loop patterns.
    • Refreshed compiler compatibility matrix with current OpenACC and OpenMP CPU/GPU support status.

- Replace misleading GPU_PARALLEL+GPU_LOOP example with real
  GPU_PARALLEL_LOOP pattern (750+ uses in codebase); add warning
  that GPU_LOOP emits empty directives on Cray/AMD compilers
- Mark Intel ifx and GNU gfortran as Experimental for --gpu mp
  (CMake has code paths but not CI-tested or fully supported)
- Clarify AMD flang as additionally supported but not CI-gated,
  consistently across CLAUDE.md, common-pitfalls.md, gpu-and-mpi.md
- Clarify GPU_PARALLEL is for scalar reductions, not spatial loops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 24, 2026 01:47
@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 24, 2026

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

📝 Walkthrough

Walkthrough

This PR updates documentation across three files to reflect changes in compiler support and GPU macro usage patterns. Updates include establishing a CI-gated compiler list (gfortran, nvfortran, Cray ftn, Intel ifx), adding AMD flang GPU support notes, and clarifying GPU_PARALLEL_LOOP macro guidance with deprecation of older block patterns.

Changes

Cohort / File(s) Summary
Compiler & CI Matrix Documentation
.claude/rules/common-pitfalls.md, CLAUDE.md
Updated CI-gated compiler list to explicitly name four guaranteed pass compilers; added AMD flang GPU build support note; replaced generic compiler requirement statements with CI-focused narrative.
GPU Macro & Compiler Guidance
.claude/rules/gpu-and-mpi.md
Clarified GPU_PARALLEL semantics for scalar reductions; replaced legacy block usage examples with GPU_PARALLEL_LOOP / END_GPU_PARALLEL_LOOP patterns; updated compiler matrix with per-compiler OpenACC/OpenMP status and experimental notes; reinforced mandatory use of Fypp GPU_\* macros.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

Review effort 2/5, size:M

Poem

🐰 A bunny hops through docs with glee,
Four compilers CI-gated, we agree!
AMD flang joins the GPU crew,
GPU_PARALLEL_LOOP—the new way through!
Macro wisdom spreads, both far and near. 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: fixing GPU examples, updating the compiler matrix, and clarifying AMD flang support across documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed PR description comprehensively covers all required template sections with clear motivation, specific changes, and appropriate test plan acknowledgment.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-claude-md-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeant-ai codeant-ai bot added the size:M This PR changes 30-99 lines, ignoring generated files label Feb 24, 2026
@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 24, 2026

CodeAnt AI finished reviewing your PR.

@sbryngelson sbryngelson merged commit b528867 into master Feb 24, 2026
24 of 25 checks passed
@sbryngelson sbryngelson deleted the fix-claude-md-docs branch February 24, 2026 01:50
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/rules/gpu-and-mpi.md:
- Around line 78-79: The sentence "AMD flang is additionally supported for GPU
builds" is imprecise; update the prose in `.claude/rules/gpu-and-mpi.md` to
explicitly limit AMD flang support to OpenMP target/offload GPU builds (i.e.,
`--gpu mp` / OpenMP target offload), matching the table and the sibling docs
(`common-pitfalls.md`, `CLAUDE.md`); replace the broad phrase with wording such
as "AMD flang is supported only for OpenMP target (--gpu mp) GPU/offload builds"
so the text and table are consistent.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7997663 and 897d03d.

📒 Files selected for processing (3)
  • .claude/rules/common-pitfalls.md
  • .claude/rules/gpu-and-mpi.md
  • CLAUDE.md

Comment on lines +78 to +79
CI-gated compilers (must always pass): gfortran, nvfortran, Cray ftn, Intel ifx.
AMD flang is additionally supported for GPU builds but not in the CI matrix.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor imprecision in AMD flang scope description.

Line 79 says AMD flang is additionally supported for GPU builds, but AMD flang is No for --gpu acc (see the table immediately below). The sibling files are more precise: common-pitfalls.md says `--gpu mp` builds and CLAUDE.md says OpenMP target offload GPU builds. A reader skimming the prose without the table could infer broader GPU coverage than is actually supported.

✏️ Suggested wording fix
-AMD flang is additionally supported for GPU builds but not in the CI matrix.
+AMD flang is additionally supported for OpenMP target offload (`--gpu mp`) builds but not in the CI matrix.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
CI-gated compilers (must always pass): gfortran, nvfortran, Cray ftn, Intel ifx.
AMD flang is additionally supported for GPU builds but not in the CI matrix.
CI-gated compilers (must always pass): gfortran, nvfortran, Cray ftn, Intel ifx.
AMD flang is additionally supported for OpenMP target offload (`--gpu mp`) builds but not in the CI matrix.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/rules/gpu-and-mpi.md around lines 78 - 79, The sentence "AMD flang
is additionally supported for GPU builds" is imprecise; update the prose in
`.claude/rules/gpu-and-mpi.md` to explicitly limit AMD flang support to OpenMP
target/offload GPU builds (i.e., `--gpu mp` / OpenMP target offload), matching
the table and the sibling docs (`common-pitfalls.md`, `CLAUDE.md`); replace the
broad phrase with wording such as "AMD flang is supported only for OpenMP target
(--gpu mp) GPU/offload builds" so the text and table are consistent.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR corrects inaccuracies in the CLAUDE.md documentation and related rule files regarding GPU programming patterns, compiler support, and AMD flang's role in the project. The changes ensure documentation accurately reflects the codebase's actual implementation patterns and CI requirements.

Changes:

  • Replaced a non-existent GPU macro pattern with the actual GPU_PARALLEL_LOOP pattern used 750+ times in the codebase
  • Updated compiler-backend matrix to mark Intel ifx and GNU gfortran as "Experimental" for GPU builds instead of "No"
  • Clarified AMD flang as additionally supported for GPU builds but not CI-gated, resolving inconsistency across all three documentation files

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
CLAUDE.md Added AMD flang clarification and updated compiler portability statement
.claude/rules/gpu-and-mpi.md Replaced GPU example with real pattern, updated compiler matrix, and added AMD flang context
.claude/rules/common-pitfalls.md Clarified CI-gated compilers and AMD flang support

@github-actions
Copy link

Claude Code Review

Head SHA: 897d03d

3 files changed:

  1. CLAUDE.md
  2. .claude/rules/common-pitfalls.md
  3. .claude/rules/gpu-and-mpi.md

Summary of changes

  • Updated CLAUDE.md to clarify that gfortran, nvfortran, Cray ftn, and Intel ifx are CI-gated compilers, and added AMD flang as "additionally supported for OpenMP target offload GPU builds"
  • Replaced the misleading GPU_PARALLEL + GPU_LOOP block macro example with the actual GPU_PARALLEL_LOOP / END_GPU_PARALLEL_LOOP pattern (750+ occurrences in the codebase)
  • Added a critical warning that GPU_LOOP emits empty directives on Cray and AMD compilers, causing silent serial execution
  • Fixed the compiler-backend matrix: marked GNU gfortran and Intel ifx --gpu mp support as "Experimental"
  • Aligned AMD flang descriptions across all three files to consistently call it "additionally supported" but "not in the CI matrix"

Findings

Issue 1 — AMD flang IS CI-gated (documentation contradicts the actual CI configuration)

Files: CLAUDE.md (line 7), .claude/rules/common-pitfalls.md (line 40), .claude/rules/gpu-and-mpi.md (line 79)

All three modified files now state that AMD flang is "additionally supported for GPU builds but not in the CI matrix." This is factually incorrect.

.github/workflows/test.yml includes two frontier_amd matrix entries in the self job (lines 194-200):

- runner:       'frontier'
  cluster:      'frontier_amd'
  cluster_name: 'Oak Ridge | Frontier (AMD)'
  device: 'gpu'
  interface: 'omp'
- runner:       'frontier'
  cluster:      'frontier_amd'
  cluster_name: 'Oak Ridge | Frontier (AMD)'
  device: 'cpu'
  interface: 'none'

The self job has continue-on-error: false (line 156), so AMD flang failures on Frontier do block PRs — same as the other four CI-gated compilers. AMD flang should be listed alongside gfortran, nvfortran, Cray ftn, and Intel ifx as a CI-gated compiler in all three files.


Issue 2 — Intel ifx "CI-gated" vs "Experimental (SPIR64)" creates a misleading contradiction

File: .claude/rules/gpu-and-mpi.md

The new preamble states: "CI-gated compilers (must always pass): gfortran, nvfortran, Cray ftn, Intel ifx."

The matrix table then marks Intel ifx + --gpu mp as "Experimental (SPIR64)". However, the CI workflow has no Intel GPU runner and never invokes --gpu mp for ifx — Intel ifx is only tested in CPU-only mode. A developer reading "CI-gated (must always pass)" could reasonably conclude that Intel ifx GPU builds are also gated, which is incorrect. The preamble or table should clarify that "CI-gated" for Intel ifx means CPU-only builds only.


Improvement opportunities

  1. .claude/rules/common-pitfalls.md — After removing the old "GPU builds only work with nvfortran, Cray ftn, and AMD flang" line, the "Compiler-Specific Issues" section no longer gives any guidance on which compilers support GPU builds. Consider a brief cross-reference to the compiler matrix in gpu-and-mpi.md to preserve actionable pitfall coverage.

  2. .claude/rules/gpu-and-mpi.md — NVIDIA nvfortran --gpu mp is marked plain "Yes" while gfortran and ifx are "Experimental". If the intent of this PR was to mark all non-primary-tested combinations explicitly, it is worth verifying whether nvfortran OpenMP offload is as well-exercised in CI as Cray ftn (the listed primary).

  3. .claude/rules/gpu-and-mpi.md — The existing line 10 (--gpu mp note listing "Cray ftn, AMD flang") omits NVIDIA nvfortran from the parenthetical. This was pre-existing but is related to the same compiler matrix accuracy theme the PR addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

1 participant