[Openmp-dev] Test with clang offloading to GPU

Talita Perciano via Openmp-dev openmp-dev at lists.llvm.org
Thu Oct 17 07:29:06 PDT 2019


Hi Alexey,

Thanks for the reply. I was wondering, what if I have something like this:

void doWork(const double *inputData, // the input data
                     double *outputData,
                     int *start[3])
...

How would I map start? Is there a way?

Thanks,
Talita

On Wed, Oct 16, 2019 at 3:31 PM Alexey Bataev <a.bataev at hotmail.com> wrote:

> 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
>


-- 
Dr. Talita Perciano
Research Scientist - CRD, Lawrence Berkeley National Laboratory
Data Analytics & Visualization Group
Computational Biosciences Group
Center for Advanced Mathematics for Energy Research Applications
One Cyclotron Road
Berkeley, CA 94720
059-3034B  M/S 59R3103
Work: (510) 486-5060
tperciano at lbl.gov
http://tperciano.wixsite.com/home
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20191017/820cfe11/attachment.html>


More information about the Openmp-dev mailing list