-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
101 lines (83 loc) · 2.71 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
cmake_minimum_required(VERSION 3.18)
project(cuMpSGEMM LANGUAGES CXX CUDA)
find_package(CUDA 11.0 REQUIRED)
find_package(CUDAToolkit REQUIRED)
set(BUILD_TEST OFF)
# CUDA/CXX
foreach(lang CXX CUDA)
set(CMAKE_${lang}_STANDARD 17)
set(CMAKE_${lang}_STANDARD_REQUIRED ON)
set(CMAKE_${lang}_EXTENSIONS OFF)
endforeach()
# CUDA (1/2)
SET(CMAKE_CUDA_ARCHITECTURES 80)
# Directories
set(INCDIR include)
set(SRCDIR src)
set(SUBMODULEDIR submodules)
file(GLOB HEADERS "${INCDIR}/cumpsgemm/*.hpp")
set(
LIBSRCS
${SRCDIR}/exp_stats.cu
${SRCDIR}/cumpsgemm.cu
${SRCDIR}/cumpsgemm_cublas.cu
${SRCDIR}/default_cumpsgemm_rule.cu
${SRCDIR}/handle.cu
${SRCDIR}/dynamic_launch.cu
${SRCDIR}/dynamic_scaling.cu
${SRCDIR}/culip.cu
${SRCDIR}/instance_sm80.cu
${SRCDIR}/instance_sm86.cu
#${SRCDIR}/instance_simt.cu
${SUBMODULEDIR}/cuGEMM-Mx2x2/src/main.cu
${HEADERS}
)
add_library(libobjs OBJECT ${LIBSRCS})
set_property(TARGET libobjs PROPERTY POSITION_INDEPENDENT_CODE 1)
target_include_directories(libobjs PUBLIC ${INCDIR} ${SUBMODULEDIR}/cutf/include ${SUBMODULEDIR}/wmma_extension/include ${SUBMODULEDIR}/cuGEMM-Mx2x2/include)
## static library
add_library(cumpsgemm_static STATIC $<TARGET_OBJECTS:libobjs>)
target_link_libraries(cumpsgemm_static PRIVATE
cublas_static
cublasLt_static
culibos
)
#target_include_directories(cumpsgemm_static PUBLIC ${INCDIR} ${SUBMODULEDIR}/cutf/include ${SUBMODULEDIR}/wmma_extension/include)
## shared library
add_library(cumpsgemm SHARED $<TARGET_OBJECTS:libobjs>)
#target_include_directories(cumpsgemm PUBLIC ${INCDIR} ${SUBMODULEDIR}/cutf/include ${SUBMODULEDIR}/wmma_extension/include)
target_link_libraries(cumpsgemm PRIVATE
cublas_static
cublasLt_static
culibos
)
## Default rule library
add_library(cumpsgemm_rule SHARED
${SRCDIR}/default_cumpsgemm_rule.cu
${HEADERS}
)
target_include_directories(cumpsgemm_rule PUBLIC ${INCDIR})
target_link_libraries(cumpsgemm_rule PRIVATE
cuda
)
##########################################################################
# Installing
##########################################################################
install(TARGETS cumpsgemm
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include/cumpsgemm
)
##########################################################################
# Tests
##########################################################################
if (${BUILD_TEST})
set(TESTSRCDIR test)
add_executable(cumpsgemm_test ${TESTSRCDIR}/main.cu ${HEADERS})
target_include_directories(cumpsgemm_test PRIVATE ${INCDIR} ${SUBMODULEDIR}/cutf/include ${SUBMODULEDIR}/wmma_extension/include ${TESTSRCDIR}/mateval/include)
target_link_libraries(cumpsgemm_test PRIVATE
CUDA::cublas
cumpsgemm_static
cuda
curand
)
endif()