code: def test_prepared_invocation(self):
      a = np.random.randn(4, 4).astype(np.float32)
      a_gpu = drv.mem_alloc(a.size * a.dtype.itemsize)
  
      drv.memcpy_htod(a_gpu, a)
  
      mod = SourceModule(
          """
              __global__ void doublify(float *a)
              {
                int idx = threadIdx.x + threadIdx.y*blockDim.x;
                a[idx] *= 2;
              }
              """
      )
  
      func = mod.get_function("doublify")
      func.prepare("P")
      func.prepared_call((1, 1), (4, 4, 1), a_gpu, shared_size=20)
      a_doubled = np.empty_like(a)
      drv.memcpy_dtoh(a_doubled, a_gpu)
      print(a)
      print(a_doubled)
      assert la.norm(a_doubled - 2 * a) == 0
  
      # now with offsets
      func.prepare("P")
      a_quadrupled = np.empty_like(a)
      func.prepared_call(
          (1, 1), (15, 1, 1), int(a_gpu) + a.dtype.itemsize
      )
      drv.memcpy_dtoh(a_quadrupled, a_gpu)
      assert la.norm(a_quadrupled[1:] - 4 * a[1:]) == 0
  
imports: import numpy
  import numpy.linalg
  from pycuda.tools import mark_cuda_test, dtype_to_ctype
  import pytest
  import pycuda.gpuarray
  import pycuda.driver
  from pycuda.compiler import SourceModule
label_desc: Use image node_id 25 for calling the TestDriver obj's underlying member method code with example usage: obj.test_prepared_invocation() without return types