[flang] [llvm] [Flang][FlangRT][Runtime] Add RT_OFFLOAD_API_GROUP_BEGIN to missing symbols on AMDGPU (PR #147612)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 9 03:38:15 PDT 2025


agozillon wrote:

> Thank you for the changes!
> 
> I wish clang supported `declare target` properly for the explicit instantiations and did not require `declare target` for the class declaration. Since the function references are automatically `declare target` if they are referenced by other `declare target` functions according to OpenMP standard, it really does not make much sense to require `declare target` to be applied to the class declaration and its methods' declarations.
>

Yes, I actually thought we already had the implicit marking in Clang C++/OpenMP, but it seems to not be the case, or at least it doesn't handle more complicated cases unfortunately! :-) So sadly need to be a bit more generous with the RT_OFFLOAD_API_GROUP_BEGIN macros, which isn't the prettiest or best thing for compile times long term I imagine. 

> I guess a less intrusive way would be to expand `RT_API_ATTRS` into something like `[[omp::declare_target]]`, but this is not part of OpenMP standard :)

I'd personally prefer to keep it as close to OpenMP standard acceptable as possible, mainly so other OpenMP compilers can come along and compile the runtime if they'd like to (I do think OpenMP does support the attribute specifier syntax in the more recent standard, but I may be misremembering) ! But happy to make this change if you feel it'd be better! :-) 


https://github.com/llvm/llvm-project/pull/147612


More information about the llvm-commits mailing list