Forums - OpenCL extension support.

4 posts / 0 new
Last post
OpenCL extension support.
meekee7
Join Date: 21 May 15
Posts: 1
Posted: Thu, 2015-05-21 15:27

Hello,

I need a list of the OpenCL extensions supported by Adreno GPUs. The best information I could find is here: https://developer.qualcomm.com/comment/6121#comment-6121

That information is a bit old, is that list still correct or have some new extensions been added, such as cl_khr_egl_image?

Thanks.

  • Up0
  • Down0
Ayo Moderator
Profile picture
Join Date: 23 Jan 15
Posts: 31
Posted: Thu, 2015-05-21 16:15

Download the Adreno SDK

https://developer.qualcomm.com/mobile-development/maximize-hardware/mobi...

Install the SDK

Browse to <AdrenoSDK>\Docs

The extensions are documented in 80-N8592-1_L_OpenCL_Programming_Guide.pdf  starting on page 9

  • Up0
  • Down0
meekee7
Join Date: 21 May 15
Posts: 1
Posted: Fri, 2015-05-22 04:51

That document did indeed answer my question, thanks.

But it is a little ambiguous about cl_khr_egl_image. That extension is not in the list on pages 9 and 10, but page 18 heavily implies that it is supported. So is it?

  • Up0
  • Down0
Ayo Moderator
Profile picture
Join Date: 23 Jan 15
Posts: 31
Posted: Fri, 2015-05-22 10:01

Yes it is.

I wrote an OpenCL demo sometime last year and one of the things I do is print out the list of supported extensions:

05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): BEGIN OpenCL supported extensions list:
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_img_egl_image
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_khr_byte_addressable_store
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_khr_egl_event
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_khr_egl_image
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_khr_fp16
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_khr_gl_sharing
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_khr_global_int32_base_atomics
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_khr_global_int32_extended_atomics
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_khr_local_int32_base_atomics
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_khr_local_int32_extended_atomics
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_qcom_android_native_buffer_host_ptr
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_qcom_create_buffer_from_image
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_qcom_ext_host_ptr
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_qcom_ion_host_ptr
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): cl_qcom_perf_hint
05-22 16:57:54.778: I/OpenCL/OpenGL ES Robot OpenCL Demo(12116): END OpenCL supported extensions list

Here is a snippet you can use in your code:

//--------------------------------------------------------------------------------------
// Name: CheckOpenCLHalfFloatSupport
// Desc: Checks OpenCL device extensions for cl_khr_fp16 (half-float) support
//--------------------------------------------------------------------------------------
VOID CSample::CheckOpenCLHalfFloatSupport( )
{
    m_bSupportHalfFloat = FALSE;
    CHAR chrBuff[1024];

    clGetDeviceInfo( m_devices[0], CL_DEVICE_EXTENSIONS, 1024, chrBuff, NULL);

    CHAR* token = 0;
    FrmLogMessage("BEGIN OpenCL supported extensions list:\n" );
    if( NULL != chrBuff )
    {
        // generate vector array of extensions
        token = FrmStrtok(chrBuff, " " );
        while( NULL != token )
        {
            m_SupportedExtensions.push_back( token );
            FrmLogMessage( token );
            FrmLogMessage( "\n" );
            token = strtok(NULL, " ");
        }
        // sort extensions
        FrmLogMessage("END OpenCL supported extensions list\n" );
        std::sort(m_SupportedExtensions.begin(), m_SupportedExtensions.end());

        std::vector<std::string>::iterator it = m_SupportedExtensions.begin();
        std::string search_term = "cl_khr_fp16";
        BOOL found = FALSE;
        do
        {
            if( *it == search_term )
            {
                m_bSupportHalfFloat = TRUE;
                found = TRUE;
            }
            ++it;
        } while ( !found && it != m_SupportedExtensions.end());
    }
    else
    {
        FrmLogMessage("END OpenCL supported extensions list\n" );
    }

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