On Tue, Sep 10, 2013 at 07:30:53PM +0400, Michael V. Zolotukhin wrote: > > > 4) We'll need to store some information about available devices: > > > - a search tree with data about mapping > > > > For the search tree, I was going to actually implement it myself, but got > > interrupted this week with work on UDRs again. I wanted to write just > > temporarily a dummy device that would execute on the host, but remap all > > memory to something allocated elsewhere in the same address space by malloc. > > Sure, #pragma omp declare target vars wouldn't work that way, but otherwise > > it could work fine. Each device that would have a flag set that it doesn't > > have shared address space between host and device (I belive HSAIL might have > > shared address space, host fallback of course has shared address space, > > the rest do not?) would have its own splay tree plus some host mutex to > > guard accesses to the tree. > Ok. Do you need all plugin infrastructure ready for that or you could > experiment with dummy device without plugins?
I don't need that infrastructure for that, I meant just a hack that say for OMP_DEFAULT_DEVICE=257 I'd use this hackish device, and store the splay tree root and lock in a global var with a comment that that in the future will belong into the per-device structure. Jakub