-
Notifications
You must be signed in to change notification settings - Fork 355
/
CMakeLists.txt
61 lines (49 loc) · 1.92 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#******************************************************************************
# * Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# *
# * NVIDIA CORPORATION and its licensors retain all intellectual property
# * and proprietary rights in and to this software, related documentation
# * and any modifications thereto. Any use, reproduction, disclosure or
# * distribution of this software and related documentation without an express
# * license agreement from NVIDIA CORPORATION is strictly prohibited.
# ******************************************************************************
cmake_minimum_required(VERSION 3.18)
set(ROUTINE matmul)
project("${ROUTINE}_example"
DESCRIPTION "cuSPARSELt"
HOMEPAGE_URL "https://docs.nvidia.com/cuda/cusparselt/index.html"
LANGUAGES CXX CUDA)
find_package(CUDAToolkit REQUIRED)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_EXTENSIONS OFF)
add_executable(${ROUTINE}_example)
add_executable(${ROUTINE}_example_static)
target_sources(${ROUTINE}_example
PUBLIC ${PROJECT_SOURCE_DIR}/${ROUTINE}_example.cpp
)
target_sources(${ROUTINE}_example_static
PUBLIC ${PROJECT_SOURCE_DIR}/${ROUTINE}_example.cpp
)
target_include_directories(${ROUTINE}_example
PUBLIC ${CUDAToolkit_INCLUDE_DIRS}
PUBLIC ${CUSPARSELT_PATH}/include
)
target_include_directories(${ROUTINE}_example_static
PUBLIC ${CUDAToolkit_INCLUDE_DIRS}
PUBLIC ${CUSPARSELT_PATH}/include
)
target_link_libraries(${ROUTINE}_example
PUBLIC CUDA::cudart
PUBLIC CUDA::cusparse
PUBLIC ${CUSPARSELT_PATH}/lib64/libcusparseLt.so
)
target_link_libraries(${ROUTINE}_example_static
PUBLIC CUDA::cudart
PUBLIC CUDA::cusparse
PUBLIC ${CUSPARSELT_PATH}/lib64/libcusparseLt_static.a
PUBLIC ${CMAKE_DL_LIBS}
)