Both GCC and clang has __builtin_unreachable builtin function to mark execution code paths as impossible (due to some conditions, that met in runtime, not mutters much). Is there analogous builtin function in CUDA?
Say, I want to suppress warning “warning : missing return statement at end of non-void function” coming from following code:
auto f = [] __host__ __device__ (int x) -> int
{
switch (x) {
case 0 : return 10;
case 1 : return 20;
case 2 : return 30;
}
};
assume it is guaranteed, that x in {0, 1, 2} is the precondition. I do not want to make additional default clause, because I even don’t know what to return from it. Maybe device analogous of (noreturn) abort function can also make sense in the case.