@kernel void buggy_kernel() {
for (int i = 0; i < 100; ++i; @outer) {
@shared float shared_val;
for (int j = 0; j < 100; ++j; @inner) {
if( j<100 )
@atomic shared_val += j;
}
}
}
causes transpilation error: expected unqualified-id, but putting the @atomic line in "{}" brackets makes it transpile without errors. So this works fine:
@kernel void working_kernel() {
for (int i = 0; i < 100; ++i; @outer) {
@shared float shared_val;
for (int j = 0; j < 100; ++j; @inner) {
if( j<100 ){
@atomic shared_val += j;
}
}
}
}
the following kernel:
causes transpilation error:
expected unqualified-id
, but putting the @atomic line in "{}" brackets makes it transpile without errors. So this works fine:the same goes for loops.