code: def mark_cuda_test(inner_f):
      def f(*args, **kwargs):
          import pycuda.driver
  
          # appears to be idempotent, i.e. no harm in calling it more than once
          pycuda.driver.init()
  
          ctx = make_default_context()
          try:
              assert isinstance(ctx.get_device().name(), str)
              assert isinstance(
                  ctx.get_device().compute_capability(), tuple
              )
              assert isinstance(ctx.get_device().get_attributes(), dict)
              inner_f(*args, **kwargs)
          finally:
              ctx.pop()
  
              from pycuda.tools import clear_context_caches
  
              clear_context_caches()
  
              from gc import collect
  
              collect()
  
      try:
          from py.test import mark as mark_test
      except ImportError:
          return f
  
      return mark_test.cuda(f)
  
imports: import pycuda.driver
  import pycuda._driver
  import numpy
  from pycuda.compyte.dtypes import register_dtype, get_or_register_dtype, _fill_dtype_registry, dtype_to_ctype
label_desc: Use image node_id 11 for calling a global function with example usage: mark_cuda_test(inner_f) and returns: mark_test, f