You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/command_queue.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
3
3
Creates a command queue on a specific device within a context. Command queues are used to schedule the execution of kernels and the transfer of data.
4
4
```zig
5
-
pub inline fn create(
6
-
context: cl_context,
7
-
device: cl_device_id,
8
-
properties: cl_command_queue_properties
9
-
) errors.opencl_error!cl_command_queue;
5
+
pub fn create(
6
+
context: Context,
7
+
device: DeviceId,
8
+
properties: Properties,
9
+
) OpenCLError!CommandQueue;
10
10
```
11
11
12
12
**Parameters**
13
13
-`context`: Must be a valid OpenCL context.
14
14
-`device`: Must be a device or sub-device associated with `context`. It can either be in the list of devices and sub-devices specified when `context` is created using `clCreateContext` or be a root device with the same device type as specified when `context` is created using `clCreateContextFromType`.
15
-
-`properties`: An optional list of context properties and their values. To use this, please go to the `command_queue.enums.queue_properties` enum and read the OpenCL PDF documentation about to use it.
15
+
-`properties`: An optional list of context properties and their values. To use this, please go to the `Property` struct and read the OpenCL PDF documentation about to use it.
16
16
17
17
**Error Handling**
18
18
@@ -30,18 +30,18 @@ The function uses Zig's error handling features to manage potential OpenCL error
30
30
The `create_with_properties` function creates a command queue with specified properties.
31
31
32
32
```zig
33
-
pub inline fn create_with_properties(
34
-
context: cl_context,
35
-
device: cl_device_id,
36
-
properties: ?[]const cl_queue_properties
37
-
) errors.opencl_error!cl_command_queue
33
+
pub fn createWithProperties(
34
+
context: Context,
35
+
device: DeviceId,
36
+
properties: ?[]const QueueProperties,
37
+
) OpenCLError!CommandQueue;
38
38
```
39
39
40
40
#### Parameters
41
41
42
42
-`context`: Specifies the OpenCL context. It must be a valid OpenCL context.
43
43
-`device`: Specifies the device or sub-device associated with the context. It must be a valid device or sub-device.
44
-
-`properties`: Specifies a list of properties for the command queue and their corresponding values. Each property name is immediately followed by the corresponding desired value. This list is terminated with 0. If a supported property and its value is not specified in `properties`, its default value will be used. If `properties` is `null`, default values for supported command-queue properties will be used. (To get the properties name you can use: `command_queue.enums.command_queue_properties`)
44
+
-`properties`: Specifies a list of properties for the command queue and their corresponding values. Each property name is immediately followed by the corresponding desired value. This list is terminated with 0. If a supported property and its value is not specified in `properties`, its default value will be used. If `properties` is `null`, default values for supported command-queue properties will be used. (To get the properties name you can use: `QueueProperty`)
45
45
46
46
#### Error Handling
47
47
@@ -59,7 +59,7 @@ The function uses Zig's error handling features to manage potential OpenCL error
59
59
The `flush` function issues all previously queued OpenCL commands in `command_queue` to the device associated with `command_queue`.
@@ -81,12 +81,12 @@ The function uses Zig's error handling features to manage potential OpenCL error
81
81
The `finish` function ensures that all previously queued OpenCL commands in a command queue have been issued to the associated device and that all these commands have completed execution. This function blocks until the execution of all previously queued commands in the specified command queue is complete.
-**command_queue**: The `cl_command_queue` for which the function waits for the completion of all previously queued commands.
89
+
-**command_queue**: The `CommandQueue` for which the function waits for the completion of all previously queued commands.
90
90
91
91
#### Error Handling
92
92
@@ -103,12 +103,12 @@ The function uses Zig's error handling features to manage potential OpenCL error
103
103
The `retain` function increments the reference count of the specified command queue. This ensures that the command queue is not deleted while it is still in use.
-**command_queue**: The `cl_command_queue` whose reference count is to be incremented.
111
+
-**command_queue**: The `CommandQueue` whose reference count is to be incremented.
112
112
113
113
### Error Handling
114
114
@@ -125,9 +125,9 @@ The function uses Zig's error handling features to manage potential OpenCL error
125
125
The `release` function decrements the reference count of the specified command queue. When the reference count reaches zero, the command queue is deleted.
0 commit comments