Preprocessor directive for CUDA toolkit version?

I have some inline PTX assembly using lop3.b32, that’s only available in Cuda 7.5. Is there a way to figure out the CUDA toolkit version at compile time so I can choose an alternative method whne lop3.b32 is not available, similar to CUDA_ARCH?

What you are probably looking for is CUDART_VERSION.

#if CUDART_VERSION >= 7500

#endif

thanks! I require CUDA 7.5, so I would expect CUDART_VERSION == 7500. Instead it reports 7050. But I guess, that’s ok, because for 6.5 it has 6050.

oh yes you are correct, my bad… it seems that the number should be 1000 x major + 10 x minor version.