diff options
Diffstat (limited to 'tests/projects/openmp/loop')
| -rw-r--r-- | tests/projects/openmp/loop/src/main.cpp | 12 | ||||
| -rw-r--r-- | tests/projects/openmp/loop/xmake.lua | 6 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/projects/openmp/loop/src/main.cpp b/tests/projects/openmp/loop/src/main.cpp new file mode 100644 index 000000000..273a8538e --- /dev/null +++ b/tests/projects/openmp/loop/src/main.cpp @@ -0,0 +1,12 @@ +#include <stdio.h> +#include <omp.h> + +int main(int argc, char** argv) +{ + #pragma omp parallel for + for (int i = 0; i < 10; ++i) + { + printf("hello(%d): i = %d\n", omp_get_thread_num(), i); + } + return 0; +} diff --git a/tests/projects/openmp/loop/xmake.lua b/tests/projects/openmp/loop/xmake.lua new file mode 100644 index 000000000..eb14be1a3 --- /dev/null +++ b/tests/projects/openmp/loop/xmake.lua @@ -0,0 +1,6 @@ +add_requires("libomp", {optional = true}) +target("loop") + set_kind("binary") + add_files("src/*.cpp") + add_rules("c++.openmp") + add_packages("libomp") |
