Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ pybind11_add_module(_C csrc/python_api.cpp)
target_link_libraries(_C PRIVATE nccl ${RUNTIME_CUDA_LIBRARIES} ${LEGACY_CUDA_LIBRARIES} ${TORCH_LIBRARIES} torch_python)

# Enable kernel code indexing with CMake-based IDEs
cuda_add_library(deep_ep_indexing_cuda STATIC csrc/indexing/main.cu)
add_library(deep_ep_indexing_cuda STATIC csrc/indexing/main.cu)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 suggestion: 修复本身正确:project() 已启用 CUDA 语言,add_library 会让 nvcc 编译 main.cu。一个非阻塞的可选建议:add_subdirectory(csrc) 已在第 46 行执行,此处可直接复用 add_deep_ep_library(deep_ep_indexing_cuda csrc/indexing/main.cu),让 indexing 目标与 csrc/kernels/CMakeLists.txt 中真实内核目标的编译参数一致(C++17 / CUDA_SEPARABLE_COMPILATION ON / 链接 nvshmem_device),IDE 语义分析环境会更贴近实际。注意原 cuda_add_library 会读取第 8 行的全局 CUDA_SEPARABLE_COMPILATION ON,而原生 add_library 不会,所以该目标现在不带 -rdc=true;我已确认 main.cu 包含的 impls/*.cuh 中所有 __global__ 均为模板且未实例化,不会产生设备代码,因此当前改法不会引入 unresolved extern 问题。可与描述中提到的其他 FindCUDA 遗留(CUDA_NVCC_FLAGS、CUDA_TOOLKIT_ROOT_DIR)一并放到后续 PR。

🤖 v5