[llvm-bugs] [Bug 24937] New: [OpenCL 2.0] Improve diagnostics for reading with sampler from read_write images.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 25 08:10:43 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24937

            Bug ID: 24937
           Summary: [OpenCL 2.0] Improve diagnostics for reading with
                    sampler from read_write images.
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: aleksey.bader at mail.ru
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

According to The OpenCL C Specification (Version: 2.0):

"Calls to built-ins that read from an image using a sampler for images declared
with the __read_write (or read_write)qualifier will be a compilation error."

Here is example of this error:

typedef float float4 __attribute__((ext_vector_type(4)));
typedef int int2 __attribute__((ext_vector_type(2)));

// declaration of read_image built-in function.
float4 __attribute__((overloadable)) read_imagef(__read_only image2d_t image,
sampler_t sampler, int2 coord);

kernel void test(read_write image2d_t image, sampler_t s) {
  float4 f = read_imagef(image, s, (int2)(0,0)); // compilation error is
expected
}

Clang compiles this code without reporting any errors.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150925/0854ee32/attachment.html>


More information about the llvm-bugs mailing list