Currently, we add __attribute__((aligned(X))) for definitions like
cl_int, cl_short etc. This guarantees that the variable will be aligned
*at least* at an X byte boundary. We don't need to do this, for a few
reasons:
- Most of these types are fixed width (int32_t, int16_t, etc.). This
means __attribute((aligned(X))) isn't doing anything, as the types are
exactly the right size, so they will already be aligned to at least
their size. float and double are not guaranteed to be any given width,
though in practice they are almost always IEEE 754 floats and
therefore 4 and 8 bytes respectively. If they were not 4/8 bytes, it's
unclear that forcing 4/8 byte alignment would be good for either space
or performance efficiency.
- Attributes don't carry over to templates, which ends up causing a
GCC -Wignored-attributes warning in cl.hpp when we declare an
std::vector<cl_int>. This warning is indicating that the attributes
get dropped when put inside a template. Nothing seems to break when
this happens, further suggesting that the attributes aren't really
needed.
- The attributes aren't present on Windows, so if they were really
needed, then Windows is currently broken. Again, it doesn't seem like
anything is broken, so this is further evidence that we don't need to
add these attributes.
See here for further reference on __attribute((aligned(X))):
https://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Type-Attributes.html
removed comments around arguments for CL.h
removed comments around arguments for cl_ext.h
removed comments around arguments for cl_ext_intel.h
removed comments around arguments for cl_dx9_media_sharing_intel.h
removed comments around arguments for cl_egl.h, cl_gl.h, and cl_gl_ext.h
removed comments around arguments for cl_va_api_media_sharing_intel.h
whitespace cleanup
These various deltas made it extremely difficult to work with non-Apple
implementations of OpenCL on macOS. Apple always shipped their own
versions of the headers anyway, and now that Apple have officially
deprecated OpenCL on their platforms there is no reason to keep these
deltas.
Fixes https://github.com/KhronosGroup/OpenCL-Headers/issues/31 as well
as a few other unreported issues.
...to the final CL_IMPORT_TYPE_PROTECTED_ARM name.
The extension spec hasn't been released publicly yet.
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
Note that "cl.h" defines the macro only for OpenCL 1.2 or greater since
"cl_khr_fp64" was made a core-optional feature from OpenCL 1.2 onwards.
This creates an issue when users targeting OpenCL 1.1 or lower try to query
the device for double precision support using the macro.
This change fixes this issue by adding the macro in "cl_ext.h" for OpenCL 1.1 or lower.
"cl_khr_fp16" is still included as an extension in higher OpenCL versions unlike "cl_khr_fp64"
which is an optional-core feature from OpenCL 1.2. Hence remove the above defined macro
as it is already defined in "cl_ext.h"
Having an explicit LICENSE file can be useful for packaging (e.g.
programitically determining the license), for displaying the license on github,
and for quickly seeing the licensing at a glance.