Compile cuda code for all(or most) nvidia GPUs?

Is there a way to compile cuda code for all(or most) NVIDIA GPUs? If I, for example, don’t know where the code will run?

This has not been updated for the current Ampere generation, so you would add two more “gencode” flags for “80” and “86”

As mentioned, as long as you include PTX in your output, future generations will be catered for by JIT compilation.