Skip to content

Commit dbf4642

Browse files
assistant-librarian[bot]AlexVlx
authored andcommitted
Add implementations for the C++ standard library math (#123)
The C++ standard library, as well as generic C++ code, use [special compiler builtins](https://gcc.gnu.org/onlinedocs/gcc/Library-Builtins.html) to implement math functions. Some of these have non-trivial lowerings and are not handled in the compiler, which leads to rather opaque arcane errors obtaining when compiling code in `--hipstdpar` mode, wherein they end up directly consumed. This patch adds a header that forwards to the ROCDL implementations via an uniform HIPSTDPAR interface. A corresponding patch in the compiler will handle forwarding the builtins that we cannot directly lower to said uniform HIPSTDPAR interface. With this design, it is possible to provide alternative implementations, and it is also possible for the user to provide their own implementations if e.g. they are compiling with `-nogpuinc` and / or `-nogpulib`. --- 🔁 Imported from [ROCm/rocThrust#551](ROCm/rocThrust#551) 🧑‍💻 Originally authored by @AlexVlx --------- Co-authored-by: Alex Voicu <[email protected]> Co-authored-by: assistant-librarian[bot] <assistant-librarian[bot]@users.noreply.github.com>
1 parent 9884edf commit dbf4642

File tree

2 files changed

+395
-0
lines changed

2 files changed

+395
-0
lines changed

projects/rocthrust/thrust/system/hip/hipstdpar/hipstdpar_lib.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,7 @@
6464
# include "impl/swap.hpp"
6565
# include "impl/transformation.hpp"
6666
# include "impl/uninitialized.hpp"
67+
// Math library implementation
68+
# include "impl/math_lib.hpp"
6769

6870
#endif

0 commit comments

Comments
 (0)