Hi Alun Evans,

The status of the "standalone mode" is, unfortunately, still
the same what it was about a year ago:
http://sourceforge.net/p/pocl/mailman/message/29943341/

Thus, the pocl host library implementations are not yet easily
compilable to a "standalone (compilerless or even OSless) host" library.
The experimental code in TCE has some simple host API stubs for the test
cases we used when prototyping/benchmarking OpenCL kernels in this
mode. In our scenario we didn't even have a filesystem in the host so we
just assumed all kernels are linked to the host binary and registered in
such a way that the host program finds the kernels through the normal
OpenCL APIs.

Anyways, I do not think it would be too much work to go properly through
the route which you apparently started: compile as much of the host
library as is feasible (and possible, without assuming OS support and/or
compiler support) to the target, and then link the kernel(s) with
the host binary, with some glue to register the kernels to the host
program. It needs some macro in the pocl build, e.g., POCL_STANDALONE_BUILD,
which, when defined, drops/shortcuts some APIs (such as the kernel compiler
invocation code).

You might want to check the tcecc implementation of that as described in
the above older mail. It would be great if someone worked on improving
this as it is handy to support OpenCL on embedded standalone targets.
I can give more advice if you decide to go on with that.

On 07/25/2013 08:43 PM, Alun Evans wrote:
> I was trying to go down this route, but as I cross-compiled pocl, I
> get this final link error:
>
>    cannot find -lLLVM-3.1
>
> - of course, I guess I thought that in standalone mode no llvm would
> be needed on the embedded device, as all the cross-compilation of the
> OpenCL application, as well as the OpenCL kernel takes place on the
> build server, rather than the host?

Yes. The host should be able to cross compile the whole OpenCL
app (host program + kernel(s)) and link the bitcode and somehow
register the kernels to the host program. If you have filesystem
support you can use the binary interface to avoid this. But the
whole point of the standalone mode is to avoid the need for compiler/OS
in the target.

What's in pocl is the pocl-standalone script that builds the kernels
"offline" to a bitcode. The rest is currently missing from the pocl
source tree. TCE has the prototype/"proof of concept" work to make
it work for OSless standalone TTAs which can be used for ideas at
least.

> btw, I also got an error for not being able to find -lffi, I wonder if
> there should be an AC check for it ?

I'm not aware of this. Maybe it's pulled from LLVM deps?

BR,
-- 
--Pekka


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to