Skip to content

Commit 8c49593

Browse files
committed
IO helpers: clarify that some IO helpers return 0 on success and -1 on error
Refs #578 Signed-off-by: Brice Goglin <[email protected]>
1 parent 57ed73a commit 8c49593

File tree

8 files changed

+40
-9
lines changed

8 files changed

+40
-9
lines changed

include/hwloc/cuda.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2010-2021 Inria. All rights reserved.
2+
* Copyright © 2010-2023 Inria. All rights reserved.
33
* Copyright © 2010-2011 Université Bordeaux
44
* Copyright © 2011 Cisco Systems, Inc. All rights reserved.
55
* See COPYING in top-level directory.
@@ -42,6 +42,9 @@ extern "C" {
4242
/** \brief Return the domain, bus and device IDs of the CUDA device \p cudevice.
4343
*
4444
* Device \p cudevice must match the local machine.
45+
*
46+
* \return 0 on success.
47+
* \return -1 on error, for instance if device information could not be found.
4548
*/
4649
static __hwloc_inline int
4750
hwloc_cuda_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused,
@@ -87,6 +90,9 @@ hwloc_cuda_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused
8790
*
8891
* This function is currently only implemented in a meaningful way for
8992
* Linux; other systems will simply get a full cpuset.
93+
*
94+
* \return 0 on success.
95+
* \return -1 on error, for instance if device information could not be found.
9096
*/
9197
static __hwloc_inline int
9298
hwloc_cuda_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,

include/hwloc/cudart.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2010-2021 Inria. All rights reserved.
2+
* Copyright © 2010-2023 Inria. All rights reserved.
33
* Copyright © 2010-2011 Université Bordeaux
44
* Copyright © 2011 Cisco Systems, Inc. All rights reserved.
55
* See COPYING in top-level directory.
@@ -43,6 +43,9 @@ extern "C" {
4343
/** \brief Return the domain, bus and device IDs of the CUDA device whose index is \p idx.
4444
*
4545
* Device index \p idx must match the local machine.
46+
*
47+
* \return 0 on success.
48+
* \return -1 on error, for instance if device information could not be found.
4649
*/
4750
static __hwloc_inline int
4851
hwloc_cudart_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused,
@@ -84,6 +87,9 @@ hwloc_cudart_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unus
8487
*
8588
* This function is currently only implemented in a meaningful way for
8689
* Linux; other systems will simply get a full cpuset.
90+
*
91+
* \return 0 on success.
92+
* \return -1 on error, for instance if device information could not be found.
8793
*/
8894
static __hwloc_inline int
8995
hwloc_cudart_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,

include/hwloc/gl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright © 2012 Blue Brain Project, EPFL. All rights reserved.
3-
* Copyright © 2012-2021 Inria. All rights reserved.
3+
* Copyright © 2012-2023 Inria. All rights reserved.
44
* See COPYING in top-level directory.
55
*/
66

@@ -102,7 +102,8 @@ hwloc_gl_get_display_osdev_by_name(hwloc_topology_t topology,
102102
* Retrieves the OpenGL display port (server) in \p port and device (screen)
103103
* in \p screen that correspond to the given hwloc OS device object.
104104
*
105-
* \return \c -1 if none could be found.
105+
* \return 0 on success.
106+
* \return -1 if none could be found.
106107
*
107108
* The topology \p topology does not necessarily have to match the current
108109
* machine. For instance the topology may be an XML import of a remote host.

include/hwloc/levelzero.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2021 Inria. All rights reserved.
2+
* Copyright © 2021-2023 Inria. All rights reserved.
33
* See COPYING in top-level directory.
44
*/
55

@@ -55,6 +55,9 @@ extern "C" {
5555
*
5656
* This function is currently only implemented in a meaningful way for
5757
* Linux; other systems will simply get a full cpuset.
58+
*
59+
* \return 0 on success.
60+
* \return -1 on error, for instance if device information could not be found.
5861
*/
5962
static __hwloc_inline int
6063
hwloc_levelzero_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,

include/hwloc/nvml.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2012-2021 Inria. All rights reserved.
2+
* Copyright © 2012-2023 Inria. All rights reserved.
33
* See COPYING in top-level directory.
44
*/
55

@@ -51,6 +51,9 @@ extern "C" {
5151
*
5252
* This function is currently only implemented in a meaningful way for
5353
* Linux; other systems will simply get a full cpuset.
54+
*
55+
* \return 0 on success.
56+
* \return -1 on error, for instance if device information could not be found.
5457
*/
5558
static __hwloc_inline int
5659
hwloc_nvml_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,

include/hwloc/opencl.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2012-2021 Inria. All rights reserved.
2+
* Copyright © 2012-2023 Inria. All rights reserved.
33
* Copyright © 2013, 2018 Université Bordeaux. All right reserved.
44
* See COPYING in top-level directory.
55
*/
@@ -69,6 +69,9 @@ typedef union {
6969
/** \brief Return the domain, bus and device IDs of the OpenCL device \p device.
7070
*
7171
* Device \p device must match the local machine.
72+
*
73+
* \return 0 on success.
74+
* \return -1 on error, for instance if device information could not be found.
7275
*/
7376
static __hwloc_inline int
7477
hwloc_opencl_get_device_pci_busid(cl_device_id device,
@@ -126,6 +129,9 @@ hwloc_opencl_get_device_pci_busid(cl_device_id device,
126129
* This function is currently only implemented in a meaningful way for
127130
* Linux with the AMD or NVIDIA OpenCL implementation; other systems will simply
128131
* get a full cpuset.
132+
*
133+
* \return 0 on success.
134+
* \return -1 on error, for instance if the device could not be found.
129135
*/
130136
static __hwloc_inline int
131137
hwloc_opencl_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,

include/hwloc/openfabrics-verbs.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright © 2009 CNRS
3-
* Copyright © 2009-2021 Inria. All rights reserved.
3+
* Copyright © 2009-2023 Inria. All rights reserved.
44
* Copyright © 2009-2010 Université Bordeaux
55
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
66
* See COPYING in top-level directory.
@@ -57,6 +57,9 @@ extern "C" {
5757
*
5858
* This function is currently only implemented in a meaningful way for
5959
* Linux; other systems will simply get a full cpuset.
60+
*
61+
* \return 0 on success.
62+
* \return -1 on error, for instance if device information could not be found.
6063
*/
6164
static __hwloc_inline int
6265
hwloc_ibv_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,

include/hwloc/rsmi.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2012-2021 Inria. All rights reserved.
2+
* Copyright © 2012-2023 Inria. All rights reserved.
33
* Copyright (c) 2020, Advanced Micro Devices, Inc. All rights reserved.
44
* Written by Advanced Micro Devices,
55
* See COPYING in top-level directory.
@@ -55,6 +55,9 @@ extern "C" {
5555
*
5656
* This function is currently only implemented in a meaningful way for
5757
* Linux; other systems will simply get a full cpuset.
58+
*
59+
* \return 0 on success.
60+
* \return -1 on error, for instance if device information could not be found.
5861
*/
5962
static __hwloc_inline int
6063
hwloc_rsmi_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,

0 commit comments

Comments
 (0)