code: def cholesky(a_gpu, uplo="L", lib="cusolver"):
      """
      Cholesky factorization.
  
      Performs an in-place Cholesky factorization on the matrix `a`
      such that `a = x*x.T` or `x.T*x`, if the lower='L' or upper='U'
      triangle of `a` is used, respectively. All other entries in `a` are set to 0.
  
      Parameters
      ----------
      a_gpu : pycuda.gpuarray.GPUArray
          Input matrix of shape `(m, m)` to decompose.
      uplo : {'U', 'L'}
          Use upper or lower (default) triangle of 'a_gpu'
      lib : str
          Library to use. May be either 'cula' or 'cusolver' (default).
  
      Notes
      -----
      If using CULA, double precision is only supported if the standard version of the
      CULA Dense toolkit is installed.
  
      Examples
      --------
      >>> import pycuda.gpuarray as gpuarray
      >>> import pycuda.autoinit
      >>> import numpy as np
      >>> import scipy.linalg
      >>> import skcuda.linalg as linalg
      >>> linalg.init()
      >>> a = np.array([[3.0,0.0],[0.0,7.0]])
      >>> a = np.asarray(a, np.float64)
      >>> a_gpu = gpuarray.to_gpu(a)
      >>> cholesky(a_gpu)
      >>> np.allclose(a_gpu.get(), scipy.linalg.cholesky(a)[0])
      True
      """
  
      if a_gpu.dtype == np.float32:
          use_double = 0
          use_complex = 0
      elif a_gpu.dtype == np.float64:
          use_double = 1
          use_complex = 0
      elif a_gpu.dtype == np.complex64:
          use_double = 0
          use_complex = 1
      elif a_gpu.dtype == np.complex128:
          use_double = 1
          use_complex = 1
      else:
          raise ValueError("unrecognized type")
  
      cho_factor(a_gpu, uplo, lib)
  
      N = a_gpu.shape[0]
      dev = misc.get_current_device()
      block_dim, grid_dim = misc.select_block_grid_sizes(
          dev, a_gpu.shape
      )
  
      # Zero out the opposite triangle of the matrix
      if cublas._CUBLAS_FILL_MODE[uplo] == 0:  # 0 == L
          func = _get_triu_kernel(use_double, use_complex, cols=N)
      else:
          func = _get_tril_kernel(use_double, use_complex, cols=N)
  
      func(a_gpu, np.uint32(a_gpu.size), block=block_dim, grid=grid_dim)
  
imports: from __future__ import absolute_import, division
  from pprint import pprint
  from string import Template
  from pycuda.tools import context_dependent_memoize
  from pycuda.compiler import SourceModule
  from pycuda.reduction import ReductionKernel
  from pycuda import cumath
  import pycuda.gpuarray
  import pycuda.driver
  import pycuda.elementwise
  import pycuda.tools
  import numpy
  from .None import cublas
  from .None import cudart
  from .None import misc
  from .None import cusolver
  import sys
  from .misc import init, shutdown, add_matvec, div_matvec, mult_matvec
  from .None import install_headers
label_desc: Use image node_id 3 for calling a global function with example usage: cholesky(a_gpu, uplo, lib) without return types