https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120835

Benjamin Schulz <schulz.benjamin at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #61721|0                           |1
        is obsolete|                            |

--- Comment #10 from Benjamin Schulz <schulz.benjamin at googlemail dot com> ---
Created attachment 61728
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61728&action=edit
openmp library

one may argue that the last code was not entirely clean.
It had offloaded a matrix with data, spans and extents,

then created a sub matrix on the host, and then gave this sub matrix to a omp
target loop. The spans and extents were passed to the omp target loop as
integers, which should be implicitely mapped. the struct of the submatrix
should also have been implicitely mapped, I guess, and the data field of the
struct was already mapped when we offloaded the larger matrix. 

In order to be entirely clean, 

I have now written a better version of the openmp library. 

I now also call the mapping macros explicitely for the sub matrix before the
omp target loop. And I also release the entire struct after the sub matrix was
used.. The process of uploading, allocating and releasing maps the struct, and
the arrays, so should be OK.



Unfortunately, the problem remains. 


Once I use -O1, the results become crazy while without optimization, the output
is correct.

That looks and smells and is a compiler problem.

Reply via email to