<div dir="ltr">That's actually interesting in itself. Plus it's a problem with my change so I'm definitely on the hook to fix that one.<div><br></div><div>I moved some inline functions (the symbols you're seeing) into a source file and that broke some builds. <a href="https://reviews.llvm.org/D69652">https://reviews.llvm.org/D69652</a>. cc Alexey who reported the error earlier this evening.<div><br></div><div>Nvcc 10 on x64 works for me with that change, some versions of nvcc on some architectures don't work. The workaround I'm suggesting is sed -i <a href="http://support.cu">support.cu</a> 's/INLINE/DEVICE/g', but without a local repro it's difficult to be sure what the effect is.</div><div><br></div><div>I'd be very interested in what version of the nvcc toolchain you're using, and in whether replacing INLINE with DEVICE in deviceRTL/nvptx/src/<a href="http://support.cu">support.cu</a> fixes it. Alternatively, __forceinline__ to __inline__ in deviceRTL/nvptx/src/target_impl.h's definition of INLINE may fix things.</div><div><br></div><div>Thanks,</div><div><br></div><div>Jon</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 4, 2019 at 10:48 PM Itaru Kitayama <<a href="mailto:itaru.kitayama@gmail.com">itaru.kitayama@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Switching to libc++ did not help much:<div>$ cat example.cpp</div><div><div>#include <iostream></div><div>int main() {</div><div>#pragma omp target parallel for</div><div><span style="white-space:pre-wrap">        </span>for (int i=0;i<10;i++) {</div><div><span style="white-space:pre-wrap">      </span>}</div><div>}</div></div><div><br></div><div>$ $ clang++ -fopenmp -fopenmp-targets=nvptx64 -stdlib=libc++ example.cpp</div>nvlink error   : Undefined reference to '_Z13checkSPMDModeP5ident' in '/tmp/example-b3be69.cubin'<br>nvlink error   : Undefined reference to '_Z25GetLogicalThreadIdInBlockb' in '/tmp/example-b3be69.cubin'<br>nvlink error   : Undefined reference to '_Z14GetOmpThreadIdib' in '/tmp/example-b3be69.cubin'<br>nvlink error   : Undefined reference to '_Z21GetNumberOfOmpThreadsb' in '/tmp/example-b3be69.cubin'<br>nvlink error   : Undefined reference to '_Z12GetOmpTeamIdv' in '/tmp/example-b3be69.cubin'<br>nvlink error   : Undefined reference to '_Z19GetNumberOfOmpTeamsv' in '/tmp/example-b3be69.cubin'<br>nvlink error   : Undefined reference to '_Z22setExecutionParameters13ExecutionMode11RuntimeMode' in '/tmp/example-b3be69.cubin'<br>nvlink error   : Undefined reference to '_Z18GetThreadIdInBlockv' in '/tmp/example-b3be69.cubin'<br>nvlink error   : Undefined reference to '_Z25GetNumberOfThreadsInBlockv' in '/tmp/example-b3be69.cubin'<br>nvlink error   : Undefined reference to '_Z9GetLaneIdv' in '/tmp/example-b3be69.cubin'<br>nvlink error   : Undefined reference to '_Z9GetWarpIdv' in '/tmp/example-b3be69.cubin'<br>clang-10: error: nvlink command failed with exit code 255 (use -v to see invocation)<div><br></div><div>Tested on POWER8</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 5, 2019 at 7:43 AM Jon Chesterfield <<a href="mailto:jonathanchesterfield@gmail.com" target="_blank">jonathanchesterfield@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 4, 2019 at 10:16 PM Itaru Kitayama <<a href="mailto:itaru.kitayama@gmail.com" target="_blank">itaru.kitayama@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Can you submit a patch to upstream? In the meantime, I workaround by using libc++.</div></blockquote><div><br></div><div>The 'right' fix is to stop cuda putting symbols in namespace std::, but that ship has sailed. Or possibly openmp variants as a future repair.</div><div><br></div><div>I've 'raised a concern' on the guilty commit (<a href="https://reviews.llvm.org/rC361066" target="_blank">https://reviews.llvm.org/rC361066</a>) in the hope that someone else fixes it. My next step would probably be to propose a reverting commit and put the author of that patch down as reviewer.</div><div><br></div><div>Cheers</div><div><br></div><div>Jon</div></div></div>
</blockquote></div>
</blockquote></div>