For Programmers: Free Programming Magazines  


Home > Archive > Fortran > June 2007 > Re: fortran equivalent of c memset









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: fortran equivalent of c memset
Tim Prince

2007-06-14, 10:07 pm

Lynn McGuire wrote:
> Is there a fortran equivalent of the c memset function ? That you can
> use to very efficiently zero an array of memory ?
>
> Thanks,
> Lynn
>

For some targets where it can be done efficiently, Fortran does actually
compile code which zeroes a contiguous array into a memset() call.
On many targets, the extra overhead of dealing with odd byte alignments,
as memset() must do, is better avoided by simply assigning 0 to an
array, as suggested in another response. Nowadays, there is not even
any point in causing a 64-bit or greater data type to overlay a default
real data type. Not even in C. Vectorizing compilers will automatically
generate a multi-word zero in order to optimize such an operation.
ifort for Xeon/Opteron targets has the directive
!dir$ vector nontemporal
which will prevent a following assignment to an array from filling
cache. pgf90 has compile options which produce the same effect, whenever
the compiler deems it conceivable that it may help.
Uptendickster28

2007-06-15, 10:49 am

Alyssa Milano and Shania Twain , Satisfying Her Lesbian Girlfriend!
http://www.videomoviesonline.com/Wi...sp?clip=1673286

Hilary Duff and Christina Aguilera Big Tits Mature Lesbian Sex!
http://www.videomoviesonline.com/PlayFile?clip=1673286

Sarah M. Gellar and Alyssa Milano Have Fun In Sauna!
http://www.videomoviesonline.com/Wa...e?watch=1673286

Angelina Jolie and Christina Applegate Hardest Lesbians Wrestling Match!
http://www.videomoviesonline.com/PlayFile?movie=1673286

Alyssa Milano and Heather Locklear , Satisfying Her Lesbian Girlfriend!
http://www.videomoviesonline.com/d?movie=1673286
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com