<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 - OpenMPOpt hit assertion when using --cuda-noopt-device-debug"
   href="https://bugs.llvm.org/show_bug.cgi?id=51649">51649</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>OpenMPOpt hit assertion when using --cuda-noopt-device-debug
          </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>enhancement
          </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>xw111luoye@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I tried to pass --cuda-noopt-device-debug to Clang to influence ptxas
invocation by clang and hit this assertion.

Using miniQMC.
cmake -D CMAKE_CXX_COMPILER=clang++ -D ENABLE_OFFLOAD=1 -D USE_OBJECT_TARGET=ON
-DCMAKE_CXX_FLAGS="-g --cuda-noopt-device-debug" ..


clang-14:
/home/yeluo/opt/llvm-clang/llvm-project/llvm/lib/Transforms/IPO/OpenMPOpt.cpp:2880:
virtual void {anonymous}::AAKernelInfoFunction::initialize(llvm::Attributor&):
Assertion `(KernelInitCB && KernelDeinitCB) && "Kernel without
__kmpc_target_init or __kmpc_target_deinit!"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /soft/llvm/main-20210811/bin/clang-14 -cc1 -triple
nvptx64-nvidia-cuda -aux-triple x86_64-unknown-linux-gnu -S -disable-free
-main-file-name einspline_spo_omp.cpp -mrelocation-model pic -pic-level 2
-fhalf-no-semantic-interposition -mframe-pointer=none -menable-no-infs
-menable-no-nans -menable-unsafe-fp-math -fno-signed-zeros -mreassociate
-freciprocal-math -ffp-contract=fast -fno-rounding-math -ffast-math
-ffinite-math-only -fno-verbose-asm -no-integrated-as -mlink-builtin-bitcode
/usr/local/cuda-11.0/nvvm/libdevice/libdevice.10.bc -target-feature +ptx70
-target-sdk-version=11.0 -mlink-builtin-bitcode
/soft/llvm/main-20210811/lib/libomptarget-nvptx-sm_80.bc -target-cpu sm_80
-mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=constructor
-dwarf-version=2 -debugger-tuning=gdb -fno-dwarf-directory-asm -resource-dir
/soft/llvm/main-20210811/lib/clang/14.0.0 -dependency-file
CMakeFiles/qmcwfs.dir/einspline_spo_omp.cpp.o.d -MT
src/QMCWaveFunctions/CMakeFiles/qmcwfs.dir/einspline_spo_omp.cpp.o
-sys-header-deps -internal-isystem
/soft/llvm/main-20210811/lib/clang/14.0.0/include/openmp_wrappers -include
__clang_openmp_device_functions.h -D ADD_ -D H5_USE_16_API -D HAVE_CONFIG_H -D
restrict=__restrict__ -I /home/yeluo/opt/miniqmc/src -I
/home/yeluo/opt/miniqmc/build_clang_offload_MP/src -I
/home/yeluo/opt/miniqmc/src/Platforms -D __forceinline=inline -D NDEBUG
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward
-internal-isystem /soft/llvm/main-20210811/lib/clang/14.0.0/include
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-internal-isystem /soft/llvm/main-20210811/lib/clang/14.0.0/include
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-Wall -Wno-unused-variable -Wno-overloaded-virtual -Wno-unused-private-field
-Wno-unused-local-typedef -Wvla -Wno-unknown-pragmas -Wmisleading-indentation
-Wno-unknown-cuda-version -std=c++14 -fdeprecated-macro
-fdebug-compilation-dir=/home/yeluo/opt/miniqmc/build_clang_offload_MP/src/QMCWaveFunctions
-ferror-limit 19 -fopenmp -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions
-fcolor-diagnostics -vectorize-loops -vectorize-slp -fopenmp-is-device
-fopenmp-host-ir-file-path /tmp/einspline_spo_omp-0393f3.bc
-D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/einspline_spo_omp-62d89d.s -x c++
/home/yeluo/opt/miniqmc/src/QMCWaveFunctions/einspline_spo_omp.cpp
1.      <eof> parser at end of file</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>