libocca / occa

Portable and vendor neutral framework for parallel programming on heterogeneous platforms.
https://libocca.org
MIT License
396 stars 86 forks source link

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

Open kris-rowe opened 1 year ago

kris-rowe commented 1 year ago

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

int g() { return 1; } // Here


- This issue does not have [test coverage](https://github.com/libocca/occa/blob/ef5218f32ad2444434d84be01716f14243bc174f/tests/src/internal/lang/modes/okl.cpp)