[llvm] [Offload][Conformance] Add tests for single-precision math functions (PR #152013)

Leandro Lacerda via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 4 17:50:29 PDT 2025


================
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file contains common utilities for defining device kernel wrappers to
+/// math functions.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef COMMON_HPP
+#define COMMON_HPP
+
+#include <gpuintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+namespace common {
+
+typedef _Float16 float16;
+
+template <auto Func, typename OutType, typename... InTypes>
+__attribute__((always_inline)) void
----------------
leandrolcampos wrote:

You're right. I checked the generated LLVM IR, and the function is being inlined automatically with optimizations enabled. The output is identical. I've removed the `always_inline` attribute. Thanks for the tip!

https://github.com/llvm/llvm-project/pull/152013


More information about the llvm-commits mailing list