windows.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright © 2021 Inria. All rights reserved.
  3. * See COPYING in top-level directory.
  4. */
  5. /** \file
  6. * \brief Macros to help interaction between hwloc and Windows.
  7. *
  8. * Applications that use hwloc on Windows may want to include this file
  9. * for Windows specific hwloc features.
  10. */
  11. #ifndef HWLOC_WINDOWS_H
  12. #define HWLOC_WINDOWS_H
  13. #include "hwloc.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /** \defgroup hwlocality_windows Windows-specific helpers
  18. *
  19. * These functions query Windows processor groups.
  20. * These groups partition the operating system into virtual sets
  21. * of up to 64 neighbor PUs.
  22. * Threads and processes may only be bound inside a single group.
  23. * Although Windows processor groups may be exposed in the hwloc
  24. * hierarchy as hwloc Groups, they are also often merged into
  25. * existing hwloc objects such as NUMA nodes or Packages.
  26. * This API provides explicit information about Windows processor
  27. * groups so that applications know whether binding to a large
  28. * set of PUs may fail because it spans over multiple Windows
  29. * processor groups.
  30. *
  31. * @{
  32. */
  33. /** \brief Get the number of Windows processor groups
  34. *
  35. * \p flags must be 0 for now.
  36. *
  37. * \return at least \c 1 on success.
  38. * \return -1 on error, for instance if the topology does not match
  39. * the current system (e.g. loaded from another machine through XML).
  40. */
  41. HWLOC_DECLSPEC int hwloc_windows_get_nr_processor_groups(hwloc_topology_t topology, unsigned long flags);
  42. /** \brief Get the CPU-set of a Windows processor group.
  43. *
  44. * Get the set of PU included in the processor group specified
  45. * by \p pg_index.
  46. * \p pg_index must be between \c 0 and the value returned
  47. * by hwloc_windows_get_nr_processor_groups() minus 1.
  48. *
  49. * \p flags must be 0 for now.
  50. *
  51. * \return \c 0 on success.
  52. * \return \c -1 on error, for instance if \p pg_index is invalid,
  53. * or if the topology does not match the current system (e.g. loaded
  54. * from another machine through XML).
  55. */
  56. HWLOC_DECLSPEC int hwloc_windows_get_processor_group_cpuset(hwloc_topology_t topology, unsigned pg_index, hwloc_cpuset_t cpuset, unsigned long flags);
  57. /** @} */
  58. #ifdef __cplusplus
  59. } /* extern "C" */
  60. #endif
  61. #endif /* HWLOC_WINDOWS_H */