Is there cuda convention in SDK to make an API general?

To make cuda code in terms of dlls portable and applicable to all devices of various compute capability, is there any method(or code in SDK or other places) available which can make the dll portable? Say, launch configuration might change according to the compute capability?