It calls for an announcement. Pocl (POrtable Computing Language) has been ported to android
Pocl is an opensource implementation of OpenCL 1.2 spec. It supports a range of cpu devices & custom processors. Now it runs on android ARMv7 cpus too
First things first
Get pocl from playstore play.google.com/store/apps/details?id=org.pocl.libs Open this app once. It will install pocl files at a predefined place
For a sanity check, run this pocl vector-addition sample play.google.com/store/apps/details?id=org.pocl.sample1
Features:
1. OpenCL 1.2 spec implementation
2. Provides a cpu device which uses pthread to utilise multi-core cpu
3. Zero-copy buffers when allocated with CL_MEM_USE_HOST_PTR flag
4. Programs & kernels are cached in application's cache directory at first run. Although initial launch will be slow, subsequent launches will be much much faster
5. Basic support for spir. Pocl now loads SPIR binaries via the clCreateProgramWithBinary. Even final binaries of spir will be cached at first run
6. Horizontal auto-vectorization of work-groups (experimental)
This is in beta stage and only android 4.2 and above is supported for now
For Application developers:
There is no java wrapper as such, applications have to use jni. Since pocl is installed in a non-standard path, dynamic linking is not possible. App has to dlopen "/data/data/org.pocl.libs/files/lib/libpocl.so" and dlsym function symbols from it
All this dirty work is compiled inside a stub opencl library github.com/krrishnarraj/libopencl-stub It provides all standard definitions of opencl. Internally it searches for installed opencl libraries including pocl and dlopens it. This default behavior can be over-ridden by defining environment variable LIBOPENCL_SO_PATH to the intended platform shared-object, in this case "/data/data/org.pocl.libs/files/lib/libpocl.so". Applications just have to statically link to this library or include its source (libopencl.c) directly with other jni sources
Refer this simple vector-addition sample that uses pocl https://github.com/pocl/pocl/tree/master/examples/pocl-android-sample &  jni/Android.mk. Environment variable LIBOPENCL_SO_PATH is programatically set using jni native function
clpeak has support for pocl. Run it to check performance of pocl and other platforms. First run will always  be slower. You can expect consistent results from second run
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality✓ Free Actions
Free to watch • No registration required • HD streaming
Thrilled! After a long time - and much much work by curros and others ICD support has landed for Mesa's clover OpenCL state tracker. This will allow us to install Mesa as an opencl provider in parallel to others (which support OpenCL ICD) - like pocl.
I purchased this samsung chromebook thinking that I can work on the first arm opencl capable Mali gpu. Much to my sorrow, there are no gpu drivers for linux yet. They provided only android opencl drivers for arndale board. So wont this android driver work on linux if android is nothing but linux?? NO. Android uses a different libc library called bionic. All these drivers are compiled for bionic and not libc!!
Anyways this chromebook has an ARM cortex A15 cpu which is more than enough to explore. pocl is the most popular opensource opencl implementation which works on all kinds of cpu x86, x64, arm and many more. It heavily uses clang and llvm.
1. pull pocl from github. It depends on libhwloc. Download or build it from source. Set these flags
Currently cl.hpp.in requires a patch to work on arm
Copy cl.hpp.in to cl.hpp in include/CL.
Update:
Latest pocl has necessary patches https://github.com/pocl/pocl/blob/master/tools/patches/khronos_cl.hpp.patch for cl.hpp to work on arm/android
Add --enable-install-opencl-headers option to configure script that will also install opencl headers. Rest all are straight forward.
Now you need an icd loader. A tgz source of icd loader is available at http://www.khronos.org/registry/cl/ Install cmake and copy CL folder from pocl include to icd/inc. A make will generate libOpenCL.so in bin/ . copy it to /usr/lib/ . You are ready with an opencl platform
clinfo is a very handy utility. A good one can be found at https://github.com/Oblomov/clinfo
2. Next platform that I tried was coprthr from browndeer technology. Quite unpopular though. Code can be found at https://github.com/browndeer/coprthr . It depends on libelf, libconfig and libevent. Download or build it from source. Rest should be fine
Now I need to benchmark these platforms for opencl
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality✓ Free Actions
Free to watch • No registration required • HD streaming
There is no official release from pocl yet, but I noticed that there is now some work going on to bring ICD to pocl. Very nice.
This will allow us to have more than one open CL implementation on our systems - as long as all of them honor ICD.