code: def check_argument_list(kernel_name, kernel_string, args):
      
      kernel_arguments = list()
      collected_errors = list()
      for iterator in re.finditer(kernel_name + "[ \n\t]*" + "\(", kernel_string):
          kernel_start = iterator.end()
          kernel_end = kernel_string.find(")", kernel_start)
          if kernel_start != 0:
              kernel_arguments.append(kernel_string[kernel_start:kernel_end].split(","))
      for arguments_set, arguments in enumerate(kernel_arguments):
          collected_errors.append(list())
          if len(arguments) != len(args):
              collected_errors[arguments_set].append("Kernel and host argument lists do not match in size.")
              continue
          for (i, arg) in enumerate(args):
              kernel_argument = arguments[i]
  
              if not isinstance(arg, (numpy.ndarray, numpy.generic)):
                  raise TypeError("Argument at position " + str(i) + " of type: " + str(type(arg)) + " should be of type numpy.ndarray or numpy scalar")
  
              correct = True
              if isinstance(arg, numpy.ndarray) and not "*" in kernel_argument:
                  correct = False  #array is passed to non-pointer kernel argument
  
              if correct and check_argument_type(str(arg.dtype), kernel_argument, i):
                  continue
  
              collected_errors[arguments_set].append("Argument at position " + str(i) + " of dtype: " + str(arg.dtype) +
                                                     " does not match " + kernel_argument + ".")
          if not collected_errors[arguments_set]:
              # We assume that if there is a possible list of arguments that matches with the provided one
              # it is the right one
              return
      for errors in collected_errors:
          warnings.warn(errors[0], UserWarning)
docs: raise an exception if a kernel arguments do not match host arguments