<div dir="ltr">Herve,<div><br></div><div>I can't get the idea to associate an identifier with a variable. Consider you have multiple threads running on host and each thread has its own private copy of a variable. How would you name it in Clang then? How would you change naming in case number of threads is defined dynamicly?</div><div>I bet that this should be an offload library duty to associate the host address of a variable with the (file?) identifier. Then you will reuse the same identifier while mapping is alive and will replace it with the new one as soon as mapping will be re-created anew.</div><div><br></div><div>Regards,</div><div>Sergos</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 9, 2015 at 6:44 PM, Hervé Yviquel <span dir="ltr"><<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi all,<div><br></div><div>Some of my colleagues and I are currently developing the infrastructure for adding a new device, the cloud, to the list of available targets. Considering the cloud as a device requires few changes to the API of the offloading library (libomptarget). Indeed, our cloud device handles offloading data thanks to files instead of values within an address space. To do so, we had to associate each offloaded variables with a unique identifier. Those identifiers are assigned by Clang to each variable, then transmitted to libomptarget as an additional argument of the offloading function "__tgt_target". In case of pointer addresses that are not generated by Clang, the special identifier "-1" is attributed. This allows us to easily skip the offloading of these addresses that our device doesn't use.</div><div><br></div><div>You can find attached the patches including the needed modifications both for Clang and libomptarget (based on the repositories of <a href="https://github.com/clang-omp/" target="_blank">https://github.com/clang-omp/</a>). If needed, I can make a push request directly in github.</div><div><br></div><div>Let's us precise that we plan to open source all this work and to submit patches to the upstream Clang/OpenMP repositories when it will be mature enough. Additionally to simplify future integrations, those API changes can be helpful for any exotic offloading target. That's why we propose to integrate them directly.</div><div><br></div>Regards,<br><div><div style="word-wrap:break-word"><div>--</div><div>Hervé Yviquel</div><div><div>Postdoc researcher</div><div><div>Instituto de Computação (IC) - UNICAMP</div><div><a href="http://people.irisa.fr/Herve.Yviquel/" target="_blank">http://people.irisa.fr/Herve.Yviquel/</a></div><div><br></div><div></div></div></div></div></div></div><br><div style="word-wrap:break-word"><div><div style="word-wrap:break-word"><div><div><div></div></div></div></div></div></div><br><div style="word-wrap:break-word"><div><div style="word-wrap:break-word"><div><div><div></div></div></div></div></div></div><br>_______________________________________________<br>
Openmp-dev mailing list<br>
<a href="mailto:Openmp-dev@lists.llvm.org">Openmp-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><br>
<br></blockquote></div><br></div>