Page MenuHomePhabricator

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

Authored by yaxunl on May 21 2019, 7:34 AM.



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.

Diff Detail

rC Clang

Event Timeline

yaxunl created this revision.May 21 2019, 7:34 AM
yaxunl updated this revision to Diff 200509.May 21 2019, 7:37 AM

Add full diff.

Anastasia accepted this revision.May 23 2019, 4:44 AM

Makes sense. LGTM! Thanks!

This revision is now accepted and ready to land.May 23 2019, 4:44 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2019, 4:17 AM