<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 - OpenMP target regions cause CUBLAS_STATUS_INTERNAL_ERROR in libcublas"
   href="https://bugs.llvm.org/show_bug.cgi?id=42643">42643</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>OpenMP target regions cause CUBLAS_STATUS_INTERNAL_ERROR in libcublas
          </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=22253" name="attach_22253" title="Source files and build scripts to reproduce the error">attachment 22253</a> <a href="attachment.cgi?id=22253&action=edit" title="Source files and build scripts to reproduce the error">[details]</a></span>
Source files and build scripts to reproduce the error

Hello all,

We are trying to use libcublas and OpenMP target offloading in a small
mini-app. When we compile with Clang compiler we find that our second call to
cublasDgemm returns CUBLAS_STATUS_INTERNAL_ERROR - see the top of run-clang.sh
and run-clang.out. We print "** cublasDgemm status-2: 14" when there is
CUBLAS_STATUS_INTERNAL_ERROR return value. The numerical results in this small
mini-app are OK, but eventually cause problems in our full application.

The following alternate compilers work:
* The current IBM XL compiler on OLCF Summit supercomputer - see run-xl.sh and
run-xl.out.
* The PGI compiler, where we replace the OpenMP target offload calls with
OpenACC.

The following 2 versions work with Clang compiler.
* Replace OpenMP target offload code with CUDA code - see
CUBLAS_testcase_cuda.cu. This is the second experiment that is run in
run-clang.sh.
* Replace cublasDgemm calls in libcublas with cblas_dgemm calls in MKL

This indicates that the error is a result of mixing both OpenMP target offload
and libcublas with the Clang compiler. We are using LLVM/Clang from June 06,
but have also reproduced using a version of LLVM/Clang from Feb 20. Our
mini-app is quite complicated, however, it is the simplest mini-app we could
create which still caused CUBLAS_STATUS_INTERNAL_ERROR return value. Please see
run-clang.sh and CUBLAS_testcase.c.

Thanks,
Chris and Fazlay</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>