Example:
#include <iostream>
#include <typeinfo>
#include <cxxabi.h>
template<typename T>
__global__ void SomeKernel(T) {}
template<int>
struct SomeType { };
int main() {
#ifdef __CUDA_ARCH__
using T = SomeType<0>;
#else
using T = SomeType<1>;
#endif
SomeKernel<T><<<1,1>>>({});
if (cudaGetLastError() == cudaErrorSymbolNotFound) {
std::cout << abi::__cxa_demangle(typeid(SomeKernel<T>).name(),0,0,0) << " not found!" << std::endl;
}
}