Check for OpenACC support by checking the various compiler flags
This commit is contained in:
parent
1a9225ca95
commit
8d45e61f6c
@ -37,11 +37,20 @@ else (${OpenCL_FOUND})
|
|||||||
message("Skipping OpenCL...")
|
message("Skipping OpenCL...")
|
||||||
endif (${OpenCL_FOUND})
|
endif (${OpenCL_FOUND})
|
||||||
|
|
||||||
# TODO: Find OpenACC implementations somehow
|
# Check compiler supports an OpenACC flag
|
||||||
if (true)
|
include(CheckCXXCompilerFlag)
|
||||||
|
message("${CMAKE_CXX_COMPILER_ID}")
|
||||||
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||||
|
CHECK_CXX_COMPILER_FLAG(-fopenacc OPENACC)
|
||||||
|
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "PGI")
|
||||||
|
CHECK_CXX_COMPILER_FLAG(-acc OPENACC)
|
||||||
|
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Cray")
|
||||||
|
CHECK_CXX_COMPILER_FLAG(-hacc=openacc OPENACC)
|
||||||
|
endif()
|
||||||
|
if (OPENACC)
|
||||||
add_executable(gpu-stream-acc main.cpp ACCStream.cpp)
|
add_executable(gpu-stream-acc main.cpp ACCStream.cpp)
|
||||||
target_compile_definitions(gpu-stream-acc PUBLIC ACC)
|
target_compile_definitions(gpu-stream-acc PUBLIC ACC)
|
||||||
target_compile_options(gpu-stream-acc PUBLIC "-hstd=c++11")
|
#target_compile_options(gpu-stream-acc PUBLIC "-hstd=c++11")
|
||||||
else ()
|
else ()
|
||||||
message("Skipping OpenACC...")
|
message("Skipping OpenACC...")
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user