]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
CUDA: fix build error from ambiguous __half conversions in conv2d (llama/15690)
authorAkarshan Biswas <redacted>
Mon, 1 Sep 2025 01:25:06 +0000 (06:55 +0530)
committerGeorgi Gerganov <redacted>
Sat, 20 Sep 2025 10:42:46 +0000 (13:42 +0300)
commit2ba5e0cb47dfdf70a0602d3331a313410fba1d17
treee34ac6b0b1d0a1af55dbfd52b53a5e9703b50e0f
parentbb5f844ec7b07ceb3e25107249193a3b9128301b
CUDA: fix build error from ambiguous __half conversions in conv2d (llama/15690)

* CUDA: fix build error from ambiguous __half conversions in conv2d

Building conv2d with half precision failed because `__half` defines
multiple implicit conversion operators (to float, int, short, etc.),
causing ambiguous overload resolution when multiplying with float.

Introduce a templated `to_float` helper that explicitly converts
`__half` via `__half2float`, while passing through float unchanged.
Use this helper in conv2d accumulation to ensure unambiguous and
correct promotion to float.

Fixes some build errors with half-precision kernels on CUDA.

ggml-ci

* CUDA: Replace custom to_float helper with unified ggml_cuda_cast and add half‑>float conversion

* CUDA: Add missing convert.cuh header

* CUDA: remove unnecessary extension in ggml_cuda_cast

* CUDA: Address review comment, remove second type template argument
ggml/src/ggml-cuda/conv2d.cu