<html><body><p>Hi Jonas,<br><br>I think you are correct, we need to register the device and initialize it for #target update and #target data directives not only the #target directive. I'll send a fix for that soon.<br><br>Thanks,<br>Samuel<br><br><img width="16" height="16" src="cid:1__=8FBBF5A0DFDAFE268f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for Jonas Hahnfeld ---01/07/2016 02:53:44 AM---Hahnfeld added a comment. In http://reviews.llvm.org/D1403"><font color="#424282">Jonas Hahnfeld ---01/07/2016 02:53:44 AM---Hahnfeld added a comment. In <a href="http://reviews.llvm.org/D14031#320528">http://reviews.llvm.org/D14031#320528</a>, @RaviNarayanaswamy wrote:</font><br><br><font size="2" color="#5F5F5F">From:        </font><font size="2">Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de></font><br><font size="2" color="#5F5F5F">To:        </font><font size="2">Samuel F Antao/Watson/IBM@IBMUS, hfinkel@anl.gov, jonathan.l.peyton@intel.com, james.h.cownie@intel.com, a.bataev@hotmail.com, chandlerc@gmail.com, ravi.narayanaswamy@intel.com</font><br><font size="2" color="#5F5F5F">Cc:        </font><font size="2">f.brygidyn@samsung.com, Alexandre Eichenberger/Watson/IBM@IBMUS, openmp-commits@lists.llvm.org, Hahnfeld@itc.rwth-aachen.de, hyviquel@gmail.com, Kevin K O'Brien/Watson/IBM@IBMUS, Carlo Bertolli/Watson/IBM@IBMUS, andreybokhanko@gmail.com, sergos.gnu@gmail.com</font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">01/07/2016 02:53 AM</font><br><font size="2" color="#5F5F5F">Subject:        </font><font size="2">Re: [PATCH] D14031: [OpenMP] Initial implementation of OpenMP offloading library - libomptarget.</font><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><tt>Hahnfeld added a comment.<br><br>In </tt><tt><a href="http://reviews.llvm.org/D14031#320528">http://reviews.llvm.org/D14031#320528</a></tt><tt>, @RaviNarayanaswamy wrote:<br><br>> OpenMP says : " If the corresponding list item is not present in the device data environment then no assignment occurs to or from the original list item."<br>><br>> Device.IsInit being false can be one's implementation as the list item not present in the device data environment.<br>><br>> Ravi<br><br><br>Sorry for not directly posting the code in question that I had in mind:<br><br>  #include <stdio.h><br>  <br>  #pragma omp declare target<br>  int a = 1;<br>  #pragma omp end declare target<br>  <br>  int main(int argc, char* argv[]) {<br>                   a = 2;<br>                   #pragma omp target update to(a)<br>  <br>                   #pragma omp target<br>                   {<br>                                    printf("a = %d\n", a);<br>                   }<br>  <br>                   return 0;<br>  }<br><br>What would the expected result be? However I just noticed that yesterday's simple `init()` didn't change it to `2` because the code and global variables are still only mapped in the first `omp target`...<br><br><br></tt><tt><a href="http://reviews.llvm.org/D14031">http://reviews.llvm.org/D14031</a></tt><tt><br><br><br><br></tt><br><BR>
</body></html>