code: def make_thunk(self, node, storage_map, _, _2):
      mod = SourceModule(
          """
      __global__ void my_fct(float * i0, float * o0, int size) {
      int i = blockIdx.x*blockDim.x + threadIdx.x;
      if(i<size){
          o0[i] = i0[i]*2;
      }
    }"""
      )
      pycuda_fct = mod.get_function("my_fct")
      inputs = [storage_map[v] for v in node.inputs]
      outputs = [storage_map[v] for v in node.outputs]
  
      def thunk():
          z = outputs[0]
          if z[0] is None or z[0].shape != inputs[0][0].shape:
              z[0] = cuda.CudaNdarray.zeros(inputs[0][0].shape)
          grid = (int(numpy.ceil(inputs[0][0].size / 512.0)), 1)
          pycuda_fct(
              inputs[0][0],
              z[0],
              numpy.intc(inputs[0][0].size),
              block=(512, 1, 1),
              grid=grid,
          )
  
      return thunk
  
file_path: Theano/doc/hpcs2011_tutorial/pycuda_double_op.py
imports: from __future__ import absolute_import, print_function, division
  import numpy, theano
  import theano.misc.pycuda_init
  from pycuda.compiler import SourceModule
  import theano.sandbox.cuda
label_desc: Use image node_id 5 for calling the PyCUDADoubleOp obj's underlying member method code with example usage: obj.make_thunk(node, storage_map, _, _2) and returns: thunk