Skip to content

fix: remove dead GPU dispatch slot — 42 unreachable lambdas, 1,704 lines#24

Merged
OldCrow merged 1 commit intomainfrom
hotfix/remove-gpu-dispatch-dead-code
May 7, 2026
Merged

fix: remove dead GPU dispatch slot — 42 unreachable lambdas, 1,704 lines#24
OldCrow merged 1 commit intomainfrom
hotfix/remove-gpu-dispatch-dead-code

Conversation

@OldCrow
Copy link
Copy Markdown
Owner

@OldCrow OldCrow commented May 7, 2026

Summary

Removes the dead GPU dispatch slot that was left as unreachable code after GPU_ACCELERATED was dropped from the Strategy enum. GPU dispatch was abandoned due to platform ISA fragmentation (Metal / CUDA / Vulkan) and a dependency on the table-driven dispatch refactor planned in Phase 5/7. The design rationale and prerequisites for any future GPU backend are captured in issue #23.

Changes

include/core/dispatch_utils.h

All 9 distribution files (beta, chi_squared, discrete, exponential, gamma, gaussian, poisson, student_t, uniform)

  • Remove the 5th lambda argument from every autoDispatch and executeWithStrategy call site — 42 GPU lambdas deleted, 1,704 lines removed
  • chi_squared has no batch dispatch (delegates to gamma_) and was unaffected

No behaviour change

The GPU lambda slot was unreachable: the Strategy enum had no GPU_ACCELERATED value and executeStrategy was already discarding the argument via (void). This is a pure dead-code removal.

Build note

The CMake build shim (build/include_shim/) is populated at configure time via copy_directory. Editing a header and running make directly requires either a cmake re-run or a manual cp of the changed header to the shim. This was discovered during this PR and is documented in the commit message.

Testing

  • 31/31 correctness tests pass
  • All pre-commit hooks pass (clang-format, copyright, include order)

Closes #23


Conversation: https://app.warp.dev/conversation/aed97ef4-35cf-4a9d-ab39-264b97f3c2f4

Co-Authored-By: Oz oz-agent@warp.dev

…tions

The GPU_ACCELERATED strategy was removed from the Strategy enum in a
previous cleanup pass. The GpuAcceleratedFunc lambda parameter was
retained in dispatch_utils.h under a (void) cast for ABI compatibility.
This removes it entirely:

- dispatch_utils.h: drop GpuAcceleratedFunc template parameter from
  autoDispatch, executeWithStrategy, and executeStrategy; remove the
  (void)gpu_accelerated_func no-op; update doc comments; add reference
  to issue #23 for future GPU backend design rationale

- All 9 distribution files: remove the 5th (GPU) lambda argument from
  every autoDispatch and executeWithStrategy call site (42 lambdas
  removed across beta, chi_squared, discrete, exponential, gamma,
  gaussian, poisson, student_t, uniform)

No behaviour change: the GPU lambda was unreachable code (the Strategy
enum had no GPU_ACCELERATED value). chi_squared has no batch dispatch
lambdas (it delegates to gamma_) and was unaffected.

Note: the build shim at build/include_shim/ is a cmake-configure-time
copy of include/; editing headers and running make directly requires
either a cmake re-run or a manual cp of the changed header to the shim.

Closes #23 (issue tracks future GPU backend prerequisites)

Co-Authored-By: Oz <oz-agent@warp.dev>
@OldCrow OldCrow merged commit c755a7e into main May 7, 2026
26 checks passed
@OldCrow OldCrow deleted the hotfix/remove-gpu-dispatch-dead-code branch May 7, 2026 01:27
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.

feat: GPU dispatch strategy — deferred pending table-driven dispatch refactor

1 participant