code: def compile_udf(udf, type_signature):
      """Compile ``udf`` with `numba`
  
      Compile a python callable function ``udf`` with
      `numba.cuda.compile_ptx_for_current_device(device=True)` using
      ``type_signature`` into CUDA PTX together with the generated output type.
  
      The output is expected to be passed to the PTX parser in `libcudf`
      to generate a CUDA device function to be inlined into CUDA kernels,
      compiled at runtime and launched.
  
      Parameters
      ----------
      udf:
        a python callable function
  
      type_signature:
        a tuple that specifies types of each of the input parameters of ``udf``.
        The types should be one in `numba.types` and could be converted from
        numpy types with `numba.numpy_support.from_dtype(...)`.
  
      Returns
      -------
      ptx_code:
        The compiled CUDA PTX
  
      output_type:
        An numpy type
  
      """
      import cudf.core.udf
  
      key = make_cache_key(udf, type_signature)
      res = _udf_code_cache.get(key)
      if res:
          return res
  
      # We haven't compiled a function like this before, so need to fall back to
      # compilation with Numba
      ptx_code, return_type = cuda.compile_ptx_for_current_device(
          udf, type_signature, device=True
      )
      if not isinstance(
          return_type, cudf.core.udf.masked_typing.MaskedType
      ):
          output_type = numpy_support.as_dtype(return_type).type
      else:
          output_type = return_type
  
      # Populate the cache for this function
      res = (ptx_code, output_type)
      _udf_code_cache[key] = res
  
      return res
  
file_path: cudf/python/cudf/cudf/utils/cudautils.py
imports: from pickle import dumps
  import cachetools
  from numba import cuda
  from numba.np import numpy_support
  from cudf.utils._numba import _CUDFNumbaConfig
label_desc: Use image node_id 6 for calling a global function with example usage: compile_udf(udf, type_signature) and returns: res, res