Exemplo n.º 1
0
    def _make_exprs_passes_mapper(cls, **kwargs):
        options = kwargs['options']

        # This callback simply mimics `is_on_device`, used in the device backends.
        # It's used by `buffering` to replace `save!=None` TimeFunctions with buffers
        def callback(f):
            if f.is_TimeFunction and f.save is not None:
                return [f.time_dim]
            else:
                return None

        return {'buffering': lambda i: buffering(i, callback, options)}
Exemplo n.º 2
0
    def _make_exprs_passes_mapper(cls, **kwargs):
        options = kwargs['options']

        # This callback is used by `buffering` to replace host Functions with
        # Arrays, used as device buffers for streaming-in and -out of data
        def callback(f):
            if not is_on_device(f, options['gpu-fit']):
                return [f.time_dim]
            else:
                return None

        return {'buffering': lambda i: buffering(i, callback, options)}