On 09/08/2013 01:28 AM, Kalle Raiskila wrote:
> The confusion here arises from the device types where target==host,
> i.e. the basic and pthreads devices. For these two, we probably should
> use the HOST settings, unless we want to change calling conventions,
> ABIs, or something in the kernels. Which we might want to do if we can
> get some benefit out of it. Or perhaps when using SPIR.

Yes, basic and pthreads are based on the assumption that they run on the
same CPU as the host. I think this was decided during the previous rework of
"the mess".

Even if we used the SPIR target for the kernel bitcodes produced from Clang
(e.g. to unify the argument passing to fix the scalar passing issues),
the final code gen from those should still be done using the correct target 
flags.

> In the case of a heterogenous setup, the device driver should set all
> the necessary TARGET flags, parts of this happens in configure.ac.

Right. TCE device drivers do this already. The next heterogeneous
in-tree device driver is probably for NVIDIA GPUs via the Colberg's libcuda
work. We'll see what type of target flags it needs for llc.

> Currently, there is an implicit assumption, that any given pocl
> installation has maximally one heterogenous target device. Which
> assumption probably has left a few undocumented short-cuts in the
> usage of TARGET flags at some places.

There are currently two heterogeneous device drivers in tree: TCE
and CellSPU. TCE should not use TARGET flags for anything, IIRC. So
even if CellSPU does, they should work in parallel.

> Yeah, its a mess :)

Perhaps restoring the "traditional" meaning of TARGET to mean the
cross-compilation target when doing cross-compilation of pocl
could help.

Then basic and pthread should adhere to those flags, and for each
(heterogeneous) device type we would detect the correct target flags
separately with their separate variables.

-- 
--Pekka


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to