[Openmp-dev] Specifying OMPTARGET
Jost, Gabriele (ARC-TNE)[CSRA, LLC] via Openmp-dev
openmp-dev at lists.llvm.org
Tue Oct 17 10:28:14 PDT 2017
Hello Jonas,
Thanks for the reply. I am using
pfe20.gjost 88> ./clang-version
clang version 6.0.0 (trunk 315725) (llvm/trunk 315713)
Target: x86_64-unknown-linux-gnu
Thread model: posix
I am happy to tell you that indeed it does accept the teams construct and the update clause.
I am compiling like this:
clang -c -I../common -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -march=sm_35 -Xopenmp-target -mcmodel=medium --cuda-path=/nasa/cuda/8.0 ft.c
Now I get this error:
clang: llvm/tools/clang/lib/Driver/ToolChains/Cuda.cpp:257: virtual void clang::driver::tools::NVPTX::Assembler::ConstructJob(clang::driver::Compilation&, const cla
ng::driver::JobAction&, const clang::driver::InputInfo&, const InputInfoList&, const llvm::opt::ArgList&, const char*) const: Assertion `gpu_arch != CudaArch::UNKNOWN && "Device action
expected to have an architecture."' failed.
I assume this is due to the fact that I did not not set
-DOMPTARGET_NVPTX_SM=35
during the build. Would you recommend that I redo the build? And also, would you advise on any other flags I should set during rebuild?
Many thanks in advance,
Gabriele
On 10/17/17, 6:27 AM, "Jonas Hahnfeld" <hahnjo at hahnjo.de> wrote:
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.
Regards,
Jonas
Am 2017-10-16 20:39, schrieb Jost, Gabriele (ARC-TNE)[CSRA, LLC] via
Openmp-dev:
> Hello,
>
> 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.
>
> Gabriele
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
More information about the Openmp-dev
mailing list