- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I have some pointers to double and some constant values inside a function.
I am using a "#pragma omp target map(tofrom: everypointer[0:size of its corresponding array] ..." to transfer those data to MIC.
The amount of data is not large.(1 MB)
Running the code, I have the following error:
offload error: buffer write failed (error code 6)
Any idea?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Guidance from others was one possible guess is the constants and perhaps them being transferred with the default tofrom and thus attempting to write into read-only host memory for the constant. If you are using a constant inside the offload region then make sure you add it to the clause as map(to…) to override the tofrom default.
If that is not applicable or does not help, then please provide more actual source context. It is best if you can provide a reproducer that we can investigate with ourselves.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much Kevin,
I tryied the map(to...), but it didn't work.
Myfunction() is a function in a library.h which includes some constants and pointers too. It looks like the following:
void Myfunction(const double reZ, double *fpResult, double *fpVector1)
{
some other constants; e.g. const int iM, iNx;
some other pointers to double; e.g. double *fpV;
#pragma omp target map(to: reZ, iNx, fpV[0:iM*4], fpVector1[0:iM*4]) map(tofrom: fpResult[0:4*iM])
{
...
}
}
The function is called many times inside the library.h.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Kevin,
The issue was pointer fpVector1. It is a null pointer for some calls inside the library.h.
I made 2 pragmas:
if (fpVector1!=0) #pragma omp target map(to: reZ, iNx, fpV[0:iM*4], fpVector1[0:iM*4]) map(tofrom: fpResult[0:4*iM])
{...}
else #pragma omp target map(to: reZ, iNx, fpV[0:iM*4]) map(tofrom: fpResult[0:4*iM])
{...}
and the problem was solved.
All the best

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page