LLVM OpenMP
20.0.0git
runtime
test
tasking
omp_task_depend_resize_hashmap.c
Go to the documentation of this file.
1
// RUN: %libomp-compile && env KMP_ENABLE_TASK_THROTTLING=0 %libomp-run
2
3
// This test is known to be fragile on NetBSD kernel at the moment,
4
// https://bugs.llvm.org/show_bug.cgi?id=42020.
5
// UNSUPPORTED: netbsd
6
7
// Very flaky on openmp-clang-x86_64-linux-debian.
8
// https://bugs.llvm.org/show_bug.cgi?id=45397
9
// UNSUPPORTED: linux
10
11
#include<omp.h>
12
#include<stdlib.h>
13
#include<string.h>
14
15
// The first hashtable static size is 997
16
#define NUM_DEPS 4000
17
18
19
int
main
()
20
{
21
int
*deps = calloc(
NUM_DEPS
,
sizeof
(
int
));
22
int
i
;
23
int
failed
= 0;
24
25
#pragma omp parallel
26
#pragma omp master
27
{
28
for
(
i
= 0;
i
<
NUM_DEPS
;
i
++) {
29
#pragma omp task firstprivate(i) depend(inout: deps[i])
30
{
31
deps[
i
] = 1;
32
}
33
#pragma omp task firstprivate(i) depend(inout: deps[i])
34
{
35
deps[
i
] = 2;
36
}
37
}
38
}
39
40
for
(
i
= 0;
i
<
NUM_DEPS
;
i
++) {
41
if
(deps[
i
] != 2)
42
failed
++;
43
}
44
45
return
failed
;
46
}
i
#define i
Definition:
kmp_stub.cpp:87
main
int main()
Definition:
omp_task_depend_resize_hashmap.c:19
NUM_DEPS
#define NUM_DEPS
Definition:
omp_task_depend_resize_hashmap.c:16
failed
int failed
Definition:
omp_thread_limit.c:11
Generated on Wed Jan 29 2025 20:58:02 for LLVM OpenMP by
1.9.6