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
- This issue does not have [test coverage](https://github.com/libocca/occa/blob/ef5218f32ad2444434d84be01716f14243bc174f/tests/src/internal/lang/modes/okl.cpp)
When an OKL kernel function is missing a return type, e.g.
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
@kernel
attributeint g() { return 1; } // Here