Forums - use cl_mem_ext_host_ptr extension always failed!

2 posts / 0 new
Last post
use cl_mem_ext_host_ptr extension always failed!
zhuyang50
Join Date: 8 Sep 15
Posts: 1
Posted: Thu, 2015-10-15 23:33

Hi,

    I use Opencl to do some calculation using adren330, the data input is a Android Graphic Buffer. The performance requirement is critical, so I don't want openCL spend time to copy data from host to device. I've done some research, and it seems that using cl_mem_ext_host_ptr extension may solve my problem. I mainly reference this site https://www.khronos.org/registry/cl/extensions/qcom/cl_qcom_android_native_buffer_host_ptr.txt

 

   My problem is,to be specific, now I use clCreateImage2D using ANativeWindowBuffer, however, it always return -30(CL_INVALID_VALUE). My code is like:

 

    sp<GraphicBuffer> gb;
    cl_mem_android_native_buffer_host_ptr  myANBmem = {0};
    --snip--
    myANBmem.ext_host_ptr.allocation_type    = CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM;
    myANBmem.ext_host_ptr.host_cache_policy  = CL_MEM_HOST_WRITEBACK_QCOM;
    myANBmem.anb_ptr = gb->getNativeBuffer();
    buffer = clCreateImage2D(mContext,
                                CL_MEM_USE_HOST_PTR|CL_MEM_EXT_HOST_PTR_QCOM,
                                &clImageFormat,
                                width,
                                height,
                                pitch,
                                &myANBmem,
                                &errNum);
        if (errNum != CL_SUCCESS)
        {
            LOGE("Error creating CL image object errNum=%d",errNum);
            return UNKNOWN_ERROR;
        }
 
       Can someone give me some hints or suggestions? Or is there sample code for reference?
       Thanks a lot!

 

  • Up0
  • Down0
itzik
Join Date: 23 Jul 13
Posts: 1
Posted: Thu, 2016-07-07 04:35

Encountered the exact same problem.

Can't seem to find information about the issue anywhere.

Android logs aren't helpful as well.

Any pointers are welcome.

 

Thanks.

Open CL Platform info:

PLATFORM:
Vendor:"QUALCOMM",
Name:"QUALCOMM Snapdragon(TM)",
Version:"OpenCL 1.2 QUALCOMM build: commit #93dd636 changeid #I2d06cc9496 Date: 09/30/15 Wed Local Branch:  Remote Branch: ",
Profile:"FULL_PROFILE".
DEVICE:
Vendor:"QUALCOMM",
Name:"QUALCOMM Adreno(TM)",
Version:"OpenCL 1.2 Adreno(TM) 430",
Driver Version:"OpenCL 1.2 QUALCOMM build: commit #93dd636 changeid #I2d06cc9496 Date: 09/30/15 Wed Local Branch:  Remote Branch:  Compiler E031.25.03.09",
Profile:"FULL_PROFILE".
DEVICE extensions:
cl_img_egl_image cl_khr_byte_addressable_store cl_khr_egl_event cl_khr_egl_image cl_khr_fp16 cl_khr_gl_sharing cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_i
nt32_base_atomics cl_khr_local_int32_extended_atomics cl_qcom_android_native_buffer_host_ptr cl_qcom_create_buffer_from_image cl_qcom_ext_host_ptr cl_qcom_ion_host_ptr cl_qcom_perf_hint

 

  • 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.