On Fri, Jan 23, 2015 at 08:20:53PM +0300, Ilya Verbin wrote: > On 17 Jan 02:16, Ilya Verbin wrote: > > Hi! > > > > Unfortunately, it broke offloading from shared libraries (I mean common libs > > with NEEDED entries, not dlopened). Such things are not covered by the > > testsuite, that's why you missed this issue. Here is a simple testcase: > > ... > > So, you don't assume that a device can have multiple images from multiple > > libs? > > Ping? > > Also, could you please explain, why did you divide a device initialization > into > two functions -- gomp_init_device and gomp_init_tables? > > Currently I'm trying to rebase on trunk my old patch, which fixes offloading > from dlopened libraries: > http://gcc.gnu.org/ml/gcc-patches/2014-11/msg01604.html > It works for OpenMP and MIC, but I don't know how not to break OpenACC and > PTX.
There is also the problem that GOMP_offload_register doesn't use any locking, so one thread could be in the middle of dlopening some shared library and doing GOMP_offload_register in there, and another thread calling gomp_target_init at the same time, so you could reference freed memory if GOMP_offload_register had to reallocate etc. Jakub