- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you compile the following code with ifort -openmp the compiler will detect the variable wrongly as a "map(to" directive and complain about an unknown variable.
Similar in the omp update statement it wrongly complains about an unexpected "TO"
program fortTest integer top_value top_value = 0 !$omp target data map(top_value) top_value = 1 !$omp target update from(top_value) !$omp end target data end
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is an unfortunate defect that I reported to Development for repair (see internal tracking id below). As you noted, the compiler misinterprets any variable beginning with the string “to” when appearing before map and update from.
To work around this, you may change the variable to not begin with “to”, so you might use something like: t0p_value
Another work around to preserve the use of the variable “top_value” when using map is to add the clause tofrom: (equivalent to the default used map-type is unspecified) as in:
!$omp target data map(tofrom: top_value)
Unfortunately for update from, the only work around I could find was to add another variable between the “from(“ and the variable beginning with the string “to”, as in:
!$omp target update from (t1, top_value)
I hope either of those workarounds will enable you to move forward and thank you for making us aware of this defect.
(Internal tracking id: DPD200255241)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please note, that this also applies to any other keywords that are prefixes of variable names
program fortTest integer top_value integer from_value top_value = 0 !$omp target data map(top_value) map(from_value) top_value = 1 !$omp target update from(top_value) !$omp target update to(from_value) !$omp end target data end
So the same happens to "from_value".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I added that to the report. It also occurs with other !$omp target directive form also. Thank you for the additional note.

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