1
1
/*
2
- * Copyright © 2019-2022 Inria. All rights reserved.
2
+ * Copyright © 2019-2023 Inria. All rights reserved.
3
3
* See COPYING in top-level directory.
4
4
*/
5
5
@@ -178,6 +178,9 @@ enum hwloc_memattr_id_e {
178
178
typedef unsigned hwloc_memattr_id_t ;
179
179
180
180
/** \brief Return the identifier of the memory attribute with the given name.
181
+ *
182
+ * \return 0 on success.
183
+ * \return -1 with errno set to \c EINVAL if no such attribute exists.
181
184
*/
182
185
HWLOC_DECLSPEC int
183
186
hwloc_memattr_get_by_name (hwloc_topology_t topology ,
@@ -247,6 +250,8 @@ enum hwloc_local_numanode_flag_e {
247
250
* or the number of nodes that would have been stored if there were
248
251
* enough room.
249
252
*
253
+ * \return 0 on success or -1 on error.
254
+ *
250
255
* \note Some of these NUMA nodes may not have any memory attribute
251
256
* values and hence not be reported as actual targets in other functions.
252
257
*
@@ -276,6 +281,10 @@ hwloc_get_local_numanode_objs(hwloc_topology_t topology,
276
281
*
277
282
* \p flags must be \c 0 for now.
278
283
*
284
+ * \return 0 on success.
285
+ * \return -1 on error, for instance with errno set to \c EINVAL if flags
286
+ * are invalid or no such attribute exists.
287
+ *
279
288
* \note The initiator \p initiator should be of type ::HWLOC_LOCATION_TYPE_CPUSET
280
289
* when refering to accesses performed by CPU cores.
281
290
* ::HWLOC_LOCATION_TYPE_OBJECT is currently unused internally by hwloc,
@@ -307,7 +316,10 @@ hwloc_memattr_get_value(hwloc_topology_t topology,
307
316
*
308
317
* \p flags must be \c 0 for now.
309
318
*
310
- * If there are no matching targets, \c -1 is returned with \p errno set to \c ENOENT;
319
+ * \return 0 on success.
320
+ * \return -1 with errno set to \c ENOENT if there are no matching targets.
321
+ * \return -1 with errno set to \c EINVAL if flags are invalid,
322
+ * or no such attribute exists.
311
323
*
312
324
* \note The initiator \p initiator should be of type ::HWLOC_LOCATION_TYPE_CPUSET
313
325
* when refering to accesses performed by CPU cores.
@@ -323,10 +335,6 @@ hwloc_memattr_get_best_target(hwloc_topology_t topology,
323
335
hwloc_obj_t * best_target , hwloc_uint64_t * value );
324
336
325
337
/** \brief Return the best initiator for the given attribute and target NUMA node.
326
- *
327
- * If the attribute does not relate to a specific initiator
328
- * (it does not have the flag ::HWLOC_MEMATTR_FLAG_NEED_INITIATOR),
329
- * \c -1 is returned and \p errno is set to \c EINVAL.
330
338
*
331
339
* If \p value is non \c NULL, the corresponding value is returned there.
332
340
*
@@ -342,7 +350,10 @@ hwloc_memattr_get_best_target(hwloc_topology_t topology,
342
350
*
343
351
* \p flags must be \c 0 for now.
344
352
*
345
- * If there are no matching initiators, \c -1 is returned with \p errno set to \c ENOENT;
353
+ * \return 0 on success.
354
+ * \return -1 with errno set to \c ENOENT if there are no matching initiators.
355
+ * \return -1 with errno set to \c EINVAL if the attribute does not relate to a specific initiator
356
+ * (it does not have the flag ::HWLOC_MEMATTR_FLAG_NEED_INITIATOR).
346
357
*/
347
358
HWLOC_DECLSPEC int
348
359
hwloc_memattr_get_best_initiator (hwloc_topology_t topology ,
@@ -359,6 +370,9 @@ hwloc_memattr_get_best_initiator(hwloc_topology_t topology,
359
370
*/
360
371
361
372
/** \brief Return the name of a memory attribute.
373
+ *
374
+ * \return 0 on success.
375
+ * \return -1 with errno set to \c EINVAL if the attribute does not exist.
362
376
*/
363
377
HWLOC_DECLSPEC int
364
378
hwloc_memattr_get_name (hwloc_topology_t topology ,
@@ -368,6 +382,9 @@ hwloc_memattr_get_name(hwloc_topology_t topology,
368
382
/** \brief Return the flags of the given attribute.
369
383
*
370
384
* Flags are a OR'ed set of ::hwloc_memattr_flag_e.
385
+ *
386
+ * \return 0 on success.
387
+ * \return -1 with errno set to \c EINVAL if the attribute does not exist.
371
388
*/
372
389
HWLOC_DECLSPEC int
373
390
hwloc_memattr_get_flags (hwloc_topology_t topology ,
@@ -397,6 +414,9 @@ enum hwloc_memattr_flag_e {
397
414
* Add a specific memory attribute that is not defined in ::hwloc_memattr_id_e.
398
415
* Flags are a OR'ed set of ::hwloc_memattr_flag_e. It must contain at least
399
416
* one of ::HWLOC_MEMATTR_FLAG_HIGHER_FIRST or ::HWLOC_MEMATTR_FLAG_LOWER_FIRST.
417
+ *
418
+ * \return 0 on success.
419
+ * \return -1 with errno set to \c EBUSY if another attribute already uses this name.
400
420
*/
401
421
HWLOC_DECLSPEC int
402
422
hwloc_memattr_register (hwloc_topology_t topology ,
@@ -421,6 +441,8 @@ hwloc_memattr_register(hwloc_topology_t topology,
421
441
* ::HWLOC_LOCATION_TYPE_OBJECT is currently unused internally by hwloc,
422
442
* but users may for instance use it to provide custom information about
423
443
* host memory accesses performed by GPUs.
444
+ *
445
+ * \return 0 on success or -1 on error.
424
446
*/
425
447
HWLOC_DECLSPEC int
426
448
hwloc_memattr_set_value (hwloc_topology_t topology ,
@@ -460,6 +482,8 @@ hwloc_memattr_set_value(hwloc_topology_t topology,
460
482
* NUMA nodes with hwloc_get_local_numanode_objs() and then look at their attribute
461
483
* values.
462
484
*
485
+ * \return 0 on success or -1 on error.
486
+ *
463
487
* \note The initiator \p initiator should be of type ::HWLOC_LOCATION_TYPE_CPUSET
464
488
* when referring to accesses performed by CPU cores.
465
489
* ::HWLOC_LOCATION_TYPE_OBJECT is currently unused internally by hwloc,
@@ -497,6 +521,8 @@ hwloc_memattr_get_targets(hwloc_topology_t topology,
497
521
* (it does not have the flag ::HWLOC_MEMATTR_FLAG_NEED_INITIATOR),
498
522
* no initiator is returned.
499
523
*
524
+ * \return 0 on success or -1 on error.
525
+ *
500
526
* \note This function is meant for tools and debugging (listing internal information)
501
527
* rather than for application queries. Applications should rather select useful
502
528
* NUMA nodes with hwloc_get_local_numanode_objs() and then look at their attribute
0 commit comments