| 1 | #include <omp.h> |
| 2 | #include <stdio.h> |
| 3 | |
| 4 | int main(void) |
| 5 | { |
| 6 | unsigned __int128 total = 0; |
| 7 | int threads = 0; |
| 8 | #pragma omp parallel num_threads(2) reduction(+:threads) |
| 9 | { |
| 10 | ++threads; |
| 11 | __atomic_fetch_add(&total, 1, __ATOMIC_SEQ_CST); |
| 12 | } |
| 13 | if (threads != 2 || __atomic_load_n(&total, __ATOMIC_SEQ_CST) != 2) |
| 14 | return 1; |
| 15 | puts("Vinix OpenMP and 128-bit atomics passed"); |
| 16 | return 0; |
| 17 | } |
| 18 |