Skip to content

Array declaration with initialization in OKL causes segfault during parsing. #640

@kris-rowe

Description

@kris-rowe

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
    }
  }
} 

Metadata

Metadata

Assignees

No one assigned

    Labels

    CUDADPC++HIPOKLOpenCLbugUse this label when reporting bugs!parserpriorityIssues that are high priority for downstream projects

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions