OpenCL in KDevelop
Kevin Funk
kfunk at kde.org
Mon Apr 3 07:27:42 UTC 2017
On Sunday, 2 April 2017 22:53:02 CEST Aaron Puchert wrote:
> Hi Kevin,
>
> Ever since KDevelop started using Clang as parser, I wondered whether it
> could also support OpenCL C. It's nice to see that it can, thank you for
> taking the time to do this
> <https://cgit.kde.org/kdevelop.git/commit/?id=da4e1a0f23a061feb88dc49bc085aa
> d713551377>!
>
> However, I have a few suggestions for improvement, if you don't mind:
Heya Aaron,
Thanks for your suggestions!
>
> 1. The language is actually called “OpenCL C”. So wouldn't a better
> MIME type be „text/x-opencl-csrc“, which aligns nicely with
> “text/x-csrc”? (There is also OpenCL C++, though that isn't
> supported by Clang yet.)
Unfortunately this wasn't my call, the people at the freedesktop project
(shared-mime-info) decided text/x-opencl-src would be a good name and I was
already lucky they ACK'd my patch I guess ;)
Unfortunately, for the rest of your suggestions: I don't use OpenCL
personally, and I do not know too much about its internals either.
Did you think about contributing to KDevelop, e.g. by writing appropriate
OpenCL integration both for the internal parser + for the user-exposed UI
bits?
See this for more information how to get started:
https://www.kdevelop.org/contribute-kdevelop
Thanks for your mail!
Cheers,
Kevin
> 2. The declarations
> typedef half half4 __attribute__((ext_vector_type(4)));
> typedef float float4 __attribute__((ext_vector_type(4)));
> typedef double double4 __attribute__((ext_vector_type(4)));
> from the test file shouldn't be necessary. Indeed, since LLVM 3.9
>
> <http://releases.llvm.org/3.9.1/tools/clang/docs/ReleaseNotes.html#opencl-c
> -language-changes-in-clang> Clang ships with the appropriate header file
> containing these
> typedefs, which is called “opencl-c.h”. It should be included by
> default.
> On my system I can find it in
> “/usr/lib64/clang/3.9.1/include/opencl-c.h”. The folder should be in
> the standard include path, so it should suffice to compile with
> “-include opencl-c.h”. Then all necessary types and functions are
> already declared.
> 3. Just like C and C++, there are several OpenCL standards by now, and
> it would be nice if one could choose which is the right one for a
> project, just like for C and C++. (The flag is “-cl-std=CL/x.y/”.)
> Although I understand that there is limited space in the UI and
> OpenCL C is probably still a niche language.
>
> Obviously suggestion 2 is the important one, the others are the cherry
> on the cake.
>
> That being said, I like what KDevelop has become over the years. Keep up
> the great work!
>
> Best regards,
> Aaron
--
Kevin Funk | kfunk at kde.org | http://kfunk.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170403/8b11e795/attachment-0001.sig>
More information about the KDevelop-devel
mailing list