@@ -34,41 +34,40 @@ def : Enum {
3434 ];
3535}
3636
37+ def : Function {
38+ let name = "offloadDeviceGetCount";
39+ let desc = "Retrieves the number of available devices within a platform";
40+ let params = [
41+ Param<"offload_platform_handle_t", "hPlatform", "handle of the platform instance", PARAM_IN>,
42+ Param<"uint32_t*", "pNumDevices", "pointer to the number of devices.", PARAM_OUT>
43+ ];
44+ let returns = [];
45+ }
46+
3747def : Function {
3848 let name = "offloadDeviceGet";
3949 let desc = "Retrieves devices within a platform";
4050 let details = [
4151 "Multiple calls to this function will return identical device handles, in the same order.",
42- "The number and order of handles returned from this function can be affected by environment variables that filter devices exposed through API.",
43- "The returned devices are taken a reference of and must be released with a subsequent call to olDeviceRelease.",
4452 "The application may call this function from simultaneous threads, the implementation must be thread-safe"
4553 ];
4654 let params = [
4755 Param<"offload_platform_handle_t", "hPlatform", "handle of the platform instance", PARAM_IN>,
48- Param<"offload_device_type_t", "DeviceType", "the type of the devices.", PARAM_IN>,
49- Param<"uint32_t", "NumEntries", "the number of devices to be added to phDevices. "
50- "If phDevices is not NULL, then NumEntries should be greater than zero. Otherwise OFFLOAD_ERRC_INVALID_SIZE "
51- "will be returned.", PARAM_IN>,
56+ Param<"uint32_t", "NumEntries", "the number of devices to be added to phDevices, which must be greater than zero", PARAM_IN>,
5257 RangedParam<"offload_device_handle_t*", "phDevices", "Array of device handles. "
53- "If NumEntries is less than the number of devices available, then platform shall only retrieve that number of devices.", PARAM_OUT_OPTIONAL,
54- Range<"0", "NumEntries">>,
55- Param<"uint32_t*", "pNumDevices", "pointer to the number of devices. "
56- "pNumDevices will be updated with the total number of devices available.", PARAM_OUT_OPTIONAL>
58+ "If NumEntries is less than the number of devices available, then this function shall only retrieve that number of devices.", PARAM_OUT,
59+ Range<"0", "NumEntries">>
5760 ];
5861 let returns = [
5962 Return<"OFFLOAD_ERRC_INVALID_SIZE", [
60- "`NumEntries == 0 && phDevices != NULL`"
61- ]>,
62- Return<"OFFLOAD_ERRC_INVALID_NULL_POINTER", [
63- "`NumEntries > 0 && phDevices == NULL`"
64- ]>,
65- Return<"OFFLOAD_ERRC_INVALID_VALUE">
63+ "`NumEntries == 0`"
64+ ]>
6665 ];
6766}
6867
6968def : Function {
7069 let name = "offloadDeviceGetInfo";
71- let desc = "Retrieves various information about device";
70+ let desc = "Queries the given property of the device";
7271 let details = [
7372 "The application may call this function from simultaneous threads.",
7473 "The implementation of this function should be lock-free."
@@ -79,23 +78,36 @@ def : Function {
7978 Param<"size_t", "propSize", "the number of bytes pointed to by pPropValue.", PARAM_IN>,
8079 TypeTaggedParam<"void*", "pPropValue", "array of bytes holding the info. If propSize is not equal to or greater than the real "
8180 "number of bytes needed to return the info then the OFFLOAD_ERRC_INVALID_SIZE error is returned and "
82- "pPropValue is not used.", PARAM_OUT_OPTIONAL, TypeInfo<"propName" , "propSize">>,
83- Param<"size_t*", "pPropSizeRet", "pointer to the actual size in bytes of the queried propName.", PARAM_OUT_OPTIONAL>
81+ "pPropValue is not used.", PARAM_OUT, TypeInfo<"propName" , "propSize">>
8482 ];
8583 let returns = [
8684 Return<"OFFLOAD_ERRC_UNSUPPORTED_ENUMERATION", [
87- "If `propName` is not supported by the adapter ."
85+ "If `propName` is not supported by the device ."
8886 ]>,
8987 Return<"OFFLOAD_ERRC_INVALID_SIZE", [
90- "`propSize == 0 && pPropValue != NULL `",
88+ "`propSize == 0`",
9189 "If `propSize` is less than the real number of bytes needed to return the info."
9290 ]>,
93- Return<"OFFLOAD_ERRC_INVALID_NULL_POINTER", [
94- "`propSize != 0 && pPropValue == NULL`",
95- "`pPropValue == NULL && pPropSizeRet == NULL`"
91+ Return<"OFFLOAD_ERRC_INVALID_DEVICE">
92+ ];
93+ }
94+
95+ def : Function {
96+ let name = "offloadDeviceGetInfoSize";
97+ let desc = "Returns the storage size of the given device query";
98+ let details = [
99+ "The application may call this function from simultaneous threads.",
100+ "The implementation of this function should be lock-free."
101+ ];
102+ let params = [
103+ Param<"offload_device_handle_t", "hDevice", "handle of the device instance", PARAM_IN>,
104+ Param<"offload_device_info_t", "propName", "type of the info to retrieve", PARAM_IN>,
105+ Param<"size_t*", "pPropSizeRet", "pointer to the number of bytes required to store the query", PARAM_OUT>
106+ ];
107+ let returns = [
108+ Return<"OFFLOAD_ERRC_UNSUPPORTED_ENUMERATION", [
109+ "If `propName` is not supported by the device."
96110 ]>,
97- Return<"OFFLOAD_ERRC_INVALID_DEVICE">,
98- Return<"OFFLOAD_ERRC_OUT_OF_RESOURCES">,
99- Return<"OFFLOAD_ERRC_OUT_OF_HOST_MEMORY">
111+ Return<"OFFLOAD_ERRC_INVALID_DEVICE">
100112 ];
101113}
0 commit comments