This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: OMP. More constification


On 07/27/15 04:23, Jakub Jelinek wrote:
On Sun, Jul 26, 2015 at 11:01:09AM -0400, Nathan Sidwell wrote:
I found some more missing consts.  The size, kind, var and function arrays
emitted by omp-low are read only, but are not so marked.  This patch

First of all, the hostaddrs array is going to be written by the library
side for GOMP_MAP_FIRSTPRIVATE, so can't be const and shouldn't be const on
the compiler emitted side either.  Similarly for the use_device_ptr clause
on GOMP_target_data* handling.
The size array is const from the library side, sure, but on the compiler
side is only conditionally static (static only if all the values written to
it are INTEGER_CSTs), so not sure if we want to make it use const qualified
type unconditionally, rather than only change it to the const qualified type
if it is TREE_STATIC at the end.
The kinds array I'm afraid might very well soon follow the size array model.

Ok, thanks for the explanation. I'm puzzled though about writing the sizes and kinds arrays. They're global object, so that doesn't seem thread-safe? Or is it ill-formed to have multiple host threads execute the same potentially offloaded function concurrently?

nathan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]