Compilation error with adreno 650 on android

Hi,

I try to use qualcomm GPU with OpenCL with Android, i get an adreno 650.
But i cannot compile my source code. It was working rigth when i used ARM Mali GPU but not with Adreno GPU.

My android.mk file

include $(CLEAR_VARS)
LOCAL_MODULE := GLES_android
LOCAL_SRC_FILES := $(LOCAL_PATH)/arm7/libGLES_android.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := OpenCL
LOCAL_SRC_FILES := $(LOCAL_PATH)/arm7/libOpenCL.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := JNIProcessor2.0-client
LOCAL_SRC_FILES := processor.cpp
# -std=gnu++11 est utilisé pour OpenCV4
#LOCAL_CPPFLAGS	+= -O3 -I$(LOCAL_PATH)/CL -std=gnu++11 -fexceptions
LOCAL_CPPFLAGS	+= -O3 -std=gnu++11 -fexceptions
# jnigraphics est la library graphique d'Android NDK
LOCAL_LDLIBS    += -ljnigraphics -llog -ldl
LOCAL_SHARED_LIBRARIES := GLES_android
include $(BUILD_SHARED_LIBRARY)

file are retreived from the phone.

I got Two CL directory with different file.

When i compile with one of the CL2 directorie i got error on all the functions.

an example of the error

C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp:276: error: undefined reference to 'clRetainProgram'
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp:278: error: undefined reference to 'clGetProgramInfo'
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp:280: error: undefined reference to 'clGetProgramBuildInfo'
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp:281: error: undefined reference to 'clReleaseProgram'
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl2.hpp:1605: error: undefined reference to 'clGetPlatformInfo'
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl2.hpp:1608: error: undefined reference to 'clGetPlatformInfo'
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl2.hpp:1488: error: undefined reference to 'clReleaseDevice'

when i compile with the other CL directorie a got other error but none for the cl***** function.

In file included from C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp:29:0:
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp: In function 'cl_int cl::UnloadCompiler()':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:1493:14: warning: 'cl_int clUnloadCompiler()' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1752) [-Wdeprecated-declarations]
     return ::clUnloadCompiler();
              ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:1493:31: warning: 'cl_int clUnloadCompiler()' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1752) [-Wdeprecated-declarations]
     return ::clUnloadCompiler();
                               ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp: In constructor 'cl::Image2D::Image2D(const cl::Context&, cl_mem_flags, cl::ImageFormat, size_t, size_t, size_t, void*, cl_int*)':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:2137:21: warning: '_cl_mem* clCreateImage2D(cl_context, cl_mem_flags, const cl_image_format*, size_t, size_t, size_t, void*, cl_int*)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1718) [-Wdeprecated-declarations]
         object_ = ::clCreateImage2D(
                     ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:2138:81: warning: '_cl_mem* clCreateImage2D(cl_context, cl_mem_flags, const cl_image_format*, size_t, size_t, size_t, void*, cl_int*)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1718) [-Wdeprecated-declarations]
             context(), flags,&format, width, height, row_pitch, host_ptr, &error);
                                                                                 ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp: In constructor 'cl::Image3D::Image3D(const cl::Context&, cl_mem_flags, cl::ImageFormat, size_t, size_t, size_t, size_t, size_t, void*, cl_int*)':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:2237:21: warning: '_cl_mem* clCreateImage3D(cl_context, cl_mem_flags, const cl_image_format*, size_t, size_t, size_t, size_t, size_t, void*, cl_int*)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1728) [-Wdeprecated-declarations]
         object_ = ::clCreateImage3D(
                     ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:2239:42: warning: '_cl_mem* clCreateImage3D(cl_context, cl_mem_flags, const cl_image_format*, size_t, size_t, size_t, size_t, size_t, void*, cl_int*)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1728) [-Wdeprecated-declarations]
             slice_pitch, host_ptr, &error);
                                          ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp: In constructor 'cl::Sampler::Sampler(const cl::Context&, cl_bool, cl_addressing_mode, cl_filter_mode, cl_int*)':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:2335:21: warning: '_cl_sampler* clCreateSampler(cl_context, cl_bool, cl_addressing_mode, cl_filter_mode, cl_int*)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1765) [-Wdeprecated-declarations]
         object_ = ::clCreateSampler(
                     ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:2340:19: warning: '_cl_sampler* clCreateSampler(cl_context, cl_bool, cl_addressing_mode, cl_filter_mode, cl_int*)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1765) [-Wdeprecated-declarations]
             &error);
                   ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp: In constructor 'cl::CommandQueue::CommandQueue(const cl::Context&, const cl::Device&, cl_command_queue_properties, cl_int*)':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:2791:21: warning: '_cl_command_queue* clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1759) [-Wdeprecated-declarations]
         object_ = ::clCreateCommandQueue(
                     ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:2792:52: warning: '_cl_command_queue* clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1759) [-Wdeprecated-declarations]
             context(), device(), properties, &error);
                                                    ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp: In member function 'cl_int cl::CommandQueue::enqueueTask(const cl::Kernel&, const std::vector<cl::Event>*, cl::Event*) const':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:3271:15: warning: 'cl_int clEnqueueTask(cl_command_queue, cl_kernel, cl_uint, _cl_event* const*, _cl_event**)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1772) [-Wdeprecated-declarations]
             ::clEnqueueTask(
               ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:3275:46: warning: 'cl_int clEnqueueTask(cl_command_queue, cl_kernel, cl_uint, _cl_event* const*, _cl_event**)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1772) [-Wdeprecated-declarations]
                 (event != NULL) ? &tmp : NULL),
                                              ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp: In member function 'cl_int cl::CommandQueue::enqueueMarker(cl::Event*) const':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:3323:15: warning: 'cl_int clEnqueueMarker(cl_command_queue, _cl_event**)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1740) [-Wdeprecated-declarations]
             ::clEnqueueMarker(object_, (cl_event*) event),
               ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:3323:57: warning: 'cl_int clEnqueueMarker(cl_command_queue, _cl_event**)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1740) [-Wdeprecated-declarations]
             ::clEnqueueMarker(object_, (cl_event*) event),
                                                         ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp: In member function 'cl_int cl::CommandQueue::enqueueWaitForEvents(const std::vector<cl::Event>&) const':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:3330:15: warning: 'cl_int clEnqueueWaitForEvents(cl_command_queue, cl_uint, _cl_event* const*)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1744) [-Wdeprecated-declarations]
             ::clEnqueueWaitForEvents(
               ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:3333:50: warning: 'cl_int clEnqueueWaitForEvents(cl_command_queue, cl_uint, _cl_event* const*)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1744) [-Wdeprecated-declarations]
                 (const cl_event*) &events.front()),
                                                  ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp: In member function 'cl_int cl::CommandQueue::enqueueBarrier() const':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:3445:15: warning: 'cl_int clEnqueueBarrier(cl_command_queue)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1749) [-Wdeprecated-declarations]
             ::clEnqueueBarrier(object_),
               ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL cl.hpp/cl.hpp:3445:39: warning: 'cl_int clEnqueueBarrier(cl_command_queue)' is deprecated (declared at C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/CL/cl.h:1749) [-Wdeprecated-declarations]
             ::clEnqueueBarrier(object_),
                                       ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp: In function 'jboolean Java_com_example_LiveFeatureActivity_compileKernels(JNIEnv*, jclass)':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp:602:16: error: 'Error' in namespace 'cl' does not name a type
     catch (cl::Error e) {
                ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp:603:46: error: 'e' was not declared in this scope
         if( !throwJavaException(env,"decode",e.what(),e.err()) )
                                              ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp: In function 'void helper(uint32_t*, int, uint8_t*, int, int, int, int, int, uint32_t*)':
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp:1702:16: error: 'Error' in namespace 'cl' does not name a type
     catch (cl::Error e) {
                ^
In file included from C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp:39:0:
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.cpp:1703:38: error: 'e' was not declared in this scope
         LOGI("@oclDecoder: %s %d \n",e.what(),e.err());
                                      ^
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master/app/src/main/jni/processor.h:9:74: note: in definition of macro 'LOGI'
 #define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, app_name, __VA_ARGS__))

It look like everything a comming from my CL directorie rather then the “.so” library.

Does anyone got the correct CL 2.0 files for adreno 650.

Thanks in advance.

New information.

i found out that the libOpenCL.so from my phone give anather name to the CL** function
“qCLDrvAPI_clReleaseProgram” so it could be possible that i would need special INCLUDE/CL from qualcomm or from xiaomi ?

than for your advise ;))

Hi,
In fact i think that the libOpenCL.so and libGLES_android.so from xiaomi phonne are wrong.

where could i find it. I try in quolcomm developer but i do not find anything.

So the réal question it is possible to develope under xiaomi MI10 T PRO or not ? ;)) ;))

i found the compilation problem.

if i add OpenCL to LOCAL_SHARED_LIBRARIES it works

“LOCAL_SHARED_LIBRARIES := GLES_android OpenCL”

;))