Questions about building an OpenCL kernel as an OpenVX node

Questions about building an OpenCL kernel as an OpenVX node

Hello again,

I have implemented an OpenVX node with a simple OpenCL kernel. It works. Now I want to print out the OpenCL version used in my code, and I am having problems.

First, I tried to pass the string  "--version" as part of the compiler options into vxAddDeviceLibraryIntel(). I didn't see any compiler errors, but my code exited with the following error messages:

[ INFO ] OpenCL build options: -DWORK_ITEM_XSIZE=1 -DWORK_ITEM_YSIZE=1 --version
OpenCL kernel name: com.bdti.opencl.mask
OpenCL kernel ID: 5242881
oclKernel = 0x1176690
ERROR: cannot verify graph (vx_status=-1)
ERROR: cannot release graph (vx_status=-1)
ERROR: cannot release context (vx_status=-1)

Then, I removed the change to the compiler options, and added the following line into my OpenCL script (I didn't like this approach, as a printf obviously would slow down my code significantly. It was just a test):

    printf("opencl version: %s\n", __OPENCL_VERSION__);

Now I got this output:

[ INFO ] OpenCL build options: -DWORK_ITEM_XSIZE=1 -DWORK_ITEM_YSIZE=1
OpenCL kernel name: com.bdti.opencl.mask
OpenCL kernel ID: 5242881
oclKernel = 0x17c1c50
35 errors generated.
ERROR: cannot verify graph (vx_status=-1)
ERROR: cannot release graph (vx_status=-1)
ERROR: cannot release context (vx_status=-1)

So, here are my questions:

1. Why didn't my first approach work ?

2. For my second approach, where do I look for the 35 errors generated presumably by the OpenCL compiler?

3. What's the recommended way to display the OpenCL version in CV SDK?

Thanks,

-Robby

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hey Robby, 

Sorry for the delay in response. 

The right way to go about this is querying the OpenCL RT and not the OpenVX RT. 

The best way for querying OpenCL RT version is using clGetPlatformInfo API in the host code (can be found in OpenCL spec).

for example, clGetPlatformInfo(platform, CL_PLATFORM_VERSION, param_value_size, platform_ver, &returned_size);

This should return a string with the following structure OpenCL<space><majorVersion.minorVersion><space><platformSpecificInformation>

 

Regards,

Stav

 

Hi Stav, thanks for the response.

Yes I know how to get the OpenCL version by using the clGetPlatformInfo API. However, if I understand correctly, that API requires the OpenCL SDK, which I have not installed. I was trying to verify the OpenCL compiler used to build my CL kernel into an OpenVX node, and was hoping to get that info without installing the OpenCL SDK.

-Robby

 

Hi, you can set the env andf the RT wuill start to output the OpenCL kernel compilation erroro:

$ export VX_ZONE_LIST=18

$export IAP_TRACE_LEVEL=0

Leave a Comment

Please sign in to add a comment. Not a member? Join today