Skip to content

Add CUDA support to feature mapping and review #107

@danielbrodie

Description

@danielbrodie

Hi @steipete, proposing first-class CUDA support in clawpatch.

clawpatch's C/C++ mapper handles generic project shapes today, and CUDA is not covered: .cu/.cuh sources are not recognized, so CUDA projects map with little coverage, and the review prompt has no CUDA-specific guidance so a kernel is reviewed with the same checklist as any other file.

Proposed scope:

Mapping (src/mappers/, src/detect.ts):

  • recognize .cu/.cuh across standalone main() files, CMake add_executable/add_library (including the legacy FindCUDA cuda_add_executable/cuda_add_library commands), and autotools targets
  • detect repositories containing CUDA sources as cuda projects
  • group source files that no build target owns into bounded, per-directory source groups
  • map CMakeLists.txt, CMakePresets.json, and configure.ac as config features
  • emit conservative C/C++/CUDA validation commands only from a project-declared signal (a root Makefile check/test target, or a CMakePresets.json build workflow); otherwise stay null
  • tag CUDA build targets and source groups with the concurrency trust boundary

Review (src/prompt.ts):

  • when a reviewed feature owns .cu/.cuh sources, add a CUDA hazard checklist to the review prompt (default mode) and the fix prompt: kernel races and synchronization, unchecked CUDA runtime calls, host/device pointer confusion, memory-access hazards, and device-memory leaks
  • detection is by file extension so mixed host/device targets are covered
  • findings use the existing categories; no schema change

I am opening a pull request with the implementation alongside this issue. It is based on the current main, includes focused tests for every behavior change, and the full CI sequence passes locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions