Skip to content

Fix GPU review findings (OpenCL RAII, CUDA 64-bit index, doc honesty) - #3

Merged
leonardoaraujosantos merged 1 commit into
mainfrom
fix/gpu-review-followups
Jul 5, 2026
Merged

leonardoaraujosantos merged 1 commit into
mainfrom
fix/gpu-review-followups

Conversation

@leonardoaraujosantos

Copy link
Copy Markdown
Contributor

Adversarial-review fixes for the GPU wind-tunnel solvers: OpenCL constructor RAII (no leak on throw), CUDA long->long long (Windows LLP64 index overflow), CUDA post-launch cudaGetLastError, and corrected a false 'CUDA validated' claim in docs/backends.md. OpenCL still matches the CPU oracle (Linf/Uin ~ 9e-6). Archives the add-gpu-wind-tunnel OpenSpec change.

Adversarial review of the GPU wind-tunnel solvers surfaced four issues:

- OpenCL: constructor was not exception-safe — a clCheck throw mid-construction
  leaked the already-acquired cl objects. Moved all release into ~Impl (RAII),
  so a partially-constructed instance still cleans up.
- CUDA: kernels used `long` for linear index arithmetic, which is 32-bit on
  LLP64 (Windows) and overflows for large grids. Switched to `long long`.
- CUDA: added cudaGetLastError() after the kernel-launch loop so a launch fault
  is caught with step attribution (parity with the OpenCL clCheck path).
- docs/backends.md: corrected a false "CUDA validated on NVIDIA hardware" claim
  (the CUDA path is authored without nvcc and validated on an NVIDIA machine).

OpenCL wind tunnel still matches the CPU oracle (Linf/Uin ~ 9e-6). Archives the
add-gpu-wind-tunnel OpenSpec change.
@leonardoaraujosantos
leonardoaraujosantos merged commit 1900858 into main Jul 5, 2026
2 of 3 checks passed
@leonardoaraujosantos
leonardoaraujosantos deleted the fix/gpu-review-followups branch July 5, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant