cmake/Tests/CMakeLib/testAffinity.cxx

19 lines
498 B
C++
Raw Normal View History

2018-08-09 18:06:22 +02:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include <cstddef>
#include <iostream>
#include <set>
2020-02-01 23:06:01 +01:00
#include "cmAffinity.h"
2018-08-09 18:06:22 +02:00
int main()
{
std::set<size_t> cpus = cmAffinity::GetProcessorsAvailable();
if (!cpus.empty()) {
std::cout << "CPU affinity mask count is '" << cpus.size() << "'.\n";
} else {
std::cout << "CPU affinity not supported on this platform.\n";
}
return 0;
}