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

            Bug ID: 47882
           Summary: Not all OpenCL extensions are disabled by default
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OpenCL
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

The OpenCL specification requires implementation to disable all extensions by
default. This implies that using any builtin functions from an extension should
produce a compile-time error.

Clang doesn't respect this rules, at least not for all extensions as the
following example shows:

unsigned int foo() {
    return get_sub_group_size();
}

This code compiles (while it should not) when using `opencl-c.h` and doesn't
(as expected) when using -fdeclare-opencl-builtins.

https://godbolt.org/z/WrMsMj

For reference, see the specification
https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_Ext.html#compiler-directives-for-optional-extensions

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to