@@ -23,3 +23,38 @@ def : Function {
23
23
];
24
24
let returns = [];
25
25
}
26
+
27
+ def : Struct {
28
+ let name = "ol_kernel_launch_size_args_t";
29
+ let desc = "Size-related arguments for a kernel launch.";
30
+ let members = [
31
+ StructMember<"size_t", "Dimensions", "Number of work dimensions">,
32
+ StructMember<"size_t", "NumGroupsX", "Number of work groups on the X dimension">,
33
+ StructMember<"size_t", "NumGroupsY", "Number of work groups on the Y dimension">,
34
+ StructMember<"size_t", "NumGroupsZ", "Number of work groups on the Z dimension">,
35
+ StructMember<"size_t", "GroupSizeX", "Size of a work group on the X dimension.">,
36
+ StructMember<"size_t", "GroupSizeY", "Size of a work group on the Y dimension.">,
37
+ StructMember<"size_t", "GroupSizeZ", "Size of a work group on the Z dimension.">
38
+ ];
39
+ }
40
+
41
+ def : Function {
42
+ let name = "olLaunchKernel";
43
+ let desc = "Enqueue a kernel launch with the specified size and parameters.";
44
+ let details = [
45
+ "If a queue is not specified, kernel execution happens synchronously"
46
+ ];
47
+ let params = [
48
+ Param<"ol_queue_handle_t", "Queue", "handle of the queue", PARAM_IN_OPTIONAL>,
49
+ Param<"ol_device_handle_t", "Device", "handle of the device to execute on", PARAM_IN>,
50
+ Param<"ol_kernel_handle_t", "Kernel", "handle of the kernel", PARAM_IN>,
51
+ Param<"const void*", "ArgumentsData", "pointer to the kernel argument struct", PARAM_IN>,
52
+ Param<"size_t", "ArgumentsSize", "size of the kernel argument struct", PARAM_IN>,
53
+ Param<"const ol_kernel_launch_size_args_t*", "LaunchSizeArgs", "pointer to the struct containing launch size parameters", PARAM_IN>,
54
+ Param<"ol_event_handle_t*", "EventOut", "optional recorded event for the enqueued operation", PARAM_OUT_OPTIONAL>
55
+ ];
56
+ let returns = [
57
+ Return<"OL_ERRC_INVALID_ARGUMENT", ["`Queue == NULL && EventOut != NULL`"]>,
58
+ Return<"OL_ERRC_INVALID_DEVICE", ["If Queue is non-null but does not belong to Device"]>,
59
+ ];
60
+ }
0 commit comments