30 int ptr[] = {0, 4, 5, 6, 7, 8, 9, 10, 11};
31 int cols[] = {1, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8};
32 std::vector<int> threadOrder;
33 bool threadOrderError =
false;
34#pragma omp parallel num_threads(8)
38 for (
int i = 0;
i < 8; ++
i) {
39 int pos = ptr[
i],
size = ptr[
i + 1] - ptr[
i];
40#pragma omp task depend(iterator(it = 0 : size), in : ptr[cols[pos + it]]) depend(out : ptr[i])
44 threadOrder.push_back(
i);
52 std::vector<int>::iterator idx[8];
53 for (
int i = 0;
i < 8; ++
i)
54 idx[
i] = std::find (threadOrder.begin(), threadOrder.end(),
i);
57 if (idx[0] != threadOrder.begin())
58 threadOrderError |=
true;
59 if (idx[1] > idx[5] || idx[2] > idx[5])
60 threadOrderError |=
true;
61 if (idx[3] > idx[6] || idx[4] > idx[6])
62 threadOrderError |=
true;
63 if (idx[5] > idx[7] || idx[6] > idx[7])
64 threadOrderError |=
true;
66 std::sort(threadOrder.begin(), threadOrder.end());
67 for(
int i = 0;
i < 8; ++
i)
68 threadOrderError = (threadOrder[
i] !=
i) || threadOrderError;
71 return !threadOrderError;
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t size
int test_omp_task_depend_iterator()