[cfe-dev] [OpenCL] upstreaming khronos OpenCL header files
Anastasia Stulova via cfe-dev
cfe-dev at lists.llvm.org
Thu Mar 10 10:15:49 PST 2016
I see a benefit for the OpenCL users of open source Clang to be able to have the standard includes automatically or at least to have them in the same place as the compiler.
I am not sure if we might have some issue with their size though.
Each header is approximately 1MB large. It might be an issue not just for space but also parsing time. Using PCH would help to reduce compilation time but it seems PCHs have even larger size by a factor of 10.
For example:
opencl-12.h - 916K
opencl-12.h.pch - 1.9M
It is a bit surprising though since PCHs are stored using compressed bitstream as LLVM's bitcode file format according to the documentation page. Has anyone looked at it before? Size is generally a problem for embedded devices.
Anastasia
From: Liu, Yaxun (Sam) [mailto:Yaxun.Liu at amd.com]
Sent: 09 March 2016 19:29
To: cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>
Cc: Bader, Alexey (alexey.bader at intel.com<mailto:alexey.bader at intel.com>); Sumner, Brian; Stellard, Thomas; Anastasia Stulova; Pan, Xiuli
Subject: RFC: [OpenCL] upstreaming khronos OpenCL header files
Hi,
OpenCL predefines many overloaded builtin functions ('builtin' in the sense of OpenCL spec) which are not defined in Clang. As such, to compile OpenCL kernels which call OpenCL 'builtin' functions, a header file declaring these functions is needed.
The khronos OpenCL header files can be found at these links:
https://github.com/KhronosGroup/SPIR/blob/spirv-1.0/lib/Headers/opencl-20.h
https://github.com/KhronosGroup/SPIR/blob/spirv-1.0/lib/Headers/opencl-12.h
I am wondering if upstreaming these header files to Clang trunk at clang/lib/Headers would save the OpenCL users the trouble of downloading these header files from different places.
Also with these header files upstreamed, we could make them implicitly included so that users do not need to include them explicitly.
Your feedback is welcome.
Thanks.
Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160310/b594f339/attachment.html>
More information about the cfe-dev
mailing list