[PATCH] D18380: [CUDA] Implement -fcuda-relaxed-constexpr, and enable it by default.

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 23 15:38:22 PDT 2016


tra added inline comments.

================
Comment at: lib/Sema/SemaDecl.cpp:8011-8013
@@ +8010,5 @@
+  // allowed, so we just treat those as host-only.
+  if (getLangOpts().CUDA && getLangOpts().CUDAHostDeviceConstexpr &&
+      NewFD->isConstexpr() && !NewFD->isVariadic() &&
+      !NewFD->hasAttr<CUDAHostAttr>() && !NewFD->hasAttr<CUDADeviceAttr>()) {
+    NewFD->addAttr(CUDAHostAttr::CreateImplicit(Context));
----------------
Can we have constexpr `__global__`  ?


http://reviews.llvm.org/D18380





More information about the cfe-commits mailing list