摘要 |
A method and apparatus for providing a vectorized version /P/ of a source program, P, wherein the apparatus (1) comprising a graph interpreter (2) is adapted to traverse nodes of a graph-based intermediate representation, IR, of a source program, P, to retrieve for each node a current operation and to maintain and update a current context, ctx, representing along with the current operation the state of the graph interpreter (2) during the graph traversal; and a staged evaluator (3) adapted to vectorize the current operation in the current context, ctx, to provide a vectorized fragment, VF, returned by the staged evaluator (3) to said graph interpreter (2) which updates the current context, ctx, with an association between a symbol of the current operation and a symbol of the vectorized fragment, VF, to generate a graph-based intermediate representation, IR', of the vectorized version /P/ of the source program, P. |