Пример #1
0
 def apply(self, sch: Schedule, block: BlockRV) -> List[Schedule]:
     if _is_root(sch, block):
         return [sch]
     new_sch = sch.copy()
     i_0, j_0, i_1, j_1, k_0, i_2, j_2, k_1, i_3, j_3 = new_sch.get_loops(block=block)
     new_sch.reorder(i_1, j_1, k_0, i_2, j_2, k_1, i_3, j_3, i_0, j_0)
     result = [new_sch]
     new_sch = sch.copy()
     i_0, j_0, i_1, j_1, k_0, i_2, j_2, k_1, i_3, j_3 = new_sch.get_loops(block=block)
     new_sch.reorder(i_1, j_3, i_0, j_0, j_1, k_0, i_2, j_2, k_1, i_3)
     result.append(new_sch)
     return result
Пример #2
0
 def apply(self, sch: Schedule, block: BlockRV) -> List[Schedule]:
     if _is_root(sch, block):
         return [sch]
     sch = sch.copy()
     if sch.get(block).name_hint == "B":
         sch.compute_inline(block)
     return [sch]
Пример #3
0
 def apply(self, sch: Schedule, block: BlockRV) -> List[Schedule]:
     if _is_root(sch, block):
         return [sch]
     new_sch = sch.copy()
     i, j = new_sch.get_loops(block=block)
     i_0, i_1 = new_sch.split(loop=i, factors=[16, 64])
     j_0, j_1 = new_sch.split(loop=j, factors=[64, 16])
     new_sch.reorder(i_0, j_0, i_1, j_1)
     result = [new_sch]
     new_sch = sch.copy()
     i, j = new_sch.get_loops(block=block)
     i_0, i_1 = new_sch.split(loop=i, factors=[2, 512])
     j_0, j_1 = new_sch.split(loop=j, factors=[2, 512])
     new_sch.reorder(i_0, j_0, i_1, j_1)
     result.append(new_sch)
     return result
Пример #4
0
 def apply(self, sch: Schedule, block: BlockRV) -> List[Schedule]:
     if _is_root(sch, block):
         return [sch]
     new_sch = sch.copy()
     i, j, k = new_sch.get_loops(block=block)
     i_0, i_1, i_2, i_3 = new_sch.split(loop=i, factors=[4, 64, 2, 2])
     j_0, j_1, j_2, j_3 = new_sch.split(loop=j, factors=[2, 4, 64, 2])
     k_0, k_1 = new_sch.split(loop=k, factors=[32, 32])
     new_sch.reorder(i_0, j_0, i_1, j_1, k_0, i_2, j_2, k_1, i_3, j_3)
     result = [new_sch]
     new_sch = sch.copy()
     i, j, k = new_sch.get_loops(block=block)
     i_0, i_1, i_2, i_3 = new_sch.split(loop=i, factors=[4, 64, 2, 2])
     j_0, j_1, j_2, j_3 = new_sch.split(loop=j, factors=[2, 4, 64, 2])
     k_0, k_1 = new_sch.split(loop=k, factors=[32, 32])
     new_sch.reorder(i_0, j_0, i_1, j_1, k_0, i_2, j_2, k_1, i_3, j_3)
     result.append(new_sch)
     return result
Пример #5
0
 def apply(self, sch: Schedule, block: BlockRV):
     if sch.get(block).name_hint == "root":
         return [sch]
     sch = sch.copy()
     sch.compute_inline(block)
     return [sch]