Skip to content

Fix float16_t and target selection in the CUDA device pass for Arm hosts. - #3512

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1005110876
Oct 26, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_1005110876

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Fix float16_t and target selection in the CUDA device pass for Arm hosts.

The CUDA device pass (CUDA_ARCH is only defined there) for an aarch64
host still sees the host's aarch64/__ARM_NEON. Highway therefore
selected NEON (and SVE for foreach_target), whose intrinsics NVPTX cannot
compile, and made float16_t wrap __fp16, whose use as a parameter or return
value NVPTX disallows.

In the device pass only:

  • Add HWY_BROKEN_CUDA_DEVICE_ARM (overridable) to HWY_BROKEN_TARGETS so
    that only EMU128 is compiled. Highway SIMD does not run on the GPU, so
    there is no runtime cost.
  • Default HWY_ARM_HAVE_FP16 to 0 (overridable). float16_t then wraps
    _Float16 if HWY_ARM_HAVE_FLOAT16_TYPE, as in the device pass on x86 hosts.

Host passes of .cu and .cc files are unchanged (no ODR risk), the float16_t
layout is unchanged, and x86 hosts are unaffected.

@google-cla

google-cla Bot commented Oct 23, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

…sts.

The CUDA device pass (__CUDA_ARCH__ is only defined there) for an aarch64
host still sees the host's __aarch64__/__ARM_NEON. Highway therefore
selected NEON (and SVE for foreach_target), whose intrinsics NVPTX cannot
compile, and made float16_t wrap __fp16, whose use as a parameter or return
value NVPTX disallows.

In the device pass only:
- Add HWY_BROKEN_CUDA_DEVICE_ARM (overridable) to HWY_BROKEN_TARGETS so
  that only EMU128 is compiled. Highway SIMD does not run on the GPU, so
  there is no runtime cost.
- Default HWY_ARM_HAVE_FP16 to 0 (overridable). float16_t then wraps
  _Float16 if HWY_ARM_HAVE_FLOAT16_TYPE, as in the device pass on x86 hosts.

Host passes of .cu and .cc files are unchanged (no ODR risk), the float16_t
layout is unchanged, and x86 hosts are unaffected.

PiperOrigin-RevId: 1007498527
@copybara-service
copybara-service Bot merged commit 72cc1c9 into master Oct 26, 2026
11 of 12 checks passed
@copybara-service
copybara-service Bot deleted the test_1005110876 branch October 26, 2026 20:15
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.

0 participants