Пример #1
0
 def test_cyclic_dag(self):
     dg = KernelDG(self.kernel_x86, self.parser_x86, self.machine_model_csx)
     dg.dg.add_edge(100, 101, latency=1.0)
     dg.dg.add_edge(101, 102, latency=2.0)
     dg.dg.add_edge(102, 100, latency=3.0)
     with self.assertRaises(NotImplementedError):
         dg.get_critical_path()
     with self.assertRaises(NotImplementedError):
         dg.get_loopcarried_dependencies()
Пример #2
0
    def full_analysis(self,
                      kernel,
                      kernel_dg: KernelDG,
                      ignore_unknown=False,
                      arch_warning=False,
                      length_warning=False,
                      verbose=False):
        """
        Build the full analysis report including header, the symbol map, the combined TP/CP/LCD
        view and the list based LCD view.

        :param kernel: kernel to report on
        :type kernel: list
        :param kernel_dg: directed graph containing CP and LCD
        :type kernel_dg: :class:`~osaca.semantics.KernelDG`
        :param ignore_unknown: flag for ignore warning if performance data is missing, defaults to
            `False`
        :type ignore_unknown: boolean, optional
        :param print_arch_warning: flag for additional user warning to specify micro-arch 
        :type print_arch_warning: boolean, optional
        :param print_length_warning: flag for additional user warning to specify kernel length with --lines
        :type print_length_warning: boolean, optional
        :param verbose: flag for verbosity level, defaults to False
        :type verbose: boolean, optional
        """
        return (self._header_report() +
                self._user_warnings(arch_warning, length_warning) +
                self._symbol_map() + self.combined_view(
                    kernel,
                    kernel_dg.get_critical_path(),
                    kernel_dg.get_loopcarried_dependencies(),
                    ignore_unknown,
                ) + self.loopcarried_dependencies(
                    kernel_dg.get_loopcarried_dependencies()))
Пример #3
0
 def test_frontend_x86(self):
     dg = KernelDG(self.kernel_x86, self.parser_x86, self.machine_model_csx)
     fe = Frontend(
         path_to_yaml=os.path.join(self.MODULE_DATA_DIR, 'csx.yml'))
     fe.throughput_analysis(self.kernel_x86, show_cmnts=False)
     fe.latency_analysis(dg.get_critical_path())
Пример #4
0
 def get_cp(self):
     kernel_graph = KernelDG(self.kernel, self.parser, self.machine_model)
     kernel_cp = kernel_graph.get_critical_path()
     return sum([x['latency_cp'] for x in kernel_cp])