You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inline void my_fn_1() {}
inline void my_fn_2() {}
extern "C" void hello_kern() {
#pragma omp parallel for
for (int i = 0; i < 10; ++i) {
for (int j = 0; j < 10; ++j) {
my_fn_1();
my_fn_2();
}
}
}
New OKL transpiler output:
inline void my_fn_1() {}
inline void my_fn_2() {}
extern "C" void hello_kern() {
#pragma omp parallel for
for (int i = 0; i < 10; ++i) {
for (int j = 0; j < 10; ++j) {
MYSTR1();
MYSTR2();
}
}
Actually to the latest one is correct according to C preprocessor spec.
To archive desire behavior additional level of macro directive is required
#define CONCAT(id1, id2) id1##id2
#define MYMACRO(idx) CONCAT(MYSTR, idx)
The text was updated successfully, but these errors were encountered:
Hello,
My team currently testing a new OKL transpiler based on clang frontend against different libraries that using OCCA.
We have found the bug in legacy OKL preprocessor.
Input :
OKL legacy outputs:
New OKL transpiler output:
Actually to the latest one is correct according to C preprocessor spec.
To archive desire behavior additional level of macro directive is required
#define CONCAT(id1, id2) id1##id2
#define MYMACRO(idx) CONCAT(MYSTR, idx)
The text was updated successfully, but these errors were encountered: