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

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 4 12:02:16 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
----------------
jhuber6 wrote:

I don't think we need `always_inline` since we're compiling with optimizations, but if it's really necessary it should be the `[[...]]` spelling.

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


More information about the llvm-commits mailing list