def compile_device_template(pyfunc):
 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

def compile_device_template ( pyfunc ) : 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
create a devicefunctiontemplate object and register the object to the cuda typing context .