code: def nv_compute_capability(dev):
      """If *dev* is an Nvidia GPU :class:`pyopencl.Device`, return a tuple
      *(major, minor)* indicating the device's compute capability.
      """
  
      try:
          return (
              dev.compute_capability_major_nv,
              dev.compute_capability_minor_nv,
          )
      except Exception:
          return None
  
imports: import pyopencl
  from pytools import memoize
  from typing import Dict, Optional, Tuple
label_desc: Use image node_id 4 for calling a global function with example usage: nv_compute_capability(dev) and returns: dev,  dev, None