<s> from __future__ import print_function , absolute_import , division <EOL> from numba import sigutils , types <EOL> from . compiler import ( compile_kernel , compile_device , AutoJitHSAKernel , <EOL> compile_device_template ) <EOL> def jit ( signature = None , device = False ) : <EOL> """<STR_LIT>""" <EOL> if signature is None : <EOL> return autojit ( device = device ) <EOL> elif not sigutils . is_signature ( signature ) : <EOL> func = signature <EOL> return autojit ( device = device ) ( func ) <EOL> else : <EOL> if device : <EOL> return _device_jit ( signature ) <EOL> else : <EOL> return _kernel_jit ( signature ) <EOL> def autojit ( device = False ) : <EOL> if device : <EOL> return _device_autojit <EOL> else : <EOL> return _kernel_autojit <EOL> def _device_jit ( signature ) : <EOL> argtypes , restype = sigutils . normalize_signature ( signature ) <EOL> def _wrapped ( pyfunc ) : <EOL> return compile_device ( pyfunc , restype , argtypes ) <EOL> return _wrapped <EOL> def _kernel_jit ( signature ) : <EOL> argtypes , restype = sigutils . normalize_signature ( signature ) <EOL> if restype is not None and restype != types . void : <EOL> msg = "<STR_LIT>" <EOL> raise TypeError ( msg . format ( restype = restype ) ) <EOL> def _wrapped ( pyfunc ) : <EOL> return compile_kernel ( pyfunc , argtypes ) <EOL> return _wrapped <EOL> def _device_autojit ( pyfunc ) : <EOL> return compile_device_template ( pyfunc ) <EOL> def _kernel_autojit ( pyfunc ) : <EOL> return AutoJitHSAKernel ( pyfunc ) </s>
