Prevent OOM

This commit is contained in:
2026-06-18 05:55:31 +10:00
parent ebba70b9d9
commit b3436a61ee
44 changed files with 1797 additions and 66 deletions
+14 -1
View File
@@ -9,7 +9,14 @@ if(CMAKE_CUDA_COMPILER)
set(ANSCORE_HAS_CUDA ON)
set(CMAKE_CUDA_STANDARD 20)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_ARCHITECTURES 75 80 86 87 88 89 90 100)
# SASS (-real) for each shipping arch from Turing (sm_75) through Blackwell
# consumer (sm_120), plus compute_75 PTX (-virtual) so any newer/unlisted GPU
# JIT-compiles at first run (forward compatibility). NOTE: this only governs
# this project's own .cu files; prebuilt deps (odhublib, TensorRT, ORT, cuBLAS)
# carry their own arch coverage independently.
set(CMAKE_CUDA_ARCHITECTURES
75-real 80-real 86-real 87-real 88-real 89-real 90-real 100-real 120-real
75-virtual)
if(MSVC)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --use-fast-math -Xcompiler=/utf-8")
else()
@@ -36,6 +43,12 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# ANSCORE uses no C++20 modules. CMake auto-enables module dependency scanning
# for C++20 + Ninja, which adds a fragile per-TU scan/dyndep (.ddi/.modmap) step
# that can fail (empty .ddi -> "cannot open ...modmap" / dyndep parse errors),
# especially after an interrupted build. Disable it: faster builds, no dyndep.
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
# Output all binaries to a single directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)