[Openmp-commits] [PATCH] D121467: [Libomptarget] Create device math wrappers

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Mar 11 08:44:17 PST 2022


tianshilei1992 added a comment.

In D121467#3375392 <https://reviews.llvm.org/D121467#3375392>, @jhuber6 wrote:

> In D121467#3375390 <https://reviews.llvm.org/D121467#3375390>, @tianshilei1992 wrote:
>
>> What's the benefit of making it a standalone library instead of part of device runtime?
>
> Johannes wanted this math library so we can get regular math calls on the device. We can't just include `math.h` and expect it because it has several things that aren't compatible with the device. We originally just had wrappers that mapped them to the device versions, but this meant we didn't have the optimizations LLVM has for the math functions. That being said, this is a lot of extra code and we'll need to see if it makes a performance difference. (It also makes compilation much slower.)

Yeah, I understand the importance to have our own math library. I'm just not clear what the benefit to make it not part of our device runtime. Like CUDA's `libdevice.bc` contains everything.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121467/new/

https://reviews.llvm.org/D121467



More information about the Openmp-commits mailing list