<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Sergey,<div class=""><br class=""></div><div class="">Thank you for the comment, I think you are right :-)</div><div class="">Indeed, the example with threads is quite convincing... I still need to figure out some technical details during the code generation specific to my target but I will try to make a new pull request next week.</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Hervé</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">Le 15 oct. 2015 à 11:41, Sergey Ostanevich <<a href="mailto:sergos.gnu@gmail.com" class="">sergos.gnu@gmail.com</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Herve,<div class=""><br class=""></div><div class="">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 class="">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 class=""><br class=""></div><div class="">Regards,</div><div class="">Sergos</div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Oct 9, 2015 at 6:44 PM, Hervé Yviquel <span dir="ltr" class=""><<a href="mailto:openmp-dev@lists.llvm.org" target="_blank" class="">openmp-dev@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hi all,<div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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" class="">https://github.com/clang-omp/</a>). If needed, I can make a push request directly in github.</div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div>Regards,<br class=""><div class=""><div style="word-wrap:break-word" class=""><div class="">--</div><div class="">Hervé Yviquel</div><div class=""><div class="">Postdoc researcher</div><div class=""><div class="">Instituto de Computação (IC) - UNICAMP</div><div class=""><a href="http://people.irisa.fr/Herve.Yviquel/" target="_blank" class="">http://people.irisa.fr/Herve.Yviquel/</a></div><div class=""><br class=""></div><div class=""></div></div></div></div></div></div><br class=""><div style="word-wrap:break-word" class=""><div class=""><div style="word-wrap:break-word" class=""><div class=""><div class=""><div class=""></div></div></div></div></div></div><br class=""><div style="word-wrap:break-word" class=""><div class=""><div style="word-wrap:break-word" class=""><div class=""><div class=""><div class=""></div></div></div></div></div></div><br class="">_______________________________________________<br class="">
Openmp-dev mailing list<br class="">
<a href="mailto:Openmp-dev@lists.llvm.org" class="">Openmp-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>