[PATCH] D79344: [cuda] Start diagnosing variables with bad target.

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 4 12:54:19 PDT 2020


yaxunl added inline comments.


================
Comment at: clang/lib/Sema/SemaCUDA.cpp:156
+  if (VD->getType()->isCUDADeviceBuiltinSurfaceType() ||
+      VD->getType()->isCUDADeviceBuiltinTextureType())
+    return CFT_HostDevice;
----------------
We may need to mark constexpr variables as host device too. In practice such usage has exist for long time.


================
Comment at: clang/test/SemaCUDA/variable-target.cu:42
+  return 0;
+}
----------------
we need to have a test to check captured local host variable is allowed in device lambda.

we need to have some test for constexpr variables used in device function.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79344





More information about the cfe-commits mailing list