Omitting the Map Clause
As mentioned in the previous page, if the map clause is omitted, then all non-scalars will be mapped with the map-type tofrom and scalars will be treated as firstprivate, which means scalars are copied to the device on entry but not copied back on exit. If a scalar is modified inside the target region, the value of the scalar remains unchanged on the host.
Interestingly, if OMP_TARGET_OFFLOAD is disabled, the result is still the same. The scalar will not be modified on the host, because the threads that execute the structured block (also on the host) get private copies of the scalar.
©
|
Cornell University
|
Center for Advanced Computing
|
Copyright Statement
|
Access Statement
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)