2022-01-12 00:01:42 +08:00
|
|
|
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
|
|
|
|
|
|
|
project(CudaOnX86)
|
|
|
|
set(CMAKE_PROJECT_DESCRIPTION "Executing CUDA on X86 architecture.")
|
|
|
|
set(CMAKE_CXX_STANDARD "14")
|
|
|
|
set(MAJOR_VERSION 0)
|
|
|
|
set(MINOR_VERSION 1)
|
|
|
|
set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION})
|
|
|
|
set(COX_VERSION ${VERSION_STRING})
|
|
|
|
# get LLVM PATH get PATH for head file
|
|
|
|
if(DEFINED LLVM_CONFIG_PATH)
|
|
|
|
if(IS_ABSOLUTE "${LLVM_CONFIG_PATH}")
|
|
|
|
if(EXISTS "${LLVM_CONFIG_PATH}")
|
|
|
|
set(LLVM_CONFIG "${LLVM_CONFIG_PATH}")
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "llvm-config is not found in ${LLVM_CONFIG_PATH}")
|
|
|
|
endif()
|
|
|
|
message(STATUS "Using llvm-config: ${LLVM_CONFIG}")
|
|
|
|
execute_process(
|
|
|
|
COMMAND "${LLVM_CONFIG}" "--cxxflags"
|
|
|
|
OUTPUT_VARIABLE LLVM_CXX_FLAG
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
execute_process(
|
|
|
|
COMMAND "${LLVM_CONFIG}" "--libdir"
|
|
|
|
OUTPUT_VARIABLE LLVM_LIB_PATH
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
execute_process(
|
|
|
|
COMMAND "${LLVM_CONFIG}" "--libs"
|
|
|
|
OUTPUT_VARIABLE LLVM_LINK_FLAG
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "llvm-config is required")
|
|
|
|
endif()
|
2022-09-22 23:20:50 +08:00
|
|
|
# get CUDA PATH
|
|
|
|
if(DEFINED CUDA_PATH)
|
|
|
|
message(STATUS "Using CUDA: ${CUDA_PATH}")
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "CUDA_PATH is required")
|
|
|
|
endif()
|
2022-01-12 00:01:42 +08:00
|
|
|
|
2022-09-16 00:33:28 +08:00
|
|
|
option(DEBUG "Print debug information." OFF)
|
|
|
|
if(DEBUG)
|
|
|
|
add_definitions(-DDEBUG)
|
|
|
|
endif()
|
|
|
|
|
2022-09-22 23:20:50 +08:00
|
|
|
set(CMAKE_CXX_FLAGS
|
|
|
|
"-I${CUDA_PATH}/include ${LLVM_CXX_FLAG} ${CMAKE_CXX_FLAGS}")
|
2022-01-12 00:01:42 +08:00
|
|
|
|
|
|
|
set(GCC_COVERAGE_LINK_FLAGS
|
|
|
|
"-L${LLVM_LIB_PATH} ${LLVM_LINK_FLAG} -lz -lrt -ldl -ltinfo -lpthread -lm")
|
|
|
|
|
|
|
|
add_subdirectory(compilation)
|
2022-05-04 20:59:38 +08:00
|
|
|
add_subdirectory(runtime)
|
2022-09-24 01:08:28 +08:00
|
|
|
enable_testing()
|
2022-09-26 00:58:58 +08:00
|
|
|
|
|
|
|
option(HETERO_MARK_DATA "The path to download hetero-mark dataset." /tmp/data)
|
2022-09-26 01:37:51 +08:00
|
|
|
add_subdirectory(test)
|