[llvm-bugs] [Bug 47882] New: Not all OpenCL extensions are disabled by default
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Oct 16 10:20:45 PDT 2020
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: unassignedclangbugs at nondot.org
Reporter: marco.antognini at arm.com
CC: anastasia.stulova at arm.com, llvm-bugs at lists.llvm.org
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201016/2909c6a8/attachment-0001.html>
More information about the llvm-bugs
mailing list