<html><body><p><font size="2">Hi Daniel,</font><br><br><font size="2">As Jonas said, support for declare target has not been upstreamed yet. I am working on this right now. There is a Sema patch under review, once it gets accepted I'll also upstream the codegen patch. Hopefully we'll get done with this soon.</font><br><br><font size="2">George</font><br><br><img width="16" height="16" src="cid:1__=0ABB0B7ADFFED5888f9e8a93df938690918c0AB@" border="0" alt="Inactive hide details for Daniel Schürmann via Openmp-dev ---01/12/2017 10:18:42---Hello! I wanted to ask, if this behavior is "><font size="2" color="#424282">Daniel Schürmann via Openmp-dev ---01/12/2017 10:18:42---Hello! I wanted to ask, if this behavior is on purpose or if I am missing</font><br><br><font size="2" color="#5F5F5F">From:        </font><font size="2">Daniel Schürmann via Openmp-dev <openmp-dev@lists.llvm.org></font><br><font size="2" color="#5F5F5F">To:        </font><font size="2">openmp-dev <openmp-dev@lists.llvm.org></font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">01/12/2017 10:18</font><br><font size="2" color="#5F5F5F">Subject:        </font><font size="2">[Openmp-dev] clang: Emit Target Functions when #pragma omp declare        target</font><br><font size="2" color="#5F5F5F">Sent by:        </font><font size="2">"Openmp-dev" <openmp-dev-bounces@lists.llvm.org></font><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><tt><font size="2">Hello!<br><br>I wanted to ask, if this behavior is on purpose or if I am missing <br>something:<br><br>To me it seems that using "#pragma omp declare target" has no effect on <br>the code generation.<br>The specification states that variables and functions are mapped to the <br>device.<br>In my understanding, this means that device code should be emitted.<br><br>However, CGOpenMPRuntime::emitTargetGlobal() does only search for target <br>#pragmas and doesn't check for OMPDeclareTargetDeclAttr. This check is <br>done in ASTContext::DeclMustBeEmitted(), but it seems, this can never <br>happen. The reason is that CodeGenModule::EmitGlobal() returns early <br>after calling CGOpenMPRuntime::emitTargetGlobal(). I hope, this is <br>understandable.<br><br>It might be that this problem never showed up when the device is x86 as <br>well. But I don't understand how Nvidia can compile e.g. lulesh like this...<br><br>My question is if the intended way would be to change emitTargetGlobal() <br>to also emit functions/variables with OMPDeclareTargetDeclAttr.<br><br>Thanks in advance,<br>Daniel<br><br>_______________________________________________<br>Openmp-dev mailing list<br>Openmp-dev@lists.llvm.org<br></font></tt><tt><font size="2"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_openmp-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=itHoHX7egi7PhfIo-4Cm2EjWoZubgDZM8_HdvpD2Z7A&s=PEDqSA4pl3u1XF463qy7_rjTkbyNAlNQyU9Y_wB7VoQ&e=">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_openmp-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=itHoHX7egi7PhfIo-4Cm2EjWoZubgDZM8_HdvpD2Z7A&s=PEDqSA4pl3u1XF463qy7_rjTkbyNAlNQyU9Y_wB7VoQ&e=</a></font></tt><tt><font size="2"><br><br></font></tt><br><br><BR>
</body></html>