[cfe-dev] Parsing CUDA file to AST

jotas julian.maciejewski at gmail.com
Wed Mar 5 04:12:43 PST 2014


Hi,
I ma building rewriter based on clang (based on some tutorial available on
the internet). 
I am loading CUDA file and trying to traverse AST. I got a problem. It
doesn't recognize CUDA directives like __global__ etc.
I set:
TheCompInst.getLangOpts().CUDA = 1;
and source search patch to:
/usr/include/linux 

Sould I do someting more?

I get an error:

:~/Documents/rewriter$ ./rewritersample bigfunc2.c 
bigfunc2.c:17:1: error: unknown type name '__global__'
__global__ void foo22(int *a, int *b, int *c) {
^
bigfunc2.c:17:12: error: expected identifier or '('
__global__ void foo22(int *a, int *b, int *c) {
           ^
#include <cuda.h>

#define N_WAVE          1024
#define LOG2_N_WAVE     10






--
View this message in context: http://clang-developers.42468.n3.nabble.com/Parsing-CUDA-file-to-AST-tp4038287.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list