PROJECT(example_01)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

#FIND_PACKAGE(CUDA)

#INCLUDE(FindCUDA)
#SET(CUDA_SDK_ROOT_DIR $ENV{CUDA_SDK_ROOT_DIR})

LINK_LIBRARIES(
#  "winmm.lib"
#  "psapi.lib"
#  "shlwapi.lib"
)

INCLUDE_DIRECTORIES(
  "./"
  "../"
)

SET(CMAKE_C_FLAGS "-fopenmp")
SET(CMAKE_CXX_FLAGS "-fopenmp")
SET(CMAKE_VERBOSE_MAKEFILE ON)

#SET(THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_CUDA)
SET(THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_OMP)

#SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-arch=sm_20")
#SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-arch=sm_20")

LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30 -DTHRUST_DEVICE_SYSTEM=${THRUST_DEVICE_SYSTEM} )
LIST(APPEND CUDA_NVCC_FLAGS -Xcompiler -fopenmp)

#CUDA_ADD_EXECUTABLE(
ADD_EXECUTABLE(
  example_01
  main.cpp
)

INSTALL(TARGETS example_01 DESTINATION ${example_01_SOURCE_DIR})

PROJECT(example_01)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

#FIND_PACKAGE(CUDA)

#INCLUDE(FindCUDA)
#SET(CUDA_SDK_ROOT_DIR $ENV{CUDA_SDK_ROOT_DIR})

LINK_LIBRARIES(
#  "winmm.lib"
#  "psapi.lib"
#  "shlwapi.lib"
)

INCLUDE_DIRECTORIES(
  "./"
  "../"
)

SET(CMAKE_C_FLAGS "-fopenmp")
SET(CMAKE_CXX_FLAGS "-fopenmp -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_OMP")
SET(CMAKE_VERBOSE_MAKEFILE ON)

#SET(THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_CUDA)
SET(THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_OMP)

#SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-arch=sm_20")
#SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-arch=sm_20")

LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30 -DTHRUST_DEVICE_SYSTEM=${THRUST_DEVICE_SYSTEM} )
LIST(APPEND CUDA_NVCC_FLAGS -Xcompiler -fopenmp)

#CUDA_ADD_EXECUTABLE(
ADD_EXECUTABLE(
  example_01
  main.cpp
)

INSTALL(TARGETS example_01 DESTINATION ${example_01_SOURCE_DIR})

Add env. variable for g++
Add env. variable for g++
