|
| 1 | +// Copyright 2018-2023 The Khronos Group. This work is licensed under a |
| 2 | +// Creative Commons Attribution 4.0 International License; see |
| 3 | +// http://creativecommons.org/licenses/by/4.0/ |
| 4 | + |
| 5 | +:data-uri: |
| 6 | +:icons: font |
| 7 | +include::../config/attribs.txt[] |
| 8 | +:source-highlighter: coderay |
| 9 | + |
| 10 | += cl_loader_info |
| 11 | +:R: pass:q,r[^(R)^] |
| 12 | +Khronos{R} OpenCL Working Group |
| 13 | + |
| 14 | +== Name Strings |
| 15 | + |
| 16 | +`cl_loader_info` |
| 17 | + |
| 18 | +== Contact |
| 19 | + |
| 20 | +Please see the *Issues* list in the Khronos *OpenCL-Docs* repository: + |
| 21 | +https://github.com/KhronosGroup/OpenCL-Docs |
| 22 | + |
| 23 | +== Contributors |
| 24 | + |
| 25 | +// spell-checker: disable |
| 26 | +Vincent Danjean, Université Grenoble Alpes + |
| 27 | +Brice Videau, Argonne National Laboratory |
| 28 | +// spell-checker: enable |
| 29 | + |
| 30 | +== Notice |
| 31 | + |
| 32 | +Copyright (c) 2023 The Khronos Group Inc. |
| 33 | + |
| 34 | +== Status |
| 35 | + |
| 36 | +Final Draft |
| 37 | + |
| 38 | +== Version |
| 39 | + |
| 40 | +Built On: {docdate} + |
| 41 | +Version: 1.0.0 |
| 42 | + |
| 43 | +== Dependencies |
| 44 | + |
| 45 | +This extension is written against the OpenCL Specification |
| 46 | +Version 1.0, Revision 1. |
| 47 | + |
| 48 | +This extension requires OpenCL 1.0. |
| 49 | + |
| 50 | +== Overview |
| 51 | + |
| 52 | +This extension describes the `cl_loader_info` loader extension which |
| 53 | +defines a simple mechanism through which an OpenCL installable client |
| 54 | +driver loader (ICD Loader) may report loader specific meta-data such |
| 55 | +as version or vendor. |
| 56 | + |
| 57 | +== New API Functions |
| 58 | + |
| 59 | +[source,c] |
| 60 | +---- |
| 61 | +cl_int clGetICDLoaderInfoOCLICD(cl_icdl_info param_name, |
| 62 | + size_t param_value_size, |
| 63 | + void *param_value, |
| 64 | + size_t *param_value_size_ret); |
| 65 | +---- |
| 66 | + |
| 67 | +== New API Types |
| 68 | + |
| 69 | +[source,c] |
| 70 | +---- |
| 71 | +typedef cl_uint cl_icdl_info; |
| 72 | +---- |
| 73 | + |
| 74 | +== New API Enums |
| 75 | + |
| 76 | +Accepted as _param_name_ to the function *clGetICDLoaderInfoOCLICD*: |
| 77 | + |
| 78 | +[source,c] |
| 79 | +---- |
| 80 | +#define CL_ICDL_OCL_VERSION 1 |
| 81 | +#define CL_ICDL_VERSION 2 |
| 82 | +#define CL_ICDL_NAME 3 |
| 83 | +#define CL_ICDL_VENDOR 4 |
| 84 | +---- |
| 85 | + |
| 86 | +Note that for backward compatibility reasons, the enum values do not |
| 87 | +follow OpenCL enum values attribution. |
| 88 | + |
| 89 | +== Modifications to the OpenCL API Specification |
| 90 | + |
| 91 | +[open,refpage='clGetICDLoaderInfoOCLICD',desc='Query information about an OpenCL ICD Loader',type='protos'] |
| 92 | +Information concerning an OpenCL ICD Loader can be obtained with the function: |
| 93 | +[source,c] |
| 94 | +---- |
| 95 | +cl_int clGetICDLoaderInfoOCLICD(cl_icdl_info param_name, |
| 96 | + size_t param_value_size, |
| 97 | + void *param_value, |
| 98 | + size_t *param_value_size_ret); |
| 99 | +---- |
| 100 | + |
| 101 | + * _param_name_ is an enumeration constant that identifies the ICD loader |
| 102 | + information being queried. It can be one of the following values as |
| 103 | + specified in the <<loader-queries-table, ICD Loader Queries>> table. |
| 104 | + * _param_value_size_ specifies the size in bytes of memory pointed to by |
| 105 | + _param_value_. |
| 106 | + This size in bytes must be ≥ to the size of return type specified in the |
| 107 | + <<loader-queries-table, ICD Loader Queries>> table. |
| 108 | + * _param_value_ is a pointer to memory location where appropriate values for a |
| 109 | + given _param_name_, as specified in the <<loader-queries-table, ICD Loader Queries |
| 110 | + Queries>> table, will be returned. |
| 111 | + If _param_value_ is `NULL`, it is ignored. |
| 112 | + * _param_value_size_ret_ returns the actual size in bytes of data being |
| 113 | + queried by _param_name_. |
| 114 | + If _param_value_size_ret_ is `NULL`, it is ignored. |
| 115 | + |
| 116 | +The information that can be queried using *clGetICDLoaderInfoOCLICD* is specified |
| 117 | +in the <<loader-queries-table, ICD Loader Queries>> table. |
| 118 | + |
| 119 | +[[loader-queries-table]] |
| 120 | +.List of supported param_names by <<clGetICDLoaderInfoOCLICD>> |
| 121 | +[width="100%"] |
| 122 | +[cols="30,20,80"] |
| 123 | +[options="header"] |
| 124 | +|==== |
| 125 | +| ICD Loader Info | Return Type | Description |
| 126 | +| *CL_ICDL_OCL_VERSION* | char[] | OpenCL version supported by the ICD Loader |
| 127 | +| *CL_ICDL_VERSION* | char[] | ICD Loader version string |
| 128 | +| *CL_ICDL_NAME* | char[] | ICD Loader name string |
| 129 | +| *CL_ICDL_VENDOR* | char[] | ICD Loader vendor string |
| 130 | +|==== |
| 131 | + |
| 132 | +*clGetICDLoaderInfoOCLICD* returns *CL_SUCCESS* if the function is |
| 133 | +executed successfully. |
| 134 | +Otherwise, it returns one of the following errors. |
| 135 | + |
| 136 | + * *CL_INVALID_VALUE* if _param_name_ is not one of the supported values or |
| 137 | + if size in bytes specified by _param_value_size_ is < size of return |
| 138 | + type as specified in the <<loader-queries-table, ICD Loader Queries>> table, |
| 139 | + and _param_value_ is not a `NULL` value. |
| 140 | + |
| 141 | + |
| 142 | +== Conformance tests |
| 143 | + |
| 144 | +. The new *clGetICDLoaderInfoOCLICD* entrypoint must be called and succeed. |
| 145 | +. The value returned for `CL_ICDL_OCL_VERSION` must repect the OpenCL version |
| 146 | + string format. |
| 147 | + |
| 148 | +== Issues |
| 149 | + |
| 150 | +. Should this extension be a regular extension? |
| 151 | ++ |
| 152 | +-- |
| 153 | +*RESOLVED*: Yes. This is a userfacing extension. |
| 154 | +-- |
| 155 | + |
| 156 | +== Version History |
| 157 | + |
| 158 | +[cols="5,15,15,70"] |
| 159 | +[grid="rows"] |
| 160 | +[options="header"] |
| 161 | +|==== |
| 162 | +| Version | Date | Author | Changes |
| 163 | +| 1.0.0 | 2023-03-01 | Brice Videau | *Initial revision* |
| 164 | +|==== |
0 commit comments