"teams distribute and update "clause"


I had high hopes for clang to support OpenMP4.5 target offload. I recently installed the latest version 6.0.0, but a lot of essential functionality seems to be missing.

For example:

cang -c -I…/common -O3 -fopenmp=libomp –cuda-path=${CUDA_ROOT} ft.c

ft.c:286:19: warning: extra tokens at the end of ‘#pragma omp teams’ are ignored [-Wextra-tokens]

#pragma omp teams distribute

ft.c:300:20: error: unexpected OpenMP clause ‘update’ in directive ‘#pragma omp target’

#pragma omp target update from(u0_real,u0_imag,u1_real,u1_imag)

Do you think there is something wrong with my install or maybe I am using the wrong compiler flags.

My apologies if this is the wrong mailing list for such kind of questions.

Hi Gabriele,

the offloading support is currently in the process of being upstreamed and more functionality is expected to come soon.
In addition, upstream Clang currently cannot generate correct code for all parsed OpenMP pragmas, especially not for all combined ones if I remember correctly.

That said, my current build of trunk Clang 6.0.0 was able to parse "teams distribute" (didn't test "update"). Can you post the output of clang --version?

For the compiler flags: If you actually want Clang to generate code for offloading, you have to specify the target triples with -fopenmp-targets=<...>. For GPUs, this would be -fopenmp-targets=nvptx64-nvidia-cuda and you can specify the compute capability with -Xopenmp-target -march=sm_60.