Created
October 7, 2016 12:11
-
-
Save luoyetx/787a671463a048a71ab369ffaebe2cf3 to your computer and use it in GitHub Desktop.
CMakeLists.txt for CUDA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### CMakeLists.txt for CUDA | |
cmake_minimum_required(VERSION 2.8) | |
find_package(CUDA QUIET REQUIRED) | |
# Pass options to NVCC | |
set( | |
CUDA_NVCC_FLAGS | |
${CUDA_NVCC_FLAGS}; | |
-O3 -gencode arch=compute_22,code=sm_22 | |
) | |
# Specify include directories | |
include_directories( | |
kernels | |
utility | |
) | |
# Specify library paths | |
link_directories( | |
/opt/foobar/lib | |
/opt/joestuff/lib | |
) | |
# For compilation ... | |
# Specify target & source files to compile it from | |
cuda_add_executable( | |
hellocuda | |
hellocuda.cu | |
hellocuda.h | |
kernels/hellokernels.cu | |
kernels/hellokernels.h | |
utility/wrapper.cpp | |
utility/wrapper.h | |
) | |
# For linking ... | |
# Specify target & libraries to link it with | |
target_link_libraries( | |
hellocuda | |
-lfoobar | |
-ljoestuff | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment