Esempio n. 1
0
 def ta_literal(self, fc, x, y):
     intervals = [Interval(x, 0, 0), Interval(y, 0, 0)]
     intervals_swap = [Interval(y, 0, 0), Interval(x, 0, 0)]
     fwd_ispace = IterationSpace(intervals,
                                 directions={
                                     x: Forward,
                                     y: Forward
                                 })
     fwd_ispace_swap = IterationSpace(intervals_swap,
                                      directions={
                                          x: Forward,
                                          y: Forward
                                      })
     mixed_ispace = IterationSpace(intervals,
                                   directions={
                                       x: Backward,
                                       y: Forward
                                   })
     tcxy_w0 = TimedAccess(fc[x, y], 'W', 0, fwd_ispace)
     tcxy_r0 = TimedAccess(fc[x, y], 'R', 0, fwd_ispace)
     tcx1y1_r1 = TimedAccess(fc[x + 1, y + 1], 'R', 1, fwd_ispace)
     tcx1y_r1 = TimedAccess(fc[x + 1, y], 'R', 1, fwd_ispace)
     rev_tcxy_w0 = TimedAccess(fc[x, y], 'W', 0, mixed_ispace)
     rev_tcx1y1_r1 = TimedAccess(fc[x + 1, y + 1], 'R', 1, mixed_ispace)
     tcyx_irr0 = TimedAccess(fc[y, x], 'R', 0, fwd_ispace)
     tcxx_irr1 = TimedAccess(fc[x, x], 'R', 0, fwd_ispace)
     tcxy_irr2 = TimedAccess(fc[x, y], 'R', 0, fwd_ispace_swap)
     return (tcxy_w0, tcxy_r0, tcx1y1_r1, tcx1y_r1, rev_tcxy_w0,
             rev_tcx1y1_r1, tcyx_irr0, tcxx_irr1, tcxy_irr2)
Esempio n. 2
0
 def ta_literal(self, fc):
     intervals = [Interval(x, 0, 0), Interval(y, 0, 0)]
     fwd_ispace = IterationSpace(intervals, directions={x: Forward, y: Forward})
     mixed_ispace = IterationSpace(intervals, directions={x: Backward, y: Forward})
     tcxy_w0 = TimedAccess(fc[x, y], 'W', 0, fwd_ispace)
     tcxy_r0 = TimedAccess(fc[x, y], 'R', 0, fwd_ispace)
     tcx1y1_r1 = TimedAccess(fc[x + 1, y + 1], 'R', 1, fwd_ispace)
     tcx1y_r1 = TimedAccess(fc[x + 1, y], 'R', 1, fwd_ispace)
     rev_tcxy_w0 = TimedAccess(fc[x, y], 'W', 0, mixed_ispace)
     rev_tcx1y1_r1 = TimedAccess(fc[x + 1, y + 1], 'R', 1, mixed_ispace)
     return tcxy_w0, tcxy_r0, tcx1y1_r1, tcx1y_r1, rev_tcxy_w0, rev_tcx1y1_r1
Esempio n. 3
0
    def __new__(cls, indexed, mode, timestamp, ispace=None):
        assert mode in cls._modes
        assert is_integer(timestamp)

        obj = super(TimedAccess, cls).__new__(cls, indexed)

        obj.indexed = indexed
        obj.function = indexed.function
        obj.mode = mode
        obj.timestamp = timestamp

        obj.ispace = ispace or IterationSpace([])

        return obj
Esempio n. 4
0
    def __new__(cls, access, mode, timestamp, ispace=None):
        assert mode in cls._modes
        assert is_integer(timestamp)

        obj = super().__new__(cls, access)

        obj.access = access
        obj.function = access.function
        obj.mode = mode
        obj.timestamp = timestamp

        obj.ispace = ispace or IterationSpace([])

        return obj