[llvm] WIP: [Offload] Add testing for Offload program and kernel related entry points (PR #127803)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 19 08:07:47 PST 2025
================
@@ -0,0 +1,76 @@
+//===-- Kernel.td - Kernel definitions for Offload ---------*- tablegen -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains Offload API definitions related to the kernel handle
+//
+//===----------------------------------------------------------------------===//
+
+def : Function {
+ let name = "olCreateKernel";
+ let desc = "Create a kernel from the function identified by `KernelName` in the given program";
+ let details = [
+ "The created kernel has an initial reference count of 1."
+ ];
+ let params = [
+ Param<"ol_program_handle_t", "Program", "handle of the program", PARAM_IN>,
+ Param<"const char*", "KernelName", "name of the kernel entry point in the program", PARAM_IN>,
+ Param<"ol_kernel_handle_t*", "Kernel", "output pointer for the created kernel", PARAM_OUT>
+ ];
+ let returns = [];
+}
+
+def : Function {
+ let name = "olRetainKernel";
----------------
jhuber6 wrote:
Why do we need a reference count on the kernel? It's just a pointer to some global in the image the user gave. I'd just prefer an API that lets users get the address of a global and then get returned some information about the global like its size, whether it's a kernel, etc.
https://github.com/llvm/llvm-project/pull/127803
More information about the llvm-commits
mailing list