[PATCH] D100396: [SYCL] Enable `opencl_global_[host,device]` attributes for SYCL

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 30 06:37:10 PDT 2021


Anastasia added inline comments.


================
Comment at: clang/include/clang/AST/Type.h:489
                                            B == LangAS::opencl_global_host)) ||
+           (A == LangAS::sycl_global && (B == LangAS::sycl_global_device ||
+                                         B == LangAS::sycl_global_host)) ||
----------------
Ok, so you want to allow converting implicitly to global but not to device/host?

Let's update the doc straight away!


================
Comment at: clang/test/SemaSYCL/address-space-conversions.cpp:74
+  GLOB = GLOB_DEVICE;
+  GLOB_DEVICE = GLOB; // expected-error {{assigning '__global int *' to '__global_device int *' changes address space of pointer}}
 }
----------------
Let's add explicit casts too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100396



More information about the cfe-commits mailing list