Den Sun, 8 Sep 2013 14:15:54 -0400
skrev Re: [pocl-devel] Triples, targets, cpus, and features... and HOST
vs. TARGET:

> On 2013-09-08, at 14:02 , Kalle Raiskila <[email protected]> wrote:
> 
> > Den Sun, 08 Sep 2013 12:20:18 +0300
> > skrev Re: [pocl-devel] Triples, targets, cpus, and features... and
> > HOST vs. TARGET:
> > 
> >> If you think of binary distributions of pocl

> > How about the runtime kernel library, then? There is some "#ifdef
> > SSE"-like stuff there already, and we compile this into .bc before
> > we know the the exact processor that we are going to run on.
> 
> 
> These #ifdefs are set by the compiler, depending on the options that
> one passes to the compiler. They do not depend on the host, but on
> the target. In other words, we're good here.

But in the context of binary distributions, the kernel library is
compiled before we know what the exact flavour of the target CPU is.

> 
> However, if the
> target is the host, then we simply re-use the information we
> gathered. This allows e.g. detecting AVX, SSE, hardware
> floating-point etc. automatically, without having to detect this at
> run time.

Thinking of this... I have nowhere ever specified the type of my CPU to
my OS in any greater detail than "x86_64". Clearly there exist some
"autodetection magic" *somewhere*. Perhaps we can reutilize that code
in runtime detection of the platform. 

Falling back to "host" should always be safe, but when pocl is gotten
from a distro, that CPU might be quite old. This problem would not
exist when pocl is compiled from sources, as the compiler/OS would then
have detected (hopefully) the exact CPU version that is the "host".


> This needs to be detected before the kernel library is built, i.e. at
> the time pocl is configured and built. Bytecode is not generic enough
> to handle different architectures; e.g. type widths, calling
> conventions, and name mangling depend on the target, and these are
> present in bytecode already.

Separate architectures would certainly require separate kernel
libraries. But can we keep the fine-tuning withing one architecture
(e.g. the SSE version) generic within the kernel lib?

If not, we need one kernel per x86 generation and ARM version. 
Or we need to accept a performance hit in the binary distributed
library.


kalle


------------------------------------------------------------------------------
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