<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Size doesn't match for '_openmp_teams_reductions_buffer_$_' in '/tmp/error-f2f528.cubin'"
   href="https://bugs.llvm.org/show_bug.cgi?id=40893">40893</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Size doesn't match for '_openmp_teams_reductions_buffer_$_' in '/tmp/error-f2f528.cubin'
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Clang Compiler Support
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>csdaley@lbl.gov
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21520" name="attach_21520" title="Program to demonstrate the Clang link error">attachment 21520</a> <a href="attachment.cgi?id=21520&action=edit" title="Program to demonstrate the Clang link error">[details]</a></span>
Program to demonstrate the Clang link error

Hello all,

I am trying to run the SPEC-ACCEL OpenMP test-suite with the LLVM/Clang
compiler (using LLVM/Clang versions from today, 27 Feb 2019). I am using Intel
Skylake CPUs and NVIDIA Volta GPUs. I find that the LLVM/Clang compiler gives
the wrong numerical results for the test problem 557.pcsp when using OpenMP
target offload. In order to understand where results first differ, I created a
new function containing an OpenMP reduction to check numerical results after
each kernel (file rhs_sum.c and function compute_rhs_sum). However, adding this
new object file causes Clang to fail at link time with the error "nvlink error 
 : Size doesn't match for '_openmp_teams_reductions_buffer_$_' in
'/tmp/error-2b1332.cubin', first specified in '/tmp/rhs_sum-db73c4.cubin'".

I have attached the smallest reproducible test problem. It is 78 lines of code
spread over 4 source files. It has 2 kernels with OpenMP teams reductions in
different source files.

$ make clean && make
rm -f *.o *.ptx *.cub pcsp
clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -c sp.c -o sp.o
clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -c rhs_sum.c -o rhs_sum.o
clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -c error.c -o error.o
clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda sp.o rhs_sum.o error.o -lm
-o pcsp
nvlink error   : Size doesn't match for '_openmp_teams_reductions_buffer_$_' in
'/tmp/error-2178d1.cubin', first specified in '/tmp/rhs_sum-928af9.cubin'
clang-9: error: nvlink command failed with exit code 255 (use -v to see
invocation)
Makefile:6: recipe for target 'pcsp' failed
make: *** [pcsp] Error 255

This seems like a regression because the application successfully links when
using LLVM/Clang from 24th Jan 2019.

One interesting observation is that the application successfully links when
moving the two functions containing OpenMP teams reductions into the same
source file.


Thanks,
Chris</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>