gtensor icon indicating copy to clipboard operation
gtensor copied to clipboard

missing return statement warning

Open bd4 opened this issue 3 years ago • 0 comments

The zero length sarray implementation has an operator[] which cannot return - it's implementation is a gtGpuAssert false which throws an exception on host and aborts on device. The compiler is not able to determine this cannot return, and building tests spams the warning over and over, making it hard to see other warnings.

Using __builtin_unreachable() appears to work in most cases. In cuda-10.2, it results in a new warning, that unreacheable is a host fn and can't be called from host device function. This is at least an improvement, but it would be nice to silence this completely.

It's tempting to just declare a length 1 data member and return it, adding 4 bytes to each gscalar is not likely to cause a complex expression that fits in device args to not fit.

bd4 avatar Dec 19 '22 02:12 bd4