Finding out Compute version from OpenCL

Hi,

I’m doing some inline PTX in an OpenCL kernel, using funnel shift. Therefore Compute 3.5 and up is required.

The only thing I can think of now is to just try and compile it (opencl does this at runtime), and roll back to a non-asm optimized version if compilation fails for devices < Compute 3.5.

But is there a more elegant way of figuring out the Compute version in OpenCL, either host or device-side?

https://www.khronos.org/registry/cl/extensions/nv/cl_nv_device_attribute_query.txt