[PATCH] D63710: [SYCL] Re-use OpenCL sampler in SYCL device mode

Mariya Podchishchaeva via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 24 05:33:26 PDT 2019


Fznamznon created this revision.
Herald added subscribers: cfe-commits, Anastasia, ebevhan, yaxunl.
Herald added a project: clang.
Fznamznon added reviewers: bader, Anastasia.

sampler_t type name is replaced with __ocl_sampler_t to avoid
potential collisions with user types.
Selectively enabled a few OpenCL diagnostics for sampler type as some
diagnostics trigger on SYCL use cases.

For instance, OpenCL kernel in SYCL mode initializes lambda captures with
the kernel argument values. This initialization code for sampler emits
errors because OpenCL disallows sampler on the right hand side of the
binary operators - these are supposed to be used only by built-in
functions.

Another potential issue is the lambda object itself -
captured sampler is a member of the lambda object and OpenCL doesn't
allow composite types with samplers. SPIR-V produced from SYCL should be
okay as lambda object can be removed by standard LLVM transformation
passes.

Patch by Alexey Bader <alexey.bader at intel.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63710

Files:
  clang/lib/AST/ASTContext.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/Sema/Sema.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaInit.cpp
  clang/lib/Sema/SemaType.cpp
  clang/test/CodeGenSYCL/ocl_sampler.cpp
  clang/test/SemaSYCL/ocl_sampler.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63710.206201.patch
Type: text/x-patch
Size: 9491 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190624/b3e183e0/attachment.bin>


More information about the cfe-commits mailing list