This patch extends the libomptarget functionality in patch D14254 with support for the data sharing scheme for supporting implicitly shared variables. The runtime therefore maintains a list of references to shared variables.
Great! Let's use yours then and I can change the order of the args in this patch. Can you make sure you push the other patch and then once this one lands it should all work.
Actually, all of these extern declarations should go away because they already exist in omptarget-nvptx.h! We don't need to reiterate them here...
I still think this won't work: If there are multiple translation units with target regions, the linker should complain about duplicate symbol definitions... I think that's why there is a separate file omp_data.cu.
(obviously only when building and using the bclib which we don't yet have in trunk; but I think we shouldn't introduce the problem if we can easily avoid it)