[Openmp-dev] Using OpenMP target offloading in llvm-8.0.0

Alok Mishra via Openmp-dev openmp-dev at lists.llvm.org
Thu Jun 20 11:01:25 PDT 2019


Hi,

When trying to use openmp target offloading with llvm I get the following
error

*$ cat offload.cpp*
> #include <omp.h>
> int main() {
> #pragma omp target teams distribute parallel for
>     for(int i=0; i<100; i++);
>      return 0;
> }
> *$ clang++ -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda
> --cuda-path=$CUDA_TOOLKIT_ROOT_DIR offload.cpp -o offload*
> *$ ./offload*
> Libomptarget fatal error 1: default offloading policy must switched to
> mandatory or disabled
> *$*


I have llvm-8.0.0 installed in my system at LLVM_PATH.
I downloaded openmp-8.0.0 source from the llvm download page. To build
openmp I used the following command:

$ mkdir build && cd build
> $ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$LLVM_PATH
>  -DCMAKE_C_COMPILER=$LLVM_PATH/bin/clang -DCMAKE_CXX_COMPILER= $LLVM_PATH/bin/clang++
> -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=35,60,70 ..
> $ make && make install
> $


OpenMP got built without giving any error. But when trying to use target
offloading with OpenMP I get the above mentioned fatal error. I tried this
on 3 different machines, with same result.

--
Thank You.
Regards,
Alok
*'FOR THE GREATER GOOD'*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20190620/d1e9184b/attachment.html>


More information about the Openmp-dev mailing list