forked from anshumang/PTXEmitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
28 lines (20 loc) · 1.08 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
cmake_minimum_required(VERSION 3.1)
project(ptxdump C CXX CUDA)
# in order to retain the PTX code in the text executables,
# the target GPU architecture has to be virtual.
set(CMAKE_CUDA_ARCHITECTURES 35-virtual)
# CUDA runtime must be shared, so that we could intercept it.
set(CMAKE_CUDA_RUNTIME_LIBRARY Shared)
# Separable compilation may add extra fatbin images, so we
# enable it to test this case.
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
# Keep intermediate files produced during example compilation:
# we will use them for testing
list(APPEND CMAKE_CUDA_FLAGS "-keep")
add_library(${PROJECT_NAME} SHARED src/ptxdump.cpp src/ptxdump_preload.cpp
ThirdParty/cuda-fatbin-decompression/fatbin-decompress.c)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/cuda-fatbin-decompression)
add_executable(${PROJECT_NAME}_example src/example.cu)