Ejemplo n.º 1
0
    def test_popcnt_ssse3_combinations(self):
        arena._has_popcnt = True
        arena._has_ssse3 = True
        
        self.data = {"align8-large": "POPCNT",
                     "align8-small": "POPCNT",
                     "align-ssse3": "ssse3"}
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 8)
        
        self.data = {"align8-large": "POPCNT",
                     "align8-small": "LUT8-1",
                     "align-ssse3": "ssse3"}
        self.assertEquals(arena.get_optimal_alignment(300), 64)
        self.assertEquals(arena.get_optimal_alignment(800), 8)

        self.data = {"align8-large": "LUT8-1",
                     "align8-small": "POPCNT",
                     "align-ssse3": "ssse3"}
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 64)

        self.data = {"align8-large": "LUT8-1",
                     "align8-small": "LUT8-1",
                     "align-ssse3": "ssse3"}
        self.assertEquals(arena.get_optimal_alignment(300), 64)
        self.assertEquals(arena.get_optimal_alignment(800), 64)

        # And now, with SSSE3 disabled

        self.data = {"align8-large": "POPCNT",
                     "align8-small": "POPCNT",
                     "align-ssse3": "POPCNT"}
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 8)
        
        self.data = {"align8-large": "POPCNT",
                     "align8-small": "LUT8-1",
                     "align-ssse3": "POPCNT"}
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 8)

        self.data = {"align8-large": "LUT8-1",
                     "align8-small": "POPCNT",
                     "align-ssse3": "POPCNT"}
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 8)

        self.data = {"align8-large": "LUT8-1",
                     "align8-small": "LUT8-1",
                     "align-ssse3": "POPCNT"}
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 8)
Ejemplo n.º 2
0
 def test_small(self):
     for i in range(9, 33):
         self.assertEquals(arena.get_optimal_alignment(i), 4)
Ejemplo n.º 3
0
 def test_medium(self):
     arena._has_popcnt = False
     arena._has_ssse3 = False
     for i in range(35, 225):
         self.assertEquals(arena.get_optimal_alignment(i), 8)
Ejemplo n.º 4
0
 def test_tiny(self):
     for i in range(1, 9):
         self.assertEquals(arena.get_optimal_alignment(i), 1)
Ejemplo n.º 5
0
    def test_popcnt_ssse3_combinations(self):
        arena._has_popcnt = True
        arena._has_ssse3 = True

        self.data = {
            "align8-large": "POPCNT",
            "align8-small": "POPCNT",
            "align-ssse3": "ssse3"
        }
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 8)

        self.data = {
            "align8-large": "POPCNT",
            "align8-small": "LUT8-1",
            "align-ssse3": "ssse3"
        }
        self.assertEquals(arena.get_optimal_alignment(300), 64)
        self.assertEquals(arena.get_optimal_alignment(800), 8)

        self.data = {
            "align8-large": "LUT8-1",
            "align8-small": "POPCNT",
            "align-ssse3": "ssse3"
        }
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 64)

        self.data = {
            "align8-large": "LUT8-1",
            "align8-small": "LUT8-1",
            "align-ssse3": "ssse3"
        }
        self.assertEquals(arena.get_optimal_alignment(300), 64)
        self.assertEquals(arena.get_optimal_alignment(800), 64)

        # And now, with SSSE3 disabled

        self.data = {
            "align8-large": "POPCNT",
            "align8-small": "POPCNT",
            "align-ssse3": "POPCNT"
        }
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 8)

        self.data = {
            "align8-large": "POPCNT",
            "align8-small": "LUT8-1",
            "align-ssse3": "POPCNT"
        }
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 8)

        self.data = {
            "align8-large": "LUT8-1",
            "align8-small": "POPCNT",
            "align-ssse3": "POPCNT"
        }
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 8)

        self.data = {
            "align8-large": "LUT8-1",
            "align8-small": "LUT8-1",
            "align-ssse3": "POPCNT"
        }
        self.assertEquals(arena.get_optimal_alignment(300), 8)
        self.assertEquals(arena.get_optimal_alignment(800), 8)
Ejemplo n.º 6
0
 def test_medium(self):
     arena._has_popcnt = False
     arena._has_ssse3 = False
     for i in range(35, 225):
         self.assertEquals(arena.get_optimal_alignment(i), 8)
Ejemplo n.º 7
0
 def test_small(self):
     for i in range(9, 33):
         self.assertEquals(arena.get_optimal_alignment(i), 4)
Ejemplo n.º 8
0
 def test_tiny(self):
     for i in range(1, 9):
         self.assertEquals(arena.get_optimal_alignment(i), 1)