[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
Thu Dec 15 14:14:59 PST 2022


ABataev added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:2704
+                VariantFD->getMostRecentDecl());
+        if (!DevTy || *DevTy == OMPDeclareTargetDeclAttr::DT_Host)
+          HasHostFunctionVariant = true;
----------------
doru1004 wrote:
> ABataev wrote:
> > Isuppose it must be `DevTy && *DevTy == OMPDeclareTargetDeclAttr::DT_Host`, no?
> Correct me if I'm wrong but if there's no device type associated with the function then it is a host function? For the second part of the condition, if there exists a DevTy associated with the function then it has to be DT_Host.
Ah, I missed it. Can we have just declare variant without device type? Can you add a test for this case?


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