* Add cl_intel_create_buffer_with_properties extension function
Spec:
https://github.com/KhronosGroup/OpenCL-Docs/blob/master/extensions/cl_intel_create_buffer_with_properties.asciidoc
This extension allows OpenCL 1.x and 2.x devices to support the
clCreateBufferWithProperties API that was added in OpenCL 3.0. This allows older
OpenCL implementations to support other optional extensions or features that use
the clCreateBufferWithProperties API to specify additional buffer properties,
without recreating the API that is already part of OpenCL 3.0.
Signed-off-by: Mikhail Lychkov <mikhail.lychkov@intel.com>
* Add CL_MEM_CHANNEL_INTEL property enum
It's done to align with:
https://github.com/KhronosGroup/OpenCL-Docs/blob/master/extensions/cl_intel_mem_channel_property.asciidoc
Signed-off-by: Mikhail Lychkov <mikhail.lychkov@intel.com>
Co-authored-by: Viktoria Maksimova <viktoria.maksimova@intel.com>
When using clang, altivec.h inclusion is taken care of by clang with -maltivec / -mno-altivec. Users shouldn't directly include it, it breaks compilation.
* add APIs and enums for cl_intel_unified_shared_memory
* remove CL_MEM_ALLOC_DEFAULT_INTEL
This value is not in the latest rev of the spec.
* add aliases for cl_mem_migration_flags
Fixes compilation pre-OpenCL 1.2, where cl_mem_migration_flags is not defined.
* for now, remove aliases to cl_mem_migration_flags
Instead of adding aliases to cl_mem_migration_flags and associated
enums, restrict the clEnqueueMigrateMemINTEL API to OpenCL 1.2 or
newer, which satisfies all current use-cases.
If needed, the aliases can be re-introduced at a later date, since
adding them does not change the ABI.
* Add cl_half.h header
* Make shared utility for handling {over,under}flow
* Include stdint.h
* Prefix all new functions with cl_half_
* Address Windows warnings
* Refactor lsb_pos calculation
* Avoid leading double-underscore in header guard
* Update license
* Add tests for cl_half.h
* add experimental enums
* use enum range reserved for cl_device_info
remove duplicated bitfields for atomic capabilities
add bitfields to experimental definitions
* add one more experimental enum
* adjust enum assignment to avoid collisions with extended versioning
* Add cl_khr_extended_versioning definitions
Signed-off-by: Einar Hov <einar.hov@arm.com>
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
* Fix definition of CL_VERSION_MAJOR_KHR
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
...so that implementations (and others) can use definitions
straight from the headers instead of mirroring them.
The definitions come from https://github.com/KhronosGroup/OpenCL-ICD-Loader
with the following name changes:
- function pointers are now prefixed with 'cl_api_'
- the dispatch table type is now 'cl_icd_dispatch'
Contributes to https://github.com/KhronosGroup/OpenCL-ICD-Loader/issues/72
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
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