File indexing completed on 2026-09-23 09:14:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef HWLOC_DEPRECATED_H
0015 #define HWLOC_DEPRECATED_H
0016
0017 #ifndef HWLOC_H
0018 #error Please include the main hwloc.h instead
0019 #endif
0020
0021 #ifdef __cplusplus
0022 extern "C" {
0023 #endif
0024
0025
0026 #define HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED
0027
0028 #define HWLOC_OBJ_SYSTEM HWLOC_OBJ_MACHINE
0029
0030 #define HWLOC_OBJ_SOCKET HWLOC_OBJ_PACKAGE
0031
0032 #define HWLOC_OBJ_NODE HWLOC_OBJ_NUMANODE
0033
0034
0035
0036
0037
0038
0039 HWLOC_DECLSPEC int hwloc_distances_add(hwloc_topology_t topology,
0040 unsigned nbobjs, hwloc_obj_t *objs, hwloc_uint64_t *values,
0041 unsigned long kind, unsigned long flags) __hwloc_attribute_deprecated;
0042
0043
0044
0045
0046
0047 static __hwloc_inline hwloc_obj_t
0048 hwloc_topology_insert_misc_object_by_parent(hwloc_topology_t topology, hwloc_obj_t parent, const char *name) __hwloc_attribute_deprecated;
0049 static __hwloc_inline hwloc_obj_t
0050 hwloc_topology_insert_misc_object_by_parent(hwloc_topology_t topology, hwloc_obj_t parent, const char *name)
0051 {
0052 return hwloc_topology_insert_misc_object(topology, parent, name);
0053 }
0054
0055
0056
0057
0058
0059
0060
0061
0062 static __hwloc_inline int
0063 hwloc_obj_cpuset_snprintf(char *str, size_t size, size_t nobj, struct hwloc_obj * const *objs) __hwloc_attribute_deprecated;
0064 static __hwloc_inline int
0065 hwloc_obj_cpuset_snprintf(char *str, size_t size, size_t nobj, struct hwloc_obj * const *objs)
0066 {
0067 hwloc_bitmap_t set = hwloc_bitmap_alloc();
0068 int res;
0069 unsigned i;
0070
0071 hwloc_bitmap_zero(set);
0072 for(i=0; i<nobj; i++)
0073 if (objs[i]->cpuset)
0074 hwloc_bitmap_or(set, set, objs[i]->cpuset);
0075
0076 res = hwloc_bitmap_snprintf(str, size, set);
0077 hwloc_bitmap_free(set);
0078 return res;
0079 }
0080
0081
0082
0083
0084
0085 static __hwloc_inline int
0086 hwloc_obj_type_sscanf(const char *string, hwloc_obj_type_t *typep, int *depthattrp, void *typeattrp, size_t typeattrsize) __hwloc_attribute_deprecated;
0087 static __hwloc_inline int
0088 hwloc_obj_type_sscanf(const char *string, hwloc_obj_type_t *typep, int *depthattrp, void *typeattrp, size_t typeattrsize)
0089 {
0090 union hwloc_obj_attr_u attr;
0091 int err = hwloc_type_sscanf(string, typep, &attr, sizeof(attr));
0092 if (err < 0)
0093 return err;
0094 if (hwloc_obj_type_is_cache(*typep)) {
0095 if (depthattrp)
0096 *depthattrp = (int) attr.cache.depth;
0097 if (typeattrp && typeattrsize >= sizeof(hwloc_obj_cache_type_t))
0098 memcpy(typeattrp, &attr.cache.type, sizeof(hwloc_obj_cache_type_t));
0099 } else if (*typep == HWLOC_OBJ_GROUP) {
0100 if (depthattrp)
0101 *depthattrp = (int) attr.group.depth;
0102 }
0103 return 0;
0104 }
0105
0106
0107
0108
0109 static __hwloc_inline int
0110 hwloc_set_membind_nodeset(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_deprecated;
0111 static __hwloc_inline int
0112 hwloc_set_membind_nodeset(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
0113 {
0114 return hwloc_set_membind(topology, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
0115 }
0116
0117
0118
0119
0120 static __hwloc_inline int
0121 hwloc_get_membind_nodeset(hwloc_topology_t topology, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags) __hwloc_attribute_deprecated;
0122 static __hwloc_inline int
0123 hwloc_get_membind_nodeset(hwloc_topology_t topology, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags)
0124 {
0125 return hwloc_get_membind(topology, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
0126 }
0127
0128
0129
0130
0131 static __hwloc_inline int
0132 hwloc_set_proc_membind_nodeset(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_deprecated;
0133 static __hwloc_inline int
0134 hwloc_set_proc_membind_nodeset(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
0135 {
0136 return hwloc_set_proc_membind(topology, pid, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
0137 }
0138
0139
0140
0141
0142 static __hwloc_inline int
0143 hwloc_get_proc_membind_nodeset(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags) __hwloc_attribute_deprecated;
0144 static __hwloc_inline int
0145 hwloc_get_proc_membind_nodeset(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags)
0146 {
0147 return hwloc_get_proc_membind(topology, pid, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
0148 }
0149
0150
0151
0152
0153 static __hwloc_inline int
0154 hwloc_set_area_membind_nodeset(hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_deprecated;
0155 static __hwloc_inline int
0156 hwloc_set_area_membind_nodeset(hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
0157 {
0158 return hwloc_set_area_membind(topology, addr, len, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
0159 }
0160
0161
0162
0163
0164 static __hwloc_inline int
0165 hwloc_get_area_membind_nodeset(hwloc_topology_t topology, const void *addr, size_t len, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags) __hwloc_attribute_deprecated;
0166 static __hwloc_inline int
0167 hwloc_get_area_membind_nodeset(hwloc_topology_t topology, const void *addr, size_t len, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags)
0168 {
0169 return hwloc_get_area_membind(topology, addr, len, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
0170 }
0171
0172
0173
0174 static __hwloc_inline void *
0175 hwloc_alloc_membind_nodeset(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc __hwloc_attribute_deprecated;
0176 static __hwloc_inline void *
0177 hwloc_alloc_membind_nodeset(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
0178 {
0179 return hwloc_alloc_membind(topology, len, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
0180 }
0181
0182
0183
0184 static __hwloc_inline void *
0185 hwloc_alloc_membind_policy_nodeset(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc __hwloc_attribute_deprecated;
0186 static __hwloc_inline void *
0187 hwloc_alloc_membind_policy_nodeset(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
0188 {
0189 return hwloc_alloc_membind_policy(topology, len, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
0190 }
0191
0192
0193
0194 static __hwloc_inline void
0195 hwloc_cpuset_to_nodeset_strict(hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset, hwloc_nodeset_t nodeset) __hwloc_attribute_deprecated;
0196 static __hwloc_inline void
0197 hwloc_cpuset_to_nodeset_strict(hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset, hwloc_nodeset_t nodeset)
0198 {
0199 hwloc_cpuset_to_nodeset(topology, _cpuset, nodeset);
0200 }
0201
0202
0203
0204 static __hwloc_inline void
0205 hwloc_cpuset_from_nodeset_strict(hwloc_topology_t topology, hwloc_cpuset_t _cpuset, hwloc_const_nodeset_t nodeset) __hwloc_attribute_deprecated;
0206 static __hwloc_inline void
0207 hwloc_cpuset_from_nodeset_strict(hwloc_topology_t topology, hwloc_cpuset_t _cpuset, hwloc_const_nodeset_t nodeset)
0208 {
0209 hwloc_cpuset_from_nodeset(topology, _cpuset, nodeset);
0210 }
0211
0212
0213 #ifdef __cplusplus
0214 }
0215 #endif
0216
0217
0218 #endif