[Openmp-dev] Test with clang offloading to GPU

Talita Perciano via Openmp-dev openmp-dev at lists.llvm.org
Wed Oct 16 15:24:13 PDT 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20191016/af2b6d64/attachment.html>


More information about the Openmp-dev mailing list