2014-04-03 21:06 GMT+04:00 Bernd Schmidt <ber...@codesourcery.com>: > On 04/03/2014 06:53 PM, Ilya Verbin wrote: >> >> 2014-04-03 20:13 GMT+04:00 Bernd Schmidt <ber...@codesourcery.com>: >>> >>> The patch below should be a better fix, making the references to > >>> __OPENMP_TARGET__ weak. Does this work for you? >> >> >> Shouldn't we just remove __OPENMP_TARGET__ argument from GOMP_target, >> since we decided to pass it to GOMP_offload_register? > > > I thought it was used to look up the right function? With shared libraries > you'd get multiple __OPENMP_TARGET__ tables. > > > Bernd >
Yes, initially the idea was to use it for look up the right function. But now each DSO will call GOMP_offload_register, and pass unique pointer to __OPENMP_TARGET__ (host_table) for this DSO. Then gomp_register_images_for_device registers all this host tables in the plugin. And when libgomp calls device_get_table_func, the plugin returns the joint table for all DSO's. -- Ilya