From 8c0cd576752a8869121e0bcc45a206a4a03b5671 Mon Sep 17 00:00:00 2001 From: Mahmoud Ashraf Date: Thu, 21 Nov 2024 22:26:36 +0300 Subject: [PATCH] prevent double library def --- CMakeLists.txt | 62 +++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62fc33640..983dd7041 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -551,39 +551,9 @@ if (WITH_CUDA) else() list(APPEND LIBRARIES ${CUDA_CUBLAS_LIBRARIES}) endif() - set(CUDA_LINK_LIBRARIES_KEYWORD PRIVATE) - cuda_add_library(${PROJECT_NAME} - ${SOURCES} - src/cuda/allocator.cc - src/cuda/primitives.cu - src/cuda/random.cu - src/cuda/utils.cc - src/ops/alibi_add_gpu.cu - src/ops/bias_add_gpu.cu - src/ops/concat_split_slide_gpu.cu - src/ops/conv1d_gpu.cu - src/ops/dequantize_gpu.cu - src/ops/flash_attention_gpu.cu - src/ops/gather_gpu.cu - src/ops/gumbel_max_gpu.cu - src/ops/layer_norm_gpu.cu - src/ops/mean_gpu.cu - src/ops/multinomial_gpu.cu - src/ops/rms_norm_gpu.cu - src/ops/rotary_gpu.cu - src/ops/softmax_gpu.cu - src/ops/tile_gpu.cu - src/ops/topk_gpu.cu - src/ops/topp_mask_gpu.cu - src/ops/quantize_gpu.cu - src/ops/nccl_ops_gpu.cu - src/ops/awq/gemm_gpu.cu - src/ops/awq/gemv_gpu.cu - src/ops/awq/dequantize_gpu.cu - ) if (WITH_FLASH_ATTN) add_definitions(-DCT2_WITH_FLASH_ATTN) - cuda_add_library(${PROJECT_NAME} + list(APPEND SOURCES src/ops/flash-attention/flash_fwd_hdim32_bf16_sm80.cu src/ops/flash-attention/flash_fwd_hdim32_fp16_sm80.cu src/ops/flash-attention/flash_fwd_hdim64_bf16_sm80.cu @@ -653,6 +623,36 @@ if (WITH_CUDA) src/ops/flash-attention/flash_fwd_split_hdim256_fp16_sm80.cu PROPERTIES COMPILE_FLAGS "--use_fast_math") endif() + set(CUDA_LINK_LIBRARIES_KEYWORD PRIVATE) + cuda_add_library(${PROJECT_NAME} + ${SOURCES} + src/cuda/allocator.cc + src/cuda/primitives.cu + src/cuda/random.cu + src/cuda/utils.cc + src/ops/alibi_add_gpu.cu + src/ops/bias_add_gpu.cu + src/ops/concat_split_slide_gpu.cu + src/ops/conv1d_gpu.cu + src/ops/dequantize_gpu.cu + src/ops/flash_attention_gpu.cu + src/ops/gather_gpu.cu + src/ops/gumbel_max_gpu.cu + src/ops/layer_norm_gpu.cu + src/ops/mean_gpu.cu + src/ops/multinomial_gpu.cu + src/ops/rms_norm_gpu.cu + src/ops/rotary_gpu.cu + src/ops/softmax_gpu.cu + src/ops/tile_gpu.cu + src/ops/topk_gpu.cu + src/ops/topp_mask_gpu.cu + src/ops/quantize_gpu.cu + src/ops/nccl_ops_gpu.cu + src/ops/awq/gemm_gpu.cu + src/ops/awq/gemv_gpu.cu + src/ops/awq/dequantize_gpu.cu + ) elseif(WITH_CUDNN)