code: def _convolve_gpu(
      inp,
      out,
      ker,
      mode,
      use_convolve,
      swapped_inputs,
  ):
      d_inp = cp.asarray(inp)
      d_kernel = cp.asarray(ker)
  
      threadsperblock, blockspergrid = _get_tpb_bpg()
  
      if use_convolve:
          k_type = "convolve"
  
          _populate_kernel_cache(out.dtype, k_type)
  
          kernel = _get_backend_kernel(
              out.dtype,
              blockspergrid,
              threadsperblock,
              k_type,
          )
      else:
          k_type = "correlate"
  
          _populate_kernel_cache(out.dtype, k_type)
  
          kernel = _get_backend_kernel(
              out.dtype,
              blockspergrid,
              threadsperblock,
              k_type,
          )
  
      kernel(d_inp, d_kernel, mode, swapped_inputs, out)
  
      _print_atts(kernel)
  
      return out
  
imports: import cupy
  import numpy
  from ..utils._caches import _cupy_kernel_cache
  from ..utils.helper_tools import _get_function, _get_tpb_bpg, _print_atts
  from .convolution_utils import CIRCULAR, FULL, PAD, REFLECT, SAME, VALID, _bvalfromboundary, _iDivUp, _valfrommode
label_desc: Use image node_id 3 for calling a global function with example usage: _convolve_gpu(inp, out, ker, mode, use_convolve, swapped_inputs) and returns: out