You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the cuda-lib make build began compiling translation units as CUDA (-x cu, see fastfields/fastfields-cuda-lib#8), the half specializations in utils.h fail under nvcc 12:
utils.h(71): error: the global scope has no "hsqrt"
utils.h(141): error: more than one conversion function from "half" to a built-in type applies
utils.h(149): error: more than one conversion function from "half" to a built-in type applies
Two root causes:
sqrt<half> calls ::hsqrt(a), which is not visible at global scope in every CUDA/arch combination.
min<half>/max<half> compare the half values directly (a < b), which is ambiguous because half has multiple implicit conversions to built-in types.
Fix: compute sqrt in float and narrow back; compare the already-computed float forms (af < bf) in min/max. Guarded by #ifdef __CUDACC__, so there is no change to the CPU path. Unblocks fastfields/fastfields-cuda-lib#8.
Once the cuda-lib
makebuild began compiling translation units as CUDA (-x cu, see fastfields/fastfields-cuda-lib#8), thehalfspecializations inutils.hfail under nvcc 12:Two root causes:
sqrt<half>calls::hsqrt(a), which is not visible at global scope in every CUDA/arch combination.min<half>/max<half>compare thehalfvalues directly (a < b), which is ambiguous becausehalfhas multiple implicit conversions to built-in types.Fix: compute
sqrtinfloatand narrow back; compare the already-computedfloatforms (af < bf) in min/max. Guarded by#ifdef __CUDACC__, so there is no change to the CPU path. Unblocks fastfields/fastfields-cuda-lib#8.