def set_cuda_kernel(lfunc): from llvmlite.llvmpy.core import MetaData, MetaDataString, Constant, Type m = lfunc.module ops = lfunc, MetaDataString.get(m, "kernel"), Constant.int(Type.int(), 1) md = MetaData.get(m, ops) nmd = m.get_or_insert_named_metadata('nvvm.annotations') nmd.add(md)
def set_cuda_kernel(lfunc): from llvmlite.llvmpy.core import MetaData, MetaDataString, Constant, Type m = lfunc.module ops = lfunc, MetaDataString.get(m, "kernel"), Constant.int(Type.int(), 1) md = MetaData.get(m, ops) nmd = m.get_or_insert_named_metadata('nvvm.annotations') nmd.add(md) # set nvvm ir version i32 = ir.IntType(32) md_ver = m.add_metadata([i32(1), i32(2), i32(2), i32(0)]) m.add_named_metadata('nvvmir.version', md_ver)