点击(此处)折叠或打开

  1. cmake_minimum_required(VERSION 3.5)

  2. PROJECT(vectorAdd)

  3. FIND_PACKAGE(CUDA REQUIRED)

  4. INCLUDE_DIRECTORIES(
  5.         ./
  6.         ${CUDA_INCLUDE_DIRS}
  7.         ../../common/inc
  8.         )

  9. add_compile_options(-std=c++11)


  10. SET(CUDA_PATH "/usr/local/cuda-9.1")
  11. link_directories(
  12.         ${CUDA_PATH}/lib64
  13.         ../../common/lib/linux/x86_64
  14.         )

  15. set(SRC_LIST vectorAdd.cu)

  16. CUDA_ADD_EXECUTABLE(${PROJECT_NAME} ${SRC_LIST})
  17. target_link_libraries(${PROJECT_NAME} ${CUDA_LIBRARIES})



11-15 11:20