Version 3.0.23.01.25
[clinfo] / src / opt_out.h
1 /* clinfo output options */
2 #ifndef OPT_OUT_H
3 #define OPT_OUT_H
4
5 #include "ext.h"
6
7 enum output_modes {
8         CLINFO_HUMAN = 1, /* more human readable */
9         CLINFO_RAW = 2, /* property-by-property */
10         CLINFO_BOTH = CLINFO_HUMAN | CLINFO_RAW
11 };
12
13 /* Specify how we should handle conditional properties. */
14 enum cond_prop_modes {
15         COND_PROP_CHECK = 0, /* default: check, skip if invalid */
16         COND_PROP_TRY = 1, /* try, don't print an error if invalid */
17         COND_PROP_SHOW = 2 /* try, print an error if invalid */
18 };
19
20 /* Output options */
21 struct opt_out {
22         enum output_modes mode;
23         enum cond_prop_modes cond;
24
25 /* Specify that we should only print information about a specific device */
26         cl_uint platform;
27         cl_uint device;
28         cl_bool selected;
29
30 /* Specify that we should only print information about a specific property */
31         const char *prop;
32
33 /* Specify if we should only be listing the platform and devices;
34  * can be done in both human and raw mode, and only the platform
35  * and device names (and number) will be shown
36  * TODO check if terminal supports UTF-8 and use Unicode line-drawing
37  * for the tree in list mode
38  */
39         cl_bool brief;
40         cl_bool detailed; // !brief
41         cl_bool offline;
42         cl_bool null_platform;
43
44 /* JSON output for RAW */
45         cl_bool json;
46
47 /* clGetDeviceInfo returns CL_INVALID_VALUE both for unknown properties
48  * and when the destination variable is too small. Set the following to CL_TRUE
49  * to check which one is the case
50  */
51         cl_bool check_size;
52 };
53
54 #endif