occa icon indicating copy to clipboard operation
occa copied to clipboard

Missing initial index value on `@inner`/`@outer` loops causes a segfault during translation.

Open kris-rowe opened this issue 3 years ago • 0 comments

Description

If the index variable of an @inner or @outer for loop is not assigned an initial value, then a segfault occurs during OKL translation.

Details

  • Can be reproduced calling occa translate from the command line
  • The error occurs for all backends
  • No useful debugging information is printed suggesting the cause.

Example:

@kernel void f() {
  @outer for(int o=0; o < 1; ++o) {
    @inner for(int i; i < 1; ++i) { //missing initial loop index value
      int a = 0;
    }
  }
}

kris-rowe avatar Jul 26 '22 21:07 kris-rowe