human
Complete this python program:
def compile_device_template(pyfunc, debug=False, inline=False):
assistant
#Here is the Python program you requested.

    """Create a DeviceFunctionTemplate object and register the object to
    the CUDA typing context.
    """
    from .descriptor import CUDATargetDesc
    dft = DeviceFunctionTemplate(pyfunc, debug=debug, inline=inline)
    class device_function_template(AbstractTemplate, ):
        key = dft
        def generic(self, args, kws):
            assert (not kws)
            return dft.compile(args)
    typingctx = CUDATargetDesc.typingctx
    typingctx.insert_user_function(dft, device_function_template)
    return dft