54.  另一个实例:带INDEPENDENT 的FORALL

BACKWARDFORWARD


  • 初始化
    • a = [0,2,4,6,1,3,5,7]
      b = [6,5,4,3,2,3,4,5]
      c = [-1,-1,-1,-1,-1,-1,-1,-1]

    !HPF$ INDEPENDENT
    FORALL ( j = 1:3 )
    a(j) = a(b(j))
      c(a(j)) = a(j)*b(a(j))
    END FORALL

  • 结果得:
    a = [3,1,6,6,1,3,5,7]
    b = [6,5,4,3,2,3,4,5]
    c = [6,-1,12,-1,-1,18,-1,-1]


Copyright: NPACT BACKWARDFORWARD