code: def benchmark(self, func, gpu_args, instance, times, verbose):
          
          logging.debug('benchmark ' + instance.name)
          logging.debug('thread block dimensions x,y,z=%d,%d,%d', *instance.threads)
          logging.debug('grid dimensions x,y,z=%d,%d,%d', *instance.grid)
  
          time = None
          try:
              time = self.dev.benchmark(func, gpu_args, instance.threads, instance.grid, times)
          except Exception as e:
              #some launches may fail because too many registers are required
              #to run the kernel given the current thread block size
              #the desired behavior is to simply skip over this configuration
              #and proceed to try the next one
              skippable_exceptions = ["too many resources requested for launch", "OUT_OF_RESOURCES", "INVALID_WORK_GROUP_SIZE"]
              if any([skip_str in str(e) for skip_str in skippable_exceptions]):
                  logging.debug('benchmark fails due to runtime failure too many resources required')
                  if verbose:
                      print("skipping config", instance.name, "reason: too many resources requested for launch")
              else:
                  logging.debug('benchmark encountered runtime failure: ' + str(e))
                  print("Error while benchmarking:", instance.name)
                  raise e
          return time
docs: benchmark the kernel instance