- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you mention (accidentally) a variable twice in an OMP 4.0 target update clause icc 14.0.2 will not detect this and instead ignore it.
Sample Code:
#include <stdio.h> #include <stdlib.h> #pragma omp declare target int x,y; #pragma omp end declare target int main (int argc, char *argv[]) { x = 4; y = 5; #pragma omp target update to(x,y) #pragma omp target printf("4=%d 5=%d\n",x,y); x = 8; y = 9; #pragma omp target update to(y,x,y) #pragma omp target printf("8=%d 9=%d\n",x,y); //Output is "8=8 9=5" (!!!!) return EXIT_SUCCESS; }
See the 2nd printf.
This just caused me a lot of trouble as I had a huge update statement with one duplicate variable which silently messed up the whole program.
Please make this an error!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Out of curiosity, if you mention the variable 3 times does it work (iow the internals of the compiler is ++'ing the update flag)?
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
Just noticed this issue. Yes, the compiler should flag this as an error :-( I'll file this issue with our developers and will keep you updated, appreciate much.
_Kittur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alex, interestingly enough when I tried private(x,x) the compiler does flag an error so for this case (issue) it should similarly flag accordingly....
_Kittur

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