Forums - Sample OpenCL in c++

2 posts / 0 new
Last post
Sample OpenCL in c++
xavier12358
Join Date: 11 Dec 16
Posts: 20
Posted: Tue, 2017-02-21 06:41

Hello,

I want to use my OpenCL lib to process image on my moto Z. I get the so file of the library and now I would like to use it in my project in Android Studio.

I am not able to find a example of OpenCL process in Android Studio in c++.

Where could I get a sample example?

Edit:  I looked at the adreno SDK for linux, I notice that there are no OpenCL headers folder and no example contrary to the sdk on Mac.

Why that difference?

I try to build a project from that page:

http://arrayfire.com/getting-started-with-opencl-on-android/

The compilation works with nkd10e but when I run on my moto Z  I get that error:

2-22 10:00:41.077  7302  7302 D AndroidRuntime: Shutting down VM
02-22 10:00:41.078  7302  7302 E AndroidRuntime: FATAL EXCEPTION: main
02-22 10:00:41.078  7302  7302 E AndroidRuntime: Process: com.example.subsamplecamera, PID: 7302
02-22 10:00:41.078  7302  7302 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libGLES_mali.so" not found
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at java.lang.Runtime.loadLibrary0(Runtime.java:977)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at java.lang.System.loadLibrary(System.java:1530)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at com.example.subsamplecamera.MainActivity.<clinit>(MainActivity.java:30)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at java.lang.Class.newInstance(Native Method)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.Instrumentation.newActivity(Instrumentation.java:1100)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2551)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.ActivityThread.-wrap12(ActivityThread.java)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:154)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6123)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.ru

Why the program try to find the libGLES_mali.so?

 

  • Up0
  • Down0
xavier12358
Join Date: 11 Dec 16
Posts: 20
Posted: Wed, 2017-02-22 01:42

I just try to use that page to link OpenCL:

http://arrayfire.com/getting-started-with-opencl-on-android/

But as soon as I link the libOpenCL.so on my project I get that:

02-22 10:00:41.077  7302  7302 D AndroidRuntime: Shutting down VM
02-22 10:00:41.078  7302  7302 E AndroidRuntime: FATAL EXCEPTION: main
02-22 10:00:41.078  7302  7302 E AndroidRuntime: Process: com.example.subsamplecamera, PID: 7302
02-22 10:00:41.078  7302  7302 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libGLES_mali.so" not found
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at java.lang.Runtime.loadLibrary0(Runtime.java:977)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at java.lang.System.loadLibrary(System.java:1530)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at com.example.subsamplecamera.MainActivity.<clinit>(MainActivity.java:30)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at java.lang.Class.newInstance(Native Method)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.Instrumentation.newActivity(Instrumentation.java:1100)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2551)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.ActivityThread.-wrap12(ActivityThread.java)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:154)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6123)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
02-22 10:00:41.078  7302  7302 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.ru

 

But I don't have mali chipset, why my project try to call that?

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.