[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)
Johannes Doerfert via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 14 14:54:19 PDT 2024
================
@@ -0,0 +1,53 @@
+//===-- Kenrels/Memory.cpp - Memory related kernel definitions ------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+//===----------------------------------------------------------------------===//
+
+#include <cstdint>
+
+#define LAUNCH_BOUNDS(MIN, MAX) \
+ __attribute__((launch_bounds(MAX), amdgpu_flat_work_group_size(MIN, MAX)))
+#define INLINE [[clang::always_inline]] inline
+#define KERNEL [[gnu::weak]] __global__
----------------
jdoerfert wrote:
memset is "just an example". I need this for the sanitizer. Currently, our OpenMP kernels are weak (right?), and I wouldn't know how to make these weak_odr anyway. Unsure what this has to do with nostdlibinc.
https://github.com/llvm/llvm-project/pull/104168
More information about the cfe-commits
mailing list