def inspect(self, mode):
        """Inspect this Inspector's loop chain and produce a Schedule object.

        :param mode: can take any of the values in ``Inspector._modes``, namely
                     ``soft``, ``hard``, and ``tile``. If ``soft`` is specified,
                     only soft fusion takes place; that is, only consecutive loops
                     over the same iteration set that do not present RAW or WAR
                     dependencies through indirections are fused. If ``hard`` is
                     specified, then first ``soft`` is applied, followed by fusion
                     of loops over different iteration sets, provided that RAW or
                     WAR dependencies are not present. If ``tile`` is specified,
                     than tiling through the SLOPE library takes place just after
                     ``soft`` and ``hard`` fusion.
        """
        self._inspected += 1
        if self._heuristic_skip_inspection(mode):
            # Heuristically skip this inspection if there is a suspicion the
            # overhead is going to be too much; for example, when the loop
            # chain could potentially be executed only once or a few times.
            # Blow away everything we don't need any more
            del self._name
            del self._loop_chain
            del self._tile_size
            return PlainSchedule()
        elif hasattr(self, '_schedule'):
            # An inspection plan is in cache.
            # It should not be possible to pull a jit module out of the cache
            # /with/ the loop chain
            if hasattr(self, '_loop_chain'):
                raise RuntimeError("Inspector is holding onto loop_chain, memory leaks!")
            # The fusion mode was recorded, and must match the one provided for
            # this inspection
            if self.mode != mode:
                raise RuntimeError("Cached Inspector's mode doesn't match")
            return self._schedule
        elif not hasattr(self, '_loop_chain'):
            # The inspection should be executed /now/. We weren't in the cache,
            # so we /must/ have a loop chain
            raise RuntimeError("Inspector must have a loop chain associated with it")
        # Finally, we check the legality of `mode`
        if mode not in Inspector._modes:
            raise TypeError("Inspection accepts only %s fusion modes",
                            str(Inspector._modes))
        self._mode = mode
        mode = Inspector._modes.index(mode)

        with timed_region("ParLoopChain `%s`: inspector" % self._name):
            self._soft_fuse()
            if mode > 0:
                self._hard_fuse()
            if mode > 1:
                self._tile()

        # A schedule has been computed by any of /_soft_fuse/, /_hard_fuse/ or
        # or /_tile/; therefore, consider this Inspector initialized, and
        # retrievable from cache in subsequent calls to inspect().
        self._initialized = True

        # Blow away everything we don't need any more
        del self._name
        del self._loop_chain
        del self._tile_size
        return self._schedule
dataset/ETHPy150Open OP2/PyOP2/pyop2/fusion.py/Inspector.inspect/original