We should check at compile time that the TKernelFnObj passed into the executor returns void.
There is no way to handle functions returning a value because each thread produces one.
With #695 an static_assert has been added that checks the return type.
It is disabled when ALPAKA_ACC_GPU_CUDA_ONLY_MODE is set. This restirction should be investigated and removed.
Seems to be a problem with pure __device__ functions only: https://github.com/ComputationalRadiationPhysics/alpaka/pull/695#issuecomment-446103194
But as I can see from the comments in #695 we can get the correct return type on the device side. This means we can add a check for CUDA function within the device code.
I will open a PR for it.
I don't see yet how since the signature does not contain void but just some generic int... surprise me :)
I opened #711 with the implementation for the device side validation for CUDA and HIP (to guard the case that CUDA is used as HIP backend)