[PATCH] D140155: [Clang][OpenMP] Allow host call to nohost function with host variant

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 16 13:48:31 PST 2022


ABataev accepted this revision.
ABataev added a comment.
This revision is now accepted and ready to land.

LG



================
Comment at: clang/test/OpenMP/declare_target_nohost_variant_messages.cpp:16
+#pragma omp declare target enter(fun2) device_type(nohost)
+#pragma omp declare variant(host_function) match(device={kind(host)})
+void fun2() {}
----------------
doru1004 wrote:
> doru1004 wrote:
> > ABataev wrote:
> > > You mean this test case? But it still has kind(host).
> > The condition checks the attribute of the `host_function` which in this case is `host`. In the test above the condition is false because the `not_a_host_function` has a `nohost` attribute.
> It should always have host there because we are trying to fix the case where we have a nohost function that needs a host variant.
Ah, I missed that the check was for declare target attribute.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140155/new/

https://reviews.llvm.org/D140155



More information about the cfe-commits mailing list