[llvm] Stop including unordered_map (NFC)
[llvm-project.git] / openmp / runtime / test / tasking / hidden_helper_task / capacity_nthreads.cpp
blobb551318a72f3f9d662b33467bb9058b58aab5de2
1 // RUN: %libomp-cxx-compile-and-run
3 #include <omp.h>
5 #include <algorithm>
6 #include <cassert>
7 #include <limits>
8 #include <vector>
10 int main(int argc, char *argv[]) {
11 const int N = std::min(std::max(std::max(32, 4 * omp_get_max_threads()),
12 4 * omp_get_num_procs()),
13 std::numeric_limits<int>::max());
15 std::vector<int> data(N);
17 #pragma omp parallel for num_threads(N)
18 for (unsigned i = 0; i < N; ++i) {
19 data[i] = i;
22 #pragma omp parallel for num_threads(N + 1)
23 for (unsigned i = 0; i < N; ++i) {
24 data[i] += i;
27 for (unsigned i = 0; i < N; ++i) {
28 assert(data[i] == 2 * i);
31 return 0;