fix(cuda): spell the fast-math flag the way nvcc spells it

Every .cu file failed on CUDA 13 with "nvcc fatal: Unknown option
'--use-fast-math'". The flag is --use_fast_math, with underscores; older
toolkits accepted the hyphenated form as well and this one does not, so
the engine layer could not compile a single kernel on a current CUDA.

Found on the Windows machine with CUDA 13.0, where it stopped the build
at the first two kernels.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-13 07:58:49 +10:00
co-authored by Claude Opus 5
parent eb84d48e5c
commit e76d3b81e2
+6 -2
View File
@@ -23,10 +23,14 @@ if(CMAKE_CUDA_COMPILER)
set(CMAKE_CUDA_ARCHITECTURES set(CMAKE_CUDA_ARCHITECTURES
75-real 80-real 86-real 87-real 88-real 89-real 90-real 100-real 120-real 75-real 80-real 86-real 87-real 88-real 89-real 90-real 100-real 120-real
75-virtual) 75-virtual)
# --use_fast_math, with underscores: that is nvcc's own spelling. Older
# toolkits also accepted the hyphenated form; CUDA 13 does not, and every
# .cu file fails with "Unknown option '--use-fast-math'" before it compiles
# a line.
if(MSVC) if(MSVC)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --use-fast-math -Xcompiler=/utf-8") set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --use_fast_math -Xcompiler=/utf-8")
else() else()
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --use-fast-math") set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --use_fast_math")
endif() endif()
else() else()
project(ANSCORE LANGUAGES C CXX) project(ANSCORE LANGUAGES C CXX)