1
1
/*
2
- * Copyright © 2010-2022 Inria. All rights reserved.
2
+ * Copyright © 2010-2023 Inria. All rights reserved.
3
3
* See COPYING in top-level directory.
4
4
*/
5
5
@@ -131,6 +131,8 @@ enum hwloc_distances_kind_e {
131
131
*
132
132
* Each distance matrix returned in the \p distances array should be released
133
133
* by the caller using hwloc_distances_release().
134
+ *
135
+ * \return 0 on success, -1 on error.
134
136
*/
135
137
HWLOC_DECLSPEC int
136
138
hwloc_distances_get (hwloc_topology_t topology ,
@@ -140,6 +142,8 @@ hwloc_distances_get(hwloc_topology_t topology,
140
142
/** \brief Retrieve distance matrices for object at a specific depth in the topology.
141
143
*
142
144
* Identical to hwloc_distances_get() with the additional \p depth filter.
145
+ *
146
+ * \return 0 on success, -1 on error.
143
147
*/
144
148
HWLOC_DECLSPEC int
145
149
hwloc_distances_get_by_depth (hwloc_topology_t topology , int depth ,
@@ -149,6 +153,8 @@ hwloc_distances_get_by_depth(hwloc_topology_t topology, int depth,
149
153
/** \brief Retrieve distance matrices for object of a specific type.
150
154
*
151
155
* Identical to hwloc_distances_get() with the additional \p type filter.
156
+ *
157
+ * \return 0 on success, -1 on error.
152
158
*/
153
159
HWLOC_DECLSPEC int
154
160
hwloc_distances_get_by_type (hwloc_topology_t topology , hwloc_obj_type_t type ,
@@ -162,6 +168,8 @@ hwloc_distances_get_by_type(hwloc_topology_t topology, hwloc_obj_type_t type,
162
168
* The name of the most common structure is "NUMALatency".
163
169
* Others include "XGMIBandwidth", "XGMIHops", "XeLinkBandwidth",
164
170
* and "NVLinkBandwidth".
171
+ *
172
+ * \return 0 on success, -1 on error.
165
173
*/
166
174
HWLOC_DECLSPEC int
167
175
hwloc_distances_get_by_name (hwloc_topology_t topology , const char * name ,
@@ -171,7 +179,12 @@ hwloc_distances_get_by_name(hwloc_topology_t topology, const char *name,
171
179
/** \brief Get a description of what a distances structure contains.
172
180
*
173
181
* For instance "NUMALatency" for hardware-provided NUMA distances (ACPI SLIT),
174
- * or NULL if unknown.
182
+ * or \c NULL if unknown.
183
+ *
184
+ * \return the constant string with the name of the distance structure.
185
+ *
186
+ * \note The returned name should not be freed by the caller,
187
+ * it belongs to the hwloc library.
175
188
*/
176
189
HWLOC_DECLSPEC const char *
177
190
hwloc_distances_get_name (hwloc_topology_t topology , struct hwloc_distances_s * distances );
@@ -252,6 +265,8 @@ enum hwloc_distances_transform_e {
252
265
*
253
266
* \p flags must be \c 0 for now.
254
267
*
268
+ * \return 0 on success, -1 on error for instance if flags are invalid.
269
+ *
255
270
* \note Objects in distances array \p objs may be directly modified
256
271
* in place without using hwloc_distances_transform().
257
272
* One may use hwloc_get_obj_with_same_locality() to easily convert
@@ -272,6 +287,7 @@ HWLOC_DECLSPEC int hwloc_distances_transform(hwloc_topology_t topology, struct h
272
287
273
288
/** \brief Find the index of an object in a distances structure.
274
289
*
290
+ * \return the index of the object in the distances structure if any.
275
291
* \return -1 if object \p obj is not involved in structure \p distances.
276
292
*/
277
293
static __hwloc_inline int
@@ -289,6 +305,7 @@ hwloc_distances_obj_index(struct hwloc_distances_s *distances, hwloc_obj_t obj)
289
305
* The distance from \p obj1 to \p obj2 is stored in the value pointed by
290
306
* \p value1to2 and reciprocally.
291
307
*
308
+ * \return 0 on success.
292
309
* \return -1 if object \p obj1 or \p obj2 is not involved in structure \p distances.
293
310
*/
294
311
static __hwloc_inline int
@@ -374,8 +391,8 @@ hwloc_distances_add_create(hwloc_topology_t topology,
374
391
*
375
392
* \p flags must be \c 0 for now.
376
393
*
377
- * \return \c 0 on success.
378
- * \return \c -1 on error.
394
+ * \return 0 on success.
395
+ * \return -1 on error.
379
396
*/
380
397
HWLOC_DECLSPEC int hwloc_distances_add_values (hwloc_topology_t topology ,
381
398
hwloc_distances_add_handle_t handle ,
@@ -411,8 +428,8 @@ enum hwloc_distances_add_flag_e {
411
428
*
412
429
* On error, the temporary distances structure and its content are destroyed.
413
430
*
414
- * \return \c 0 on success.
415
- * \return \c -1 on error.
431
+ * \return 0 on success.
432
+ * \return -1 on error.
416
433
*/
417
434
HWLOC_DECLSPEC int hwloc_distances_add_commit (hwloc_topology_t topology ,
418
435
hwloc_distances_add_handle_t handle ,
@@ -433,18 +450,24 @@ HWLOC_DECLSPEC int hwloc_distances_add_commit(hwloc_topology_t topology,
433
450
*
434
451
* If these distances were used to group objects, these additional
435
452
* Group objects are not removed from the topology.
453
+ *
454
+ * \return 0 on success, -1 on error.
436
455
*/
437
456
HWLOC_DECLSPEC int hwloc_distances_remove (hwloc_topology_t topology );
438
457
439
458
/** \brief Remove distance matrices for objects at a specific depth in the topology.
440
459
*
441
460
* Identical to hwloc_distances_remove() but only applies to one level of the topology.
461
+ *
462
+ * \return 0 on success, -1 on error.
442
463
*/
443
464
HWLOC_DECLSPEC int hwloc_distances_remove_by_depth (hwloc_topology_t topology , int depth );
444
465
445
466
/** \brief Remove distance matrices for objects of a specific type in the topology.
446
467
*
447
468
* Identical to hwloc_distances_remove() but only applies to one level of the topology.
469
+ *
470
+ * \return 0 on success, -1 on error.
448
471
*/
449
472
static __hwloc_inline int
450
473
hwloc_distances_remove_by_type (hwloc_topology_t topology , hwloc_obj_type_t type )
@@ -458,6 +481,8 @@ hwloc_distances_remove_by_type(hwloc_topology_t topology, hwloc_obj_type_t type)
458
481
/** \brief Release and remove the given distance matrice from the topology.
459
482
*
460
483
* This function includes a call to hwloc_distances_release().
484
+ *
485
+ * \return 0 on success, -1 on error.
461
486
*/
462
487
HWLOC_DECLSPEC int hwloc_distances_release_remove (hwloc_topology_t topology , struct hwloc_distances_s * distances );
463
488
0 commit comments