|
| 1 | +//===-- Enqueue.td - Enqueue definitions for Offload -------*- tablegen -*-===// |
| 2 | +// |
| 3 | +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +// See https://llvm.org/LICENSE.txt for license information. |
| 5 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | +// |
| 7 | +//===----------------------------------------------------------------------===// |
| 8 | +// |
| 9 | +// This file contains Offload API definitions related to enqueable operations |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | + |
| 13 | +def : Function { |
| 14 | + let name = "olEnqueueMemcpy"; |
| 15 | + let desc = "Enqueue a memcpy operation."; |
| 16 | + let details = [ |
| 17 | + "For host pointers, use the device returned by olGetHostDevice", |
| 18 | + "At least one device must be a non-host device" |
| 19 | + ]; |
| 20 | + let params = [ |
| 21 | + Param<"ol_queue_handle_t", "Queue", "handle of the queue", PARAM_IN>, |
| 22 | + Param<"void*", "DstPtr", "pointer to copy to", PARAM_IN>, |
| 23 | + Param<"ol_device_handle_t", "DstDevice", "device that DstPtr belongs to", PARAM_IN>, |
| 24 | + Param<"void*", "SrcPtr", "pointer to copy from", PARAM_IN>, |
| 25 | + Param<"ol_device_handle_t", "SrcDevice", "device that SrcPtr belongs to", PARAM_IN>, |
| 26 | + Param<"size_t", "Size", "size in bytes of data to copy", PARAM_IN>, |
| 27 | + Param<"ol_event_handle_t*", "EventOut", "optional recorded event for the enqueued operation", PARAM_OUT_OPTIONAL> |
| 28 | + ]; |
| 29 | + let returns = [ |
| 30 | + Return<"OL_ERRC_INVALID_SIZE", ["`Size == 0`"]> |
| 31 | + ]; |
| 32 | +} |
| 33 | + |
| 34 | +def : Struct { |
| 35 | + let name = "ol_kernel_launch_size_args_t"; |
| 36 | + let desc = "Size-related arguments for a kernel launch."; |
| 37 | + let members = [ |
| 38 | + StructMember<"size_t", "Dimensions", "Number of work dimensions">, |
| 39 | + StructMember<"size_t", "NumGroupsX", "Number of work groups on the X dimension">, |
| 40 | + StructMember<"size_t", "NumGroupsY", "Number of work groups on the Y dimension">, |
| 41 | + StructMember<"size_t", "NumGroupsZ", "Number of work groups on the Z dimension">, |
| 42 | + StructMember<"size_t", "GroupSizeX", "Size of a work group on the X dimension.">, |
| 43 | + StructMember<"size_t", "GroupSizeY", "Size of a work group on the Y dimension.">, |
| 44 | + StructMember<"size_t", "GroupSizeZ", "Size of a work group on the Z dimension."> |
| 45 | + ]; |
| 46 | +} |
| 47 | + |
| 48 | +def : Function { |
| 49 | + let name = "olEnqueueKernelLaunch"; |
| 50 | + let desc = "Enqueue a kernel launch with the specified size and parameters."; |
| 51 | + let details = []; |
| 52 | + let params = [ |
| 53 | + Param<"ol_queue_handle_t", "Queue", "handle of the queue", PARAM_IN>, |
| 54 | + Param<"ol_kernel_handle_t", "Kernel", "handle of the kernel", PARAM_IN>, |
| 55 | + Param<"const void*", "ArgumentsData", "pointer to the kernel argument struct", PARAM_IN>, |
| 56 | + Param<"size_t", "ArgumentsSize", "size of the kernel argument struct", PARAM_IN>, |
| 57 | + Param<"const ol_kernel_launch_size_args_t*", "LaunchSizeArgs", "pointer to the struct containing launch size parameters", PARAM_IN>, |
| 58 | + Param<"ol_event_handle_t*", "EventOut", "optional recorded event for the enqueued operation", PARAM_OUT_OPTIONAL> |
| 59 | + ]; |
| 60 | + let returns = []; |
| 61 | +} |
0 commit comments