

def make_thunk(self, node, storage_map, _, _2):
    mod = SourceModule('\n    __global__ void my_fct(float * i0, float * o0, int size) {\n    int i = blockIdx.x*blockDim.x + threadIdx.x;\n    if(i<size){\n        o0[i] = i0[i]*2;\n    }\n  }')
    pycuda_fct = mod.get_function('my_fct')
    inputs = [storage_map[v] for v in node.inputs]
    outputs = [storage_map[node] 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

dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/doc/hpcs2011_tutorial/pycuda_double_op.py PyCUDADoubleOp.make_thunk/VarMisuse@54/167 `v`->`node`