Closed jenatali closed 3 years ago
Note: Even after this, we can't start actually defining CLON12_SUPPORT_3_0
until we have a version of Clang that properly supports CL3.0. Currently none of opencl-c.h
(what we're currently using), clc.h
(the header used to compile libclc), nor the Clang builtins for CL (OpenCLBuiltins.td
) fully support CL3.0.
Specifically (so far), I'm seeing that vload
and vstore
is completely broken:
opencl-c.h
, kernels fail to compile, because the overloads in the header only support generic address spaces instead of all of the individual address-space-tagged versions, and Clang will refuse to do the address space cast to generic.Based on this table it looks like it's going to be a while.
Note: Even after this, we can't start actually defining
CLON12_SUPPORT_3_0
until we have a version of Clang that properly supports CL3.0. Currently none ofopencl-c.h
(what we're currently using),clc.h
(the header used to compile libclc), nor the Clang builtins for CL (OpenCLBuiltins.td
) fully support CL3.0.
Actually I think I just need to parameterize this so we can claim CL3.0 API but still CL C 1.2 as the max version.
Merging this without defining the CL3.0 define just yet. I'll probably follow up with CMake build configuration for choosing OpenCL 3.0 support. For now, our shipped binaries will continue to come from the cl1.2 branch (even with master before merging).
This PR implements the entirety of the CL3.0 API surface area (the 3 new functions, all the new info queries, plus the required 2.x functions like
clCloneKernel
). Everything optional here is disabled except for read-write images, which are hooked up, but requires a compiler with some changes to actually work.The new code is very poorly tested, but does pass the
test_basic
readwrite image test.There's one missing required(?) feature that I haven't hooked up yet, which is creating an image from an image, for the purpose of format casting. Should be easy enough.
Optional features and extensions that I'd like to start implementing after this: