写法一:需要配置环境变量CUDAXX
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
Project(CUDA_Freshman)
enable_language(CUDA)
add_executable(hello_world hello_world.cu)
写法二:
# CMakeLists.txt to build hellocuda.cu
cmake_minimum_required(VERSION 2.8)
find_package(CUDA QUIET REQUIRED)
# Specify binary name and source file to build it from
#add_library(utils utils.cpp)
cuda_add_executable(
squaresum
test.cpp squaresum.cu utils.cu)
#target_link_libraries(squaresum utils)