-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
43 lines (28 loc) · 1.21 KB
/
Copy pathCMakeLists.txt
File metadata and controls
43 lines (28 loc) · 1.21 KB
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
cmake_minimum_required(VERSION 3.20)
include("${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/DetectCudaArch.cmake")
if(SAMPLE_SKIP_BUILD)
return()
endif()
project(matrixMulDynlinkJIT LANGUAGES C CXX CUDA)
include("${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/CudaSampleCommon.cmake")
find_package(CUDAToolkit REQUIRED)
include_directories(../../../Common)
add_executable(matrixMulDynlinkJIT cuda_drvapi_dynlink.c matrixMulDynlinkJIT.cpp matrixMul_gold.cpp matrixMul_kernel_32_ptxdump.c matrixMul_kernel_64_ptxdump.c)
target_compile_options(matrixMulDynlinkJIT PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(matrixMulDynlinkJIT PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(matrixMulDynlinkJIT PROPERTIES
POSITION_INDEPENDENT_CODE OFF
)
# Only add -no-pie for GCC or Clang
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie")
endif()
target_link_libraries(matrixMulDynlinkJIT PUBLIC
CUDA::cudart
CUDA::cuda_driver
)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_link_libraries(matrixMulDynlinkJIT PUBLIC dl)
endif()
include(InstallSamples)
setup_samples_install()