Beispiel #1
0
    def _autotune(self, args, setup):
        if setup is False:
            return args
        elif setup is True:
            level = configuration['autotuning'].level or 'basic'
            args, summary = autotune(self, args, level,
                                     configuration['autotuning'].mode)
        elif isinstance(setup, str):
            args, summary = autotune(self, args, setup,
                                     configuration['autotuning'].mode)
        elif isinstance(setup, tuple) and len(setup) == 2:
            level, mode = setup
            if level is False:
                return args
            else:
                args, summary = autotune(self, args, level, mode)
        else:
            raise ValueError(
                "Expected bool, str, or 2-tuple, got `%s` instead" %
                type(setup))

        # Record the tuned values
        self._state.setdefault('autotuning', []).append(summary)

        return args
Beispiel #2
0
 def _autotune(self, arguments):
     """
     Use auto-tuning on this Operator to determine empirically the
     best block sizes when loop blocking is in use.
     """
     if self.dle_flags.get('blocking', False):
         return autotune(self, arguments, self.dle_arguments)
     else:
         return arguments
 def _autotune(self, args):
     """
     Use auto-tuning on this Operator to determine empirically the
     best block sizes when loop blocking is in use.
     """
     if self.dle_flags.get('blocking', False):
         # AT assumes and ordered dict, so let's feed it one
         args = OrderedDict([(p.name, args[p.name])
                             for p in self.parameters])
         return autotune(self, args, self.dle_args)
     else:
         return args
Beispiel #4
0
    def _autotune(self, args, setup):
        if setup is False:
            return args
        elif setup is True:
            level = configuration['autotuning'].level or 'basic'
            args, summary = autotune(self, args, level, configuration['autotuning'].mode)
        elif isinstance(setup, str):
            args, summary = autotune(self, args, setup, configuration['autotuning'].mode)
        elif isinstance(setup, tuple) and len(setup) == 2:
            level, mode = setup
            if level is False:
                return args
            else:
                args, summary = autotune(self, args, level, mode)
        else:
            raise ValueError("Expected bool, str, or 2-tuple, got `%s` instead"
                             % type(setup))

        # Record the tuned values
        self._state.setdefault('autotuning', []).append(summary)

        return args
Beispiel #5
0
 def _autotune(self, args):
     if self._dle_flags.get('blocking', False):
         return autotune(self, args, self.parameters, self._dle_args)
     else:
         return args