From e7f00f336817d1af80991fb1cd6b4203ba049c85 Mon Sep 17 00:00:00 2001 From: Lucas Wilkinson Date: Sun, 8 Jun 2025 20:05:13 +0000 Subject: [PATCH] better comments Signed-off-by: Lucas Wilkinson --- cmake/utils.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index e078b67d4e30e..bacb71ccc0889 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -127,12 +127,18 @@ endfunction() # [NO_ARCH_MSG [ ...]] # [GEN_SCRIPT ] # [GEN_GLOB ] -# This will add SRCS if `CMAKE_CUDA_COMPILER_VERSION` is greater than or equal -# to `MIN_VERSION` and the `cuda_archs_loose_intersection` of `ARCHS` and -# `CUDA_ARCHS` (taken from global scope) is not empty. +# This will check if `CMAKE_CUDA_COMPILER_VERSION` is greater than or equal +# to `MIN_VERSION` and the `cuda_archs_loose_intersection` of `ARCHS` and +# `CUDA_ARCHS` (taken from global scope) is not empty. If both these conditions +# are met, it will: +# 1) set the gencode flags of the sources in `SRCS` to be the +# `cuda_archs_loose_intersection` of `ARCHS` and `CUDA_ARCHS`. +# 2) append the sources in `SRCS` to the global `VLLM_EXT_SRC` variable. +# 3) append the flags in `FLAGS` to the global `VLLM_GPU_FLAGS` variable. +# # This will also run GEN_SCRIPT (if supplied and the hash of the script does not -# match the latest in the cmake cache), before globbing sources matching -# GEN_GLOB and appending them alongside SRCS. +# match the latest in the cmake cache), before globbing sources matching +# GEN_GLOB and appending them alongside SRCS (with the gencodes set) macro(optional_cuda_sources) set(oneValueArgs NAME MIN_VERSION GEN_SCRIPT GEN_GLOB OUT_SRCS_VAR) set(multiValueArgs ARCHS SRCS FLAGS VERSION_MSG NO_ARCH_MSG)