code: def lc2(self, a, x, b, y, out=None):
      if out is None:
          out = gpuarray.empty(
              x.shape, dtype=x.dtype, allocator=x.allocator
          )
  
      assert x.dtype == y.dtype == out.dtype
      a_is_gpu = isinstance(a, gpuarray.GPUArray)
      b_is_gpu = isinstance(b, gpuarray.GPUArray)
      assert x.shape == y.shape == out.shape
  
      kernel, texrefs = self.make_lc2_kernel(
          x.dtype, a_is_gpu, b_is_gpu
      )
  
      texrefs = texrefs[:]
  
      args = []
  
      if a_is_gpu:
          assert a.dtype == x.dtype
          assert a.shape == ()
          a.bind_to_texref_ext(texrefs.pop(0), allow_double_hack=True)
      else:
          args.append(a)
      args.append(x.gpudata)
  
      if b_is_gpu:
          assert b.dtype == y.dtype
          assert b.shape == ()
          b.bind_to_texref_ext(texrefs.pop(0), allow_double_hack=True)
      else:
          args.append(b)
      args.append(y.gpudata)
      args.append(out.gpudata)
      args.append(x.mem_size)
  
      kernel.prepared_call(x._grid, x._block, *args)
  
      return out
  
file_path: pycuda/pycuda/sparse/cg.py
imports: from __future__ import division
  from __future__ import absolute_import
  from pycuda.sparse.inner import AsyncInnerProduct
  from pytools import memoize_method
  import pycuda.driver
  import pycuda.gpuarray
  import numpy
label_desc: Use image node_id 3 for calling the CGStateContainer obj's underlying member method code with example usage: obj.lc2(a, x, b, y, out) and returns: out