@@ -716,37 +716,30 @@ def _get_impl(self, args, kws):
716716 def _get_jit_decorator (self ):
717717 """Gets a jit decorator suitable for the current target"""
718718
719- jitter_str = self .metadata .get ('target' , None )
720- if jitter_str is None :
721- from numba import jit
722- # There is no target requested, use default, this preserves
723- # original behaviour
724- jitter = lambda * args , ** kwargs : jit (* args , nopython = True , ** kwargs )
725- else :
726- from numba .core .target_extension import (target_registry ,
727- get_local_target ,
728- jit_registry )
729-
730- # target has been requested, see what it is...
731- jitter = jit_registry .get (jitter_str , None )
732-
733- if jitter is None :
734- # No JIT known for target string, see if something is
735- # registered for the string and report if not.
736- target_class = target_registry .get (jitter_str , None )
737- if target_class is None :
738- msg = ("Unknown target '{}', has it been " ,
739- "registered?" )
740- raise ValueError (msg .format (jitter_str ))
741-
742- target_hw = get_local_target (self .context )
743-
744- # check that the requested target is in the hierarchy for the
745- # current frame's target.
746- if not issubclass (target_hw , target_class ):
747- msg = "No overloads exist for the requested target: {}."
748-
749- jitter = jit_registry [target_hw ]
719+ from numba .core .target_extension import (target_registry ,
720+ get_local_target ,
721+ jit_registry )
722+
723+ jitter_str = self .metadata .get ('target' , 'generic' )
724+ jitter = jit_registry .get (jitter_str , None )
725+
726+ if jitter is None :
727+ # No JIT known for target string, see if something is
728+ # registered for the string and report if not.
729+ target_class = target_registry .get (jitter_str , None )
730+ if target_class is None :
731+ msg = ("Unknown target '{}', has it been " ,
732+ "registered?" )
733+ raise ValueError (msg .format (jitter_str ))
734+
735+ target_hw = get_local_target (self .context )
736+
737+ # check that the requested target is in the hierarchy for the
738+ # current frame's target.
739+ if not issubclass (target_hw , target_class ):
740+ msg = "No overloads exist for the requested target: {}."
741+
742+ jitter = jit_registry [target_hw ]
750743
751744 if jitter is None :
752745 raise ValueError ("Cannot find a suitable jit decorator" )
0 commit comments