set(CMAKE_CXX_COMPILER /opt/pgi/linux86-64/2018/bin/pgc++)
set(CMAKE_C_COMPILER /opt/pgi/linux86-64/2018/bin/pgcc)
add_compile_options(-std=c++11)
set(CMAKE_BUILD_TYPE Release)
add_compile_options(-fopenacc)
option(ENABLE_OPENACC “Enable OpenACC support” ON)
if(ENABLE_OPENACC)
ADD_DEFINITIONS(-DUSE_OPENACC)
set(CMAEK_C_FLAG “${CMAKE_C_FLAGS} -acc -Minfo=accel”)
set(CMAEK_CXX_FLAG “${CMAKE_CXX_FLAGS} -acc -Minfo=accel”)
endif()
How to configure openacc in CmakeLists file? I did like above, but it didn’t work. Could you please help me? Thank you!