Details
In OKL code, using a variable in the initializer statement of array declaration causes the parser to segfault during translation for the "launched" backends (CUDA/HIP/OpenCL/SYCL).
Reproducer
The following OKL code can be used to reproduce the error at the command line by calling occa translate -m CUDA f.okl.
@kernel f() {
@outer for (int o = 0; o < 1; ++o) {
@inner for (int i = 0; i < 1; ++i) {
int x = 0;
// int y[2] = {1,2}; //okay
int y[2] = {1,x}; //segfault
}
}
}