| 41 | } |
| 42 | #if 0 |
| 43 | int64_t fib_omp(const int64_t n) { |
| 44 | if (n <= 20) return fib_sequential(n); |
| 45 | |
| 46 | int64_t n1; |
| 47 | #pragma omp task shared(n1) |
| 48 | n1 = fib_omp(n - 1); |
| 49 | |
| 50 | int64_t n2 = fib_omp(n - 2); |
| 51 | |
| 52 | #pragma omp taskwait |
| 53 | |
| 54 | // printf("fib(%ld) = %ld + %ld = %ld\n", n, n1, n2, n1 + n2); |
| 55 | return n1 + n2; |
| 56 | } |
| 57 | |
| 58 | // matrix_multiplication_omp |
| 59 | // reference: https://computing.llnl.gov/tutorials/openMP/samples/C/omp_mm.c |
no test coverage detected