def METHOD_NAME(self):
    act = pyocl_env.PyOpenCLHostTimer("auto_kgen",0)
    act.start()
    res = ""
    for kern in list(self.kernels.values()):
        res += kern
    ident = "            "
    args_ident = "                               "
    res += "\n%s__kernel void kmain(" % ident
    for idx in range(len(self.inputs)):
        if self.inputs[idx].dtype == npy.int32:
            itype = "int  "
        else:
            itype = "float"
        iname = "in_%04d" % idx
        res  += "__global const %s *%s,\n%s " % (itype,iname,args_ident)
    res += " __global float *out)\n"
    res += "%s{\n" % ident
    res += "%s int gid = get_global_id(0);\n" % ident
    for idx in range(len(self.inputs)):
        if self.inputs[idx].dtype == npy.int32:
            itype = "int  "
        else:
            itype = "float"
        iname = "in_%04d" % idx
        res += "%s %s %s_fetch = %s[gid];\n" % (ident,itype,iname,iname)
    for stmt in self.stmts:
        res += "%s %s\n" % (ident,stmt)
    res += "%s out[gid] = _auto_res_%04d;\n" % (ident,len(self.stmts)-1)
    res += "%s}\n" % ident
    act.stop()
    pyocl_env.Manager.add_host_event(act)
    return res