[sac-user] Need more help on pass by reference

Salem Reyen salemreyen at yahoo.com
Sun Aug 22 05:35:58 CEST 2010

I have a C function which adds two double precision vectors, ie, 
add(double* X, double *Y, double* Z) where vectors X and Y are
the input vectors and Z is the output vector.  In SaC, I declare
A, B, C to be double precision vectors.

Based on Bodo's example, I can declare

external double[.] add(double[.] X, double[.] Y, double[.] Z);
#pragma linksign[3,1,2,3]

And then I can call the function add for C = A + B by
C = add(A, B, C);

Now my question is how can SaC compiler handle the cases such as
A = A + B and A = A + A?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sac-home.org/pipermail/sac-user/attachments/20100821/d52d5a92/attachment-0002.html>

More information about the sac-user mailing list