human
Complete this python program:
def compile_device_template(pyfunc):
assistant
#Here is the Python code you requested.

    """Compile a DeviceFunctionTemplate
    """
    from .descriptor import HSATargetDesc
    dft = DeviceFunctionTemplate(pyfunc)
    class device_function_template(AbstractTemplate, ):
        key = dft
        def generic(self, args, kws):
            assert (not kws)
            return dft.compile(args)
    typingctx = HSATargetDesc.typingctx
    typingctx.insert_user_function(dft, device_function_template)
    return dft