@dace.program(datatype[(N, N)], datatype[(N, N)], datatype[N], datatype[N], datatype[N], datatype[1], datatype[1])
def gesummv(A, B, tmp, x, y, alpha, beta):

    @dace.map
    def compute_ty(i: _[0:N], j: _[0:N]):
        (ia << A[(i, j)])
        (ib << B[(i, j)])
        (ix << x[j])
        (ot >> tmp(1, (lambda a, b: (a + b)), 0)[i])
        (oy >> y(1, (lambda a, b: (a + b)), 0)[i])
        ot = (ia * ix)
        oy = (ib * ix)

    @dace.map
    def update_y(i: _[0:N]):
        (iy << y[i])
        (ialpha << alpha)
        (ibeta << beta)
        (it << tmp[i])
        (oy >> y[i])
        oy = ((ialpha * it) + (ibeta * iy))
@dace.program(datatype[(N, N)], datatype[(N, N)], datatype[N], datatype[N], datatype[N], datatype[1], datatype[1])
def gesummv(A, B, tmp, x, y, alpha, beta):

    @dace.map
    def compute_ty(i: _[0:N], j: _[0:N]):
        (ia << A[(i, j)])
        (ib << B[(i, j)])
        (ix << x[j])
        (ot >> tmp(1, (lambda a, b: (a + b)), 0)[i])
        (oy >> y(1, (lambda a, b: (a + b)), 0)[i])
        ot = (ia * ix)
        oy = (ib * ix)

    @dace.map
    def update_y(i: _[0:N]):
        (iy << y[i])
        (ialpha << alpha)
        (ibeta << beta)
        (it << tmp[i])
        (oy >> y[i])
        oy = ((ialpha * it) + (ibeta * iy))