[cfe-dev] OpenCl Built-in function declaration

ulop9 ulopez009 at ehu.es
Tue Mar 6 06:17:37 PST 2012


Hi,

i'm trying to use Clang to generate the AST of an OpenCL kernel, to then
parse it and get some statistics about it (e.g. the number of floating
additions).

I'm using Clang the following way: clang -cc1 -ast-dump -x cl "Kernel file"
> "Kernel ast"

The point in here is that clang doesn't recognize OpenCl built-in functions,
functions such as "get_local_id()" give implicit declaration error. My
question is if there is any file where all these functions are defined.

I've searched along the mailing list and the most similar solution to my
problem i've found is in:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-October/017800.html

The ocldef.h file done by Speziale Ettore contains several definitions for
built-in functions
generated by TableGen as described in the post.
This file doesn't include all the functions in the OpenCl specification
Section 6, just some done by hand with TableGen, so i don't know if the only
solution is to complete this file or there is some
header file with all the declarations.

Thanks in advice.

--
View this message in context: http://clang-developers.42468.n3.nabble.com/OpenCl-Built-in-function-declaration-tp3803681p3803681.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list