This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 0/2] Offloading from dlopened libraries
- From: Ilya Verbin <iverbin at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Thomas Schwinge <thomas at codesourcery dot com>, Julian Brown <julian at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 Nov 2014 02:53:54 +0300
- Subject: [PATCH 0/2] Offloading from dlopened libraries
- Authentication-results: sourceware.org; auth=none
Hi,
This patch fixes offloading from dlopened libraries, part 1 is for libgomp and
part 2 is for intelmic plugin (it's not finished yet).
How it works:
When a library is loaded it calls GOMP_offload_register as usually.
At this time some devices may already be initialized, and some may be not.
Therefore libgomp goes through all devices and for the initialized devices calls
GOMP_OFFLOAD_load_image, then receives corresponding addresses and inserts them
into splay tree. Also it fills offload_images array for lazy Initialization.
When the library is unloaded it calls GOMP_offload_unregister.
This function also need to go through all devices and to call
GOMP_OFFLOAD_unload_image for all initialized devices. Also it removes mapped
addresses from corresponding splay trees and pending images from the array.
Any thoughts on that?
Thomas, Julian,
Will this approach work for OpenACC+PTX? I hope that it is general enough.
Yeah, I understand that this change will require some efforts on your part to
rebase the patches, but it would be good to define a common libgomp<->plugin
interface as early as possible.
Thanks,
-- Ilya