-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate acc link flags #33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that this works correctly in an IFS build now
This is only required for NVHPC compiler I believe. I propose following: if( HAVE_ACC AND CMAKE_Fortran_COMPILER_ID MATCHES NVHPC )
set( ACC_LINK_OPTIONS ${OpenACC_Fortran_FLAGS} ) # for marking intent
target_link_options(${ecwam} INTERFACE
$<$<LINK_LANG_AND_ID:C,NVHPC>:SHELL:${ACC_LINK_OPTIONS}>
$<$<LINK_LANG_AND_ID:CXX,NVHPC>:SHELL:${ACC_LINK_OPTIONS}>
$<$<LINK_LANG_AND_ID:Fortran,NVHPC>:SHELL:${ACC_LINK_OPTIONS}>
$<$<LINK_LANG_AND_ID:CUDA,NVIDIA>:SHELL:${ACC_LINK_OPTIONS}> )
endif() Possibly we could make this proposed |
It is very likely I am missing something, but if we are always setting the same link flags for all the language and compiler ID combinations, do we gain something over simply setting |
Right, if we guard with |
Does this following line work for CrayFortran or GNU or ... ? target_compile_options( ${ecwam} PRIVATE "-gpu=maxregcount:128" ) |
Great spot! This should also be guarded with compiler ID checks. As we test it on more compilers we can relax the compiler ID checks. |
It probably would not work out of the box on any other compiler anyway, though one could be pleasantly surprised 🤗 |
1d90448
to
81aa838
Compare
Thanks again for the feedback @reuterbal and @wdeconinck. Unless there are any additional outstanding corrections, could this please be merged? |
ecWAM did not propagate OpenACC flags to the executable. This was previously masked by the fact that ifs-source would always compile with OpenACC for nvhpc builds. Once I fixed that bug, it exposed the ecWAM bug that this PR fixes.