perf: add fast-math and vectorization nvcc/cxx build flags

- centralize CXX_FLAGS/NVCC_FLAGS in csrc/build.py as single source
- add --use_fast_math, --ptxas-options=-O3,-v, --extra-device-vectorization
- add -march=native -funroll-loops host flags
- setup.py reads shared cxx_flags/nvcc_flags from registry
- sync pure-C test build commands with new flags
This commit is contained in:
2026-07-07 22:28:32 +08:00
parent c50adbaac0
commit 4225518cf3
4 changed files with 29 additions and 4 deletions
+4 -1
View File
@@ -41,7 +41,10 @@ if _should_build():
CUDAExtension(
f"astrai.extension.{name}",
info["sources"],
extra_compile_args={"cxx": ["-O3"], "nvcc": info["nvcc_flags"]},
extra_compile_args={
"cxx": info["cxx_flags"],
"nvcc": info["nvcc_flags"],
},
extra_link_args=[f"-Wl,-rpath,{_torch_lib}"],
)
)