Use a ternary op since it seems the cuda compiler cannot resolve overloads by going through simple typedefs.