<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 - Host header files not detected when compiling for OpenMP device"
href="https://bugs.llvm.org/show_bug.cgi?id=51949">51949</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Host header files not detected when compiling for OpenMP device
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>OpenMP
</td>
</tr>
<tr>
<th>Assignee</th>
<td>a.bataev@hotmail.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>huberjn@ornl.gov
</td>
</tr>
<tr>
<th>CC</th>
<td>huberjn@ornl.gov, jdoerfert@anl.gov, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The host header files are not correctly detected when compiling for the OpenMP
device currently. As shown in <a href="https://godbolt.org/z/PhWTEfvYo">https://godbolt.org/z/PhWTEfvYo</a> the host files
are not detected if the target is set to `nvptx64-nvidia-cuda` but are detected
if the target is only `nvptx64`.
Normally, the header search uses the auxiliary triple to initiate its header
search when it detects that the Operating System part of the triple is `cuda`.
Just using `nvptx64` avoids this by not being considered CUDA and the header
search will instead use `nvptx64` as the triple for the header search. Since
this doesn't have an Operating System, the header search won't know how to
handle it specifically and instead add some default paths like /usr/include.
When we provide the full triple `nvptx64-nvidia-cuda` it will detect that we're
compiling for CUDA and instead use the host's triple, which doesn't add the
proper system header files when compiling with `-fopenmp` set for an unknown
reason. Removing `-fopenmp` from the compiler options causes it to again find
the host's header files using the host triple.
The OpenMP offloading device bitcode is current compiled with `-target nvptx64`
and seems to work accidentally by defaulting to searching preset paths, but
this probably won't work on all systems.</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>