Friday, March 8, 2013

OpenCL Helloworld program on Nexus 4 device

After getting the CLInfo for Nexus Devices, I tried to map all OpenCL symbols for writing full fledged OpenCL applications on Nexu 4 devices.

As part of this exercise, created mappings to all OpenCL exported functions and wrote one helloword example. With this mapping it is fully possible to write any OpenCL 1.1 specification based programs on C/C++ on Nexus-4 phones.

Code is hosted at aopencl project .

For a change this time used program to create command line executable at Nexus 4 phone. So to execute, one needs Android-NDK needs to be installed along with Android-SDK. More instructions are in README.

BTW, output from the Devices comes likes this:


shell@android:/data/local/tmp $ ./helloworld                                   
Loaded library name:/system/lib/libOpenCL.so
input string: GdkknVnqkc
output string: HelloWorld
shell@android:/data/local/tmp $


As we can see from output, .so file mapped is: /system/lib/libOpenCL.so


No comments:

Post a Comment