Skip to content

Commit 84b755c

Browse files
committed
[flang][runtime] Initial support for offload build of FortranDecimal.
1 parent b7a0bdb commit 84b755c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

flang/lib/Decimal/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ endif()
4949
# avoid an unwanted dependency on libstdc++.so.
5050
add_definitions(-U_GLIBCXX_ASSERTIONS)
5151

52-
add_flang_library(FortranDecimal INSTALL_WITH_TOOLCHAIN
52+
set(sources
5353
binary-to-decimal.cpp
5454
decimal-to-binary.cpp
5555
)
5656

57+
include(AddFlangOffloadRuntime)
58+
enable_cuda_compilation("${sources}")
59+
enable_omp_offload_compilation("${sources}")
60+
61+
add_flang_library(FortranDecimal INSTALL_WITH_TOOLCHAIN ${sources})
62+
5763
if (DEFINED MSVC)
5864
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
5965
add_flang_library(FortranDecimal.static INSTALL_WITH_TOOLCHAIN
@@ -77,4 +83,4 @@ if (DEFINED MSVC)
7783
)
7884
add_dependencies(FortranDecimal FortranDecimal.static FortranDecimal.dynamic
7985
FortranDecimal.static_dbg FortranDecimal.dynamic_dbg)
80-
endif()
86+
endif()

flang/lib/Decimal/big-radix-floating-point.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
#include <limits>
3131
#include <type_traits>
3232

33+
// Some environments, viz. glibc 2.17, allow the macro HUGE
34+
// to leak out of <math.h>.
35+
#undef HUGE
36+
3337
namespace Fortran::decimal {
3438

3539
static constexpr std::uint64_t TenToThe(int power) {

0 commit comments

Comments
 (0)