-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (54 loc) · 1.4 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
62
63
64
65
66
67
68
cmake_minimum_required(VERSION VERSION 3.21..3.26)
project(largemm)
# Find CUDA package
find_package(CUDA REQUIRED)
# Set CUDA architectures
set(CUDA_ARCHITECTURES "75" CACHE STRING "CUDA architectures to compile for")
# Set C++ standard to C++11
set(CMAKE_CXX_STANDARD 11)
# Set CUDA standard to 11
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
# Add CUDA flags
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch=sm_${CUDA_ARCHITECTURES}")
# Include directories
include_directories(src)
# # Add CUDA source files
# set(CUDA_SOURCE_FILES
# src/largemm_base.cu
# src/largemm_main.cu
# src/largemm_test.cu
# src/largemm_v1_4_streams.cu
# )
# Glob CUDA source files
file(GLOB CUDA_SOURCE_FILES
src/*.cu
)
# Add header files
# set(HEADER_FILES
# src/largemm-base.h
# src/largemm-check.h
# src/largemm-test.h
# src/largemm-v1-4-streams.h
# )
# Glob header files
file(GLOB HEADER_FILES
src/*.h
)
# Add executable target
cuda_add_executable(largemm
${CUDA_SOURCE_FILES}
${HEADER_FILES}
)
# Link CUBLAS library
target_link_libraries(largemm
${CUDA_CUBLAS_LIBRARIES}
)
# Install target
install(TARGETS largemm
RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/bin
LIBRARY DESTINATION ${CMAKE_SOURCE_DIR}/lib
ARCHIVE DESTINATION ${CMAKE_SOURCE_DIR}/lib
)
# Install header files
install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_SOURCE_DIR}/include)