[Openmp-dev] Test with clang offloading to GPU

Alexey Bataev via Openmp-dev openmp-dev at lists.llvm.org
Wed Oct 16 15:31:29 PDT 2019


Seems to me, you want to map arrays but instead you're mapping pointers. Try something like this:

map(to:inputData[0:10]) map(from:outputData[0:10])



Best regards,
Alexey Bataev

> 16 окт. 2019 г., в 18:24, Talita Perciano via Openmp-dev <openmp-dev at lists.llvm.org> написал(а):
> 
> 
> Hi,
> 
> I'm trying to run some examples using OpenMP offloading to GPU, and I'm having some issues. See this function below:
> 
> void doWork(const double *inputData, // the input data
>                      double *outputData) //  where computation goes
> {
> #pragma omp target data map(inputData) map(outputData)
> {
> #pragma omp target teams distribute parallel for
>     for (int j=0; j<10; j++)
>     {
>         for (int i=0; i< 10; i++)
>         {
>            outputData[indx] = inputData[indx];
>         }
>     }
> }
> }
> 
> When I try to run this code, I get something like this:
> 
> Libomptarget fatal error 1: failure of target construct while offloading is mandatory
> 
> This is probably something stupid, sorry about that. It seems that the problem is that the data from inputData is not mapped to the device. Could you please help me with that?
> 
> Thanks,
> Talita
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev


More information about the Openmp-dev mailing list