Module: Hwloc

Extended by:
FFI::Library
Defined in:
lib/hwloc/Obj.rb,
lib/hwloc/Bind.rb,
lib/hwloc/Hwloc.rb,
lib/hwloc/Bitmap.rb,
lib/hwloc/Export.rb,
lib/hwloc/Edition.rb,
lib/hwloc/Topology.rb,
lib/hwloc/Topology.rb

Defined Under Namespace

Classes: AnonBridgeAttrDownstream, AnonBridgeAttrDownstreamStruct, AnonBridgeAttrUpstream, BindError, Bitmap, BoolStruct, BridgeAttr, CacheAttr, CpubindError, Cpuset, Distances, EditionError, Error, ExportError, GroupAttr, MembindError, Nodeset, NumanodeAttr, Obj, ObjAttr, ObjError, ObjInfo, ObjMemory, ObjMemoryPageType, OsdevAttr, PcidevAttr, Struct, Topology, TopologyCpubindSupport, TopologyDiscoverySupport, TopologyError, TopologyMemSupport, TopologySupport, Union

Constant Summary collapse

ObjType =
enum( :obj_type, obj_types )
ObjCacheType =
enum( :obj_cache_type, [
  :OBJ_CACHE_UNIFIED,
  :OBJ_CACHE_DATA,
  :OBJ_CACHE_INSTRUCTION
] )
ObjBrigeType =
enum( :obj_bridge_type, [
  :OBJ_BRIDGE_HOST,
  :OBJ_BRIDGE_PCI
] )
ObjOsdevType =
enum( :obj_osdev_type, [
  :OBJ_OSDEV_BLOCK,
  :OBJ_OSDEV_GPU,
  :OBJ_OSDEV_NETWORK,
  :OBJ_OSDEV_OPENFABRICS,
  :OBJ_OSDEV_DMA,
  :OBJ_OSDEV_COPROC
] )
DistancesKind =
bitmask(FFI::find_type(:ulong), :distances_kind, [
  :DISTANCES_KIND_FROM_OS,
  :DISTANCES_KIND_FROM_USER,
  :DISTANCES_KIND_MEANS_LATENCY,
  :DISTANCES_KIND_MEANS_BANDWIDTH
])
DistancesAddFlag =
bitmask(FFI::find_type(:ulong), :distances_add_flag, [
  :DISTANCES_ADD_FLAG_GROUP,
  :DISTANCES_ADD_FLAG_GROUP_INACCURATE
])
CpubindFlags =
bitmask( :cpubind_flags, [
  :CPUBIND_PROCESS,
  :CPUBIND_THREAD,
  :CPUBIND_STRICT,
  :CPUBIND_NOMEMBIND
] )
MembindPolicy =
enum( :membind_policy, [
  :MEMBIND_DEFAULT,    0,
  :MEMBIND_FIRSTTOUCH, 1,
  :MEMBIND_BIND,       2,
  :MEMBIND_INTERLEAVE, 3,
  :MEMBIND_NEXTTOUCH,  4,
  :MEMBIND_MIXED,      -1
] )
MembindFlags =
bitmask( :membind_flags, [
  :MEMBIND_PROCESS,
  :MEMBIND_THREAD,
  :MEMBIND_STRICT,
  :MEMBIND_MIGRATE,
  :MEMBIND_NOCPUBIND,
  :MEMBIND_BYNODESET
] )
API_VERSION =
Hwloc.hwloc_get_api_version
API_VERSION_1_10 =
0x00010a00
API_VERSION_2_0 =
0x00020000
TopologyExportXmlFlags =
bitmask( FFI::find_type(:ulong), :topology_export_xml_flags, [
  :TOPOLOGY_EXPORT_XML_FLAG_V1
] )
TopologyExportSyntheticFlags =
bitmask( FFI::find_type(:ulong), :topology_export_synthetic_flags, [
  :TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_EXTENDED_TYPES,
  :TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_ATTRS
] )
RestrictFlags =
bitmask( FFI::find_type(:ulong), :restrict_flags, [
  :RESTRICT_FLAG_REMOVE_CPULESS,
  :RESTRICT_FLAG_ADAPT_MISC,
  :RESTRICT_FLAG_ADAPT_IO
] )
TopologyFlags =
bitmask( FFI::find_type(:ulong), :topology_flags, [
  :TOPOLOGY_FLAG_WHOLE_SYSTEM,
  :TOPOLOGY_FLAG_IS_THISSYSTEM,
  :TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES
] )
GetTypeDepth =
enum(:get_type_depth, [
  :TYPE_DEPTH_UNKNOWN, -1,
  :TYPE_DEPTH_MULTIPLE, -2,
  :TYPE_DEPTH_BRIDGE, -3,
  :TYPE_DEPTH_PCI_DEVICE, -4,
  :TYPE_DEPTH_OS_DEVICE, -5
] + ( API_VERSION >= API_VERSION_2_0 ? [ :TYPE_DEPTH_MISC, -6 ] : [] ) )
TypeFilter =
enum(:type_filter, [
  :TYPE_FILTER_KEEP_ALL, 0,
  :TYPE_FILTER_KEEP_NONE, 1,
  :TYPE_FILTER_KEEP_STRUCTURE, 2,
  :TYPE_FILTER_KEEP_IMPORTANT, 3
] )

Class Method Summary collapse

Class Method Details

.compare_types(type1, type2) ⇒ Object



32
33
34
# File 'lib/hwloc/Obj.rb', line 32

def self.compare_types(type1, type2)
  return Hwloc.hwloc_compare_types(type1, type2)
end

.const_missing(sym) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/hwloc/Topology.rb', line 3

def self.const_missing( sym )
  value = enum_value( sym )

  return super unless value

  value
end

.error_stringObject



22
23
24
# File 'lib/hwloc/Hwloc.rb', line 22

def self.error_string
  return Hwloc.strerror(FFI::LastError::error)
end