@@ -112,22 +112,24 @@ if(FLASHINFER_ENABLE_HIP AND FLASHINFER_ENABLE_CUDA)
112112endif ()
113113
114114# Handle CUDA architectures
115- if (FLASHINFER_CUDA_ARCHITECTURES)
116- message (STATUS "CMAKE_CUDA_ARCHITECTURES set to ${FLASHINFER_CUDA_ARCHITECTURES} ." )
117- else ()
118- # No user-provided architectures, try to detect the CUDA archs based on where
119- # the project is being built
120- set (detected_archs "" )
121- detect_cuda_architectures(detected_archs)
122- if (detected_archs)
123- set (FLASHINFER_CUDA_ARCHITECTURES ${detected_archs} CACHE STRING
124- "CUDA architectures" FORCE)
125- message (STATUS "Setting FLASHINFER_CUDA_ARCHITECTURES to detected values: ${FLASHINFER_CUDA_ARCHITECTURES} " )
115+ if (FLASHINFER_ENABLE_CUDA)
116+ if (FLASHINFER_CUDA_ARCHITECTURES)
117+ message (STATUS "CMAKE_CUDA_ARCHITECTURES set to ${FLASHINFER_CUDA_ARCHITECTURES} ." )
126118 else ()
127- # No architectures detected, use safe defaults
128- set (FLASHINFER_CUDA_ARCHITECTURES "75;80;86" CACHE STRING
129- "CUDA architectures to compile for" FORCE)
130- message (STATUS "No architectures detected, using defaults: ${FLASHINFER_CUDA_ARCHITECTURES} " )
119+ # No user-provided architectures, try to detect the CUDA archs based on where
120+ # the project is being built
121+ set (detected_archs "" )
122+ detect_cuda_architectures(detected_archs)
123+ if (detected_archs)
124+ set (FLASHINFER_CUDA_ARCHITECTURES ${detected_archs} CACHE STRING
125+ "CUDA architectures" FORCE)
126+ message (STATUS "Setting FLASHINFER_CUDA_ARCHITECTURES to detected values: ${FLASHINFER_CUDA_ARCHITECTURES} " )
127+ else ()
128+ # No architectures detected, use safe defaults
129+ set (FLASHINFER_CUDA_ARCHITECTURES "75;80;86" CACHE STRING
130+ "CUDA architectures to compile for" FORCE)
131+ message (STATUS "No architectures detected, using defaults: ${FLASHINFER_CUDA_ARCHITECTURES} " )
132+ endif ()
131133 endif ()
132134endif ()
133135
0 commit comments