Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

updated for compatibility #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#Minimum CMake version
cmake_minimum_required(VERSION 3.2)

project(VisionCpp)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release
Expand Down
50 changes: 50 additions & 0 deletions cmake/Modules/ComputeCppCompilerChecks.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
cmake_minimum_required(VERSION 3.4.3)

if(CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "host compiler - gcc version must be > 4.8")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 3.6)
message(FATAL_ERROR "host compiler - clang version must be > 3.6")
endif()
endif()

if(MSVC)
set(ComputeCpp_STL_CHECK_SRC __STL_check)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${ComputeCpp_STL_CHECK_SRC}.cpp
"#include <ios>\n"
"int main() { return 0; }\n")
execute_process(
COMMAND ${ComputeCpp_DEVICE_COMPILER_EXECUTABLE}
${COMPUTECPP_DEVICE_COMPILER_FLAGS}
-isystem ${ComputeCpp_INCLUDE_DIRS}
-o ${ComputeCpp_STL_CHECK_SRC}.sycl
-c ${ComputeCpp_STL_CHECK_SRC}.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE ComputeCpp_STL_CHECK_RESULT
ERROR_QUIET
OUTPUT_QUIET)
if(NOT ${ComputeCpp_STL_CHECK_RESULT} EQUAL 0)
# Try disabling compiler version checks
execute_process(
COMMAND ${ComputeCpp_DEVICE_COMPILER_EXECUTABLE}
${COMPUTECPP_DEVICE_COMPILER_FLAGS}
-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH
-isystem ${ComputeCpp_INCLUDE_DIRS}
-o ${ComputeCpp_STL_CHECK_SRC}.cpp.sycl
-c ${ComputeCpp_STL_CHECK_SRC}.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE ComputeCpp_STL_CHECK_RESULT
ERROR_QUIET
OUTPUT_QUIET)
if(NOT ${ComputeCpp_STL_CHECK_RESULT} EQUAL 0)
message(STATUS "Device compiler cannot consume hosted STL headers. Using any parts of the STL will likely result in device compiler errors.")
else()
message(STATUS "Device compiler does not meet certain STL version requirements. Disabling version checks and hoping for the best.")
list(APPEND COMPUTECPP_DEVICE_COMPILER_FLAGS -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH)
endif()
endif()
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/${ComputeCpp_STL_CHECK_SRC}.cpp
${CMAKE_CURRENT_BINARY_DIR}/${ComputeCpp_STL_CHECK_SRC}.cpp.sycl)
endif(MSVC)
18 changes: 18 additions & 0 deletions cmake/Modules/ComputeCppIRMap.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.4.3)

# These should match the types of IR output by compute++
set(IR_MAP_spir bc)
set(IR_MAP_spir64 bc)
set(IR_MAP_spir32 bc)
set(IR_MAP_spirv spv)
set(IR_MAP_spirv64 spv)
set(IR_MAP_spirv32 spv)
set(IR_MAP_aorta-x86_64 o)
set(IR_MAP_aorta-aarch64 o)
set(IR_MAP_aorta-rcar-cve o)
set(IR_MAP_custom-spir64 bc)
set(IR_MAP_custom-spir32 bc)
set(IR_MAP_custom-spirv64 spv)
set(IR_MAP_custom-spirv32 spv)
set(IR_MAP_ptx64 s)
set(IR_MAP_amdgcn s)
Loading