Is there anything similar to UberShader in CUDA? or is there any good solution in CUDA?

From that link:

Frequently when people refer to an ubershader they’re referring to one large shader that’s compiled many times with different defines for different features.

Yes, you can write CUDA code that way. Whether you would want to is perhaps a matter of debate.

A C++ method to do this would be template metaprogramming .

1 Like