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/platform.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,11 @@
3
3
### Description
4
4
The `get_ids` function queries the list of available OpenCL platforms and returns the number of platforms and their IDs. This is a crucial step in setting up an OpenCL context, as it allows the application to identify and select a specific platform to use.
-`platforms`: A pointer to an array of `cl_platform_id` where the function will store the IDs of the available OpenCL platforms. If `platforms` is `null`, the function will not store the platform IDs, but it will still return the number of available platforms through `num_platforms`.
10
+
-`platforms`: A pointer to an array of `PlatformId` where the function will store the IDs of the available OpenCL platforms. If `platforms` is `null`, the function will not store the platform IDs, but it will still return the number of available platforms through `num_platforms`.
11
11
-`num_platforms`: A pointer to a `u32` variable where the function will store the number of available OpenCL platforms. If `num_platforms` is `null`, this argument is ignored.
12
12
13
13
#### Error Handling
@@ -23,25 +23,25 @@ The function uses Zig's error handling features to manage potential OpenCL error
23
23
24
24
The `get_info` function retrieves specific information about an OpenCL platform. This function is essential for obtaining various details about the platform, such as its name, profile, version, and other attributes.
25
25
```zig
26
-
pub inline fn get_info(
27
-
platform: cl_platform_id,
28
-
param_name: enums.platform_info,
29
-
param_value_size: usize,
30
-
param_value: ?*anyopaque,
31
-
param_value_size_ret: ?*usize
32
-
) errors.opencl_error!void;
26
+
pub fn getInfo(
27
+
platform: PlatformId,
28
+
param_name: Info,
29
+
param_value_size: usize,
30
+
param_value: ?*anyopaque,
31
+
param_value_size_ret: ?*usize,
32
+
) OpenCLError!void;
33
33
```
34
34
#### Parameters
35
35
36
-
-`platform`: The `cl_platform_id` for which the information is being queried.
37
-
-`param_name`: An enumeration constant that identifies the platform information being queried. This is a member of the `platform.enums.platform_info` namespace, which contains various attributes related to the platform. For example:
36
+
-`platform`: The `PlatformId` for which the information is being queried.
37
+
-`param_name`: An enumeration constant that identifies the platform information being queried. This is a member of the `Info` enum, which contains various attributes related to the platform. For example:
38
38
-`CL_PLATFORM_PROFILE` -> `profile`
39
39
-`CL_PLATFORM_NAME` -> `name`
40
40
-`param_value_size`: Specifies the size in bytes of memory pointed to by `param_value`.
41
41
-`param_value`: A pointer to the memory location where the appropriate values for the given `param_name` will be returned. If `param_value` is `null`, it is ignored.
42
42
-`param_value_size_ret`: Returns the actual size in bytes of data being queried by `param_name`. If `param_value_size_ret` is `null`, it is ignored.
43
43
44
-
For a full list of the enum members, refer to the OpenCL PDF documentation or the `src/enums/platform.zig` file where the enums are defined.
44
+
For a full list of the enum members, refer to the OpenCL PDF documentation or the `src/platform.zig` file where the enums are defined.
45
45
46
46
#### Error Handling
47
47
@@ -57,27 +57,27 @@ The function uses Zig's error handling features to manage potential OpenCL error
57
57
58
58
The `get_all` function retrieves a list of all available OpenCL platforms and their associated data. This function simplifies the process of obtaining detailed information about each platform.
-`allocator`: An instance of `std.mem.Allocator` used to allocate memory for the platform information structures.
65
65
66
66
#### Return Value
67
-
- Returns a slice of `platform_info` structures, each containing detailed information about an OpenCL platform, including its `id`, `profile`, `version`, `name`, `vendor`, and `extensions`.
67
+
- Returns a slice of `Details` structures, each containing detailed information about an OpenCL platform, including its `id`, `profile`, `version`, `name`, `vendor`, and `extensions`.
68
68
69
69
## Releasing Platform List
70
70
71
71
### Description
72
72
73
73
The `release_list` function releases the memory allocated for the list of platform information structures.
0 commit comments