<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - Can't have OpenMP enabled while compiling CUDA (even without any OpenMP constructs)"
   href="https://llvm.org/bugs/show_bug.cgi?id=28723">28723</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Can't have OpenMP enabled while compiling CUDA (even without any OpenMP constructs)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>CUDA
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>poliakoff1@llnl.gov
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Please excuse if this is in the wrong tracker, it might need to be in the CUDA
or OpenMP section (in fact, I'll file an issue there as well)

I have a file without any OpenMP in it, and if I try

clang++ [cuda args] -x cuda -std=c++11 --cuda-gpu-arch=sm_30 -stdlib=libc++
b.cpp

it is successful. If on the other hand I try

clang++ [cuda args] -x cuda -std=c++11 --cuda-gpu-arch=sm_30 -stdlib=libc++
-fopenmp b.cpp

I get

error: The target 'nvptx64-nvidia-cuda' is not a supported OpenMP host target.

It appears that Clang only sees that I am using a CUDA backend and am using the
OpenMP flag, not checking whether any OpenMP code actually needs to go to the
PTX backend. Much like the Sandia folks, we're writing portable parallel
programming models and would really love to put Clang through its paces, but if
we can't write code where CUDA sections follow OpenMP ones, we won't be able
to.</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>