Commit 2550431 1 parent 489dd43 commit 2550431 Copy full SHA for 2550431
File tree 3 files changed +23
-1
lines changed
3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,6 @@ enum {
134
134
typedef enum qv_scope_create_hint_e {
135
135
// TODO(skg) Enumerate all actual values.
136
136
// TODO(skg) Add to Fortran interface.
137
- // TODO(skg) Test bitmap operations in Fortran.
138
137
QV_SCOPE_CREATE_EXCLUSIVE = 0x00000001 ,
139
138
QV_SCOPE_CREATE_CLOSE = 0x00000002
140
139
} qv_scope_create_hint_t ;
Original file line number Diff line number Diff line change @@ -794,6 +794,20 @@ qvi_hwloc_bitmap_copy(
794
794
return QV_SUCCESS;
795
795
}
796
796
797
+ int
798
+ qvi_hwloc_bitmap_nbits (
799
+ hwloc_const_cpuset_t cpuset,
800
+ size_t *nbits
801
+ ) {
802
+ *nbits = 0 ;
803
+
804
+ const int inbits = hwloc_bitmap_last (cpuset);
805
+ if (inbits == -1 ) return QV_ERR_HWLOC;
806
+
807
+ *nbits = (size_t )inbits;
808
+ return QV_SUCCESS;
809
+ }
810
+
797
811
static int
798
812
topo_fname (
799
813
const char *base,
Original file line number Diff line number Diff line change @@ -150,6 +150,15 @@ qvi_hwloc_bitmap_copy(
150
150
hwloc_cpuset_t dest
151
151
);
152
152
153
+ /* *
154
+ * Returns the number of bits required to represent a given cpuset.
155
+ */
156
+ int
157
+ qvi_hwloc_bitmap_nbits (
158
+ hwloc_const_cpuset_t cpuset,
159
+ size_t *nbits
160
+ );
161
+
153
162
/* *
154
163
*
155
164
*/
You can’t perform that action at this time.
0 commit comments