- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
Can "those in the the know" confirm if a stack temp is created for the following forall statement:
forall (index=start:finish:step) array(index)=array(index) * scalar
(where start!=lbound(array) and/or finish!=ubound(array) )
This is related to a previous post I made regarding stack temps and implicit array assignments of the form:
array(:) = array(:) * scalar
I had thought that the forall statement helped the compiler perform some autoparallelisation due to non-dependencies in the forall loop expression. Unfortunately, my code is now terminating with seg faults when my array
size is > 2^24 ( I run some big calculations).
I had assumed that a forall was just syntatic sugar for special cases of an explicit do loop and hence would not incurr stack temps. My tests though have proved otherwise. Can someone confirm this?
By the way when I replace the forall with an explicit do loop all is well. Also the -heap-array parameter has no effect on the forall as far as I can tell.
Regards,
Tim.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim,
This is easy enough for you to check out. Compile with array bounds checking Off. Place a break point on the forall. Then on break open a Dissassembly window. Don't be intimidated by assembler code. Step through the assembly code, you should be smart enough to follow what is happening and see if a stack temp is used.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page