[Openmp-commits] [PATCH] D95060: [libomptarget][devicertl][nfc] Remove some cuda intrinsics, simplify
Shilei Tian via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jan 20 09:50:45 PST 2021
tianshilei1992 added inline comments.
================
Comment at: openmp/libomptarget/deviceRTLs/common/src/reduction.cu:187
+INLINE static uint32_t kmpcMin(uint32_t x, uint32_t y) {
+ return x < y ? x : y;
----------------
JonChesterfield wrote:
> Also considered 'min', but expect it to collide with one of the included headers, and 'min_uint32_t' but couldn't see a pretty way to write that inTheNamingConvention.
>
> INLINE static is a slightly strange construct, chosen to match the functions above.
The semantics of `min(x, y)` is same as `x < y ? x : y` but the implementation could be very different. For some data type (especially integers) we don't even need a branch here. I don't think it's good for performance to just use branch. If we know the type is `uint32_t`, then we can use bitwise operation here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95060/new/
https://reviews.llvm.org/D95060
More information about the Openmp-commits
mailing list