From f0e7c791dc262a0d785892ac709e1d49d50634ce Mon Sep 17 00:00:00 2001 From: Pranav Sivaraman <14294205+pranav-sivaraman@users.noreply.github.com> Date: Wed, 31 Jan 2024 20:51:07 -0500 Subject: [PATCH] feat(acc): add the option to supply OpenACC flags --- src/acc/model.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/acc/model.cmake b/src/acc/model.cmake index a85ea03..cb047ef 100644 --- a/src/acc/model.cmake +++ b/src/acc/model.cmake @@ -45,6 +45,11 @@ register_flag_optional(TARGET_PROCESSOR set(ACC_FLAGS_OFFLOAD_GNU -foffload=-lm) +register_flag_optional(OFFLOAD_FLAGS + "OpenACC Offload Flags" + "" +) + macro(setup) find_package(OpenACC REQUIRED) @@ -89,5 +94,11 @@ macro(setup) endif () + if(NOT "${OFFLOAD_FLAGS}" STREQUAL "") + separate_arguments(OFFLOAD_FLAGS) + register_append_cxx_flags(ANY ${OFFLOAD_FLAGS}) + register_append_link_flags(${OFFLOAD_FLAGS}) + endif() + endmacro()