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:
+6
-2
@@ -23,10 +23,14 @@ if(CMAKE_CUDA_COMPILER)
|
||||
set(CMAKE_CUDA_ARCHITECTURES
|
||||
75-real 80-real 86-real 87-real 88-real 89-real 90-real 100-real 120-real
|
||||
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)
|
||||
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()
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --use-fast-math")
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --use_fast_math")
|
||||
endif()
|
||||
else()
|
||||
project(ANSCORE LANGUAGES C CXX)
|
||||
|
||||
Reference in New Issue
Block a user