[llvm] [Offload] Implement the remaining initial Offload API (PR #122106)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 5 06:59:23 PST 2025
================
@@ -0,0 +1,45 @@
+//===-- 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 {
----------------
jhuber6 wrote:
What is this needed for? Why do we need a reference count on kernels, it should just be a handle. We could possibly destroy it, but I don't even see a case where a user would want to get rid of a kernel once it's made it. HSA just gives you a symbol lookup + symbol info API. I.e. lookup `foo` and verify `foo` is a kernel.
https://github.com/llvm/llvm-project/pull/122106
More information about the llvm-commits
mailing list