[J3] Why is += missing?
Jeff Hammond
jehammond at nvidia.com
Thu Aug 26 12:54:20 UTC 2021
I omitted the loops for clarity. Anyone wishing to explore the full syntactic misery of my life can peruse https://github.com/jeffhammond/nwchem-tce-triples-kernels.
Jeff
From: J3 <j3-bounces at mailman.j3-fortran.org> on behalf of Damian Rouson via J3 <j3 at mailman.j3-fortran.org>
Date: Thursday, August 26, 2021 at 2:46 AM
To: General J3 interest list <j3 at mailman.j3-fortran.org>
Cc: Damian Rouson <damian at sourceryinstitute.org>
Subject: Re: [J3] Why is += missing?
External email: Use caution opening links or attachments
On Wed, Aug 25, 2021 at 6:27 AM Jeff Hammond via J3 <j3 at mailman.j3-fortran.org<mailto:j3 at mailman.j3-fortran.org>> wrote:
I will argue that it is syntactic sugar in the same sense that multidimensional arrays are. Below is the perfectly functional C code I wrote to match my Fortran years ago (because computer scientists don’t know their history). There is no actual need for multidimensional arrays in Fortran, just the practical difficulty of not having them.
// t3(h3,h2,h1,p6,p5,p4)+=t1(p4,h1)*v2(h3,h2,p6,p5);
t3[h3+h3u*(h2+h2u*(h1+h1u*(p6+p6u*(p5+p5u*p4))))] += t1[p4+p4u*h1] * v2[h3+h3u*(h2+h2u*(p6+p6u*p5))];
Jeff,
If I'm interpreting the responses accurately, it sounds like the idea simply fell too far down the list of priorities, but I haven't heard any fundamental resistance modulo syntax. Hopefully that's encouraging.
Is the provided C code really so short or were the nested for loops omitted for the sake of brevity?
Damian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210826/86e700ec/attachment.htm>
More information about the J3
mailing list