Specifying OMPTARGET

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

    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