[OpenMP][deviceRTLs] Drop `assert` in common parts of `deviceRTLs`
authorShilei Tian <tianshilei1992@gmail.com>
Thu, 4 Feb 2021 17:39:23 +0000 (12:39 -0500)
committerShilei Tian <tianshilei1992@gmail.com>
Thu, 4 Feb 2021 17:39:43 +0000 (12:39 -0500)
commit567b3f8841d0725e07dd816ca4288a309064bd39
tree791ea569f4ecd12683cb7f1960f296bed023b711
parent215441fcb71d5b18e3b39ce4c4d0c960560fbb6b
[OpenMP][deviceRTLs] Drop `assert` in common parts of `deviceRTLs`

The header `assert.h` needs to be included in order to use `assert` in the code.
When building NVPTX `deviceRTLs` on a CUDA free system, it requires headers from
`gcc-multilib`, which some systems don't have. This patch drops the use of
`assert` in common parts of `deviceRTLs`. In light of
`openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h`, a code block
```
if (!cond)
  __builtin_trap();
```
is being used. The builtin will be translated to `call void @llvm.trap()`, and
the corresponding PTX is `trap;`.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D95986
openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
openmp/libomptarget/deviceRTLs/common/debug.h
openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h