Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling of OKL kernel functions missing a return type. #695

Open
kris-rowe opened this issue Jun 28, 2023 · 0 comments
Open

Error handling of OKL kernel functions missing a return type. #695

kris-rowe opened this issue Jun 28, 2023 · 0 comments
Labels
bug Use this label when reporting bugs! OKL parser

Comments

@kris-rowe
Copy link
Member

When an OKL kernel function is missing a return type, e.g.

@kernel f() {
  @outer for (int o=0; o < 1; ++o) {
    @inner for (int i=0; i < 1; ++i) { }
  }
}

the error message returned by the translator is, Error: [2] Expected a [;].

The expected behaviour is to report a return type is missing (and further state that OKL kernel functions are required to have return type void).

Details

  • This issue only occurs for functions declared with the @kernel attribute
  • The line number reported in the error message is the closing brace of the last function in the same translation unit, e.g.
@kernel f() {
...
} // Not here 

int g() {
  return 1;
}  // Here
@kris-rowe kris-rowe added bug Use this label when reporting bugs! parser OKL labels Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Use this label when reporting bugs! OKL parser
Projects
None yet
Development

No branches or pull requests

1 participant