[PATCH] D62197: [OpenCL] Fix file-scope const sampler variable for 2.0

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 21 07:34:58 PDT 2019


yaxunl created this revision.
yaxunl added a reviewer: Anastasia.

OpenCL spec v2.0 s6.13.14:

  Samplers can also be declared as global constants in the program
  source using the following syntax.
  
     const sampler_t <sampler name> = <value>

This works fine for OpenCL 1.2 but fails for 2.0, because clang duduces
address space of file-scope const sampler variable to be in global address
space whereas spec v2.0 s6.9.b forbids file-scope sampler variable to be
in global address space.

The fix is not to deduce address space for file-scope sampler variables.


https://reviews.llvm.org/D62197

Files:
  lib/Sema/SemaType.cpp
  test/CodeGenOpenCL/sampler.cl
  test/SemaOpenCL/sampler_t.cl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62197.200505.patch
Type: text/x-patch
Size: 4820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190521/5819365f/attachment-0001.bin>


More information about the cfe-commits mailing list