diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 84989b7412b1b87affc3520d271ba9edc02213c2..2d5f30616453f2a88e9e7b10acfda7b464b1c2c5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,3 +4,4 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") add_executable(hello hello.c) add_executable(hello-task hello-task.c) +target_link_libraries(hello-task m) diff --git a/test/hello-task.c b/test/hello-task.c index 3ff5a30bece771085ef65ecf992cecc1efd9b5e6..b18738e0fd7f3ec5aaf7f34c9945347201009ced 100644 --- a/test/hello-task.c +++ b/test/hello-task.c @@ -1,6 +1,7 @@ #include <stdio.h> #include <unistd.h> #include <omp.h> +#include <math.h> int array[] = { 1, 2, 3, 4}; @@ -18,7 +19,10 @@ int main() for (int i = 0; i < 4; i++) { #pragma omp task depend(in: array[i]) depend(inout: array[(i+1)%4]) { + double d; array[(i+1)%4] = array[i]; + for (int j=0; j<100000; ++j) + d += sin(M_PI/j)*cos(M_PI/i); printf("Hey %i\n", i); } }