Skip to content

Commit 505829e

Browse files
committed
[libc][obvious] Fix the FMA implementation on the GPU
Summary: This doesn't include the type_traits to perform the indirection, nor does it return the value.
1 parent defb5cd commit 505829e

File tree

1 file changed

+4
-2
lines changed
  • libc/src/__support/FPUtil/gpu

1 file changed

+4
-2
lines changed

libc/src/__support/FPUtil/gpu/FMA.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@
1414
static_assert(__has_builtin(__builtin_fma), "FMA builtins must be defined");
1515
static_assert(__has_builtin(__builtin_fmaf), "FMA builtins must be defined");
1616

17+
#include "src/__support/CPP/type_traits.h"
18+
1719
namespace __llvm_libc {
1820
namespace fputil {
1921

2022
template <typename T>
2123
LIBC_INLINE cpp::enable_if_t<cpp::is_same_v<T, float>, T> fma(T x, T y, T z) {
22-
__builtin_fmaf(x, y, z);
24+
return __builtin_fmaf(x, y, z);
2325
}
2426

2527
template <typename T>
2628
LIBC_INLINE cpp::enable_if_t<cpp::is_same_v<T, double>, T> fma(T x, T y, T z) {
27-
__builtin_fma(x, y, z);
29+
return __builtin_fma(x, y, z);
2830
}
2931

3032
} // namespace fputil

0 commit comments

Comments
 (0)