Dear All,
One of my use cases of ARM Mali graphics is running Video(HEVC) Decode Kernels. But, what we discover is that the OpenCL Kernel call APIs clEnqueueNDRangeKernel and clEnqueueTask overhead is much higher than the execution time of the kernel. This reduces the overall Video decoding speed considerably.
Is there anything we can do to reduce this overhead ? Any tips ? Or if you need more details about the issue, I can explain.
Regards
Paul
Hi Anthony,
I met a similar problem with Paul. I found the clCreateKernel for some kernels were very slow, ranging from 15ms ~ 50ms. I use mali_clcc -v option to dump the instruction number. The numbers of instruction words emitted ranged from 12 to 136. Further more, it seems the number of instruction did not have any relations with the kernel creation time.
So I am wonder what kinds of factors affect the clCreateKernel execution time ? the instruction number? create program with binary or source? code length?
I shall be very appreciated if you can give me some clues. It is very important to our production (Though the clCreateKernel is often used once during the application, sometimes it still influences the whole pipeline).
Thanks in advance.
Hi,
clCreateKernel has nothing to do with clEnqueueNDRangeKernel.
In your case if you want to speed up the kernel creation then you need to use a binary program.
To generate a binary program:
- build a program from sources
- build all the kernels in the program (If you don't do that then the binary you will save will be an IR rather than an actual binary)
- Retrieve the program binary using clGetProgramInfo and save it to a file.
This should be much quicker than building from sources, if it's not it's likely that your driver is too old.
Hope this helps,
Anthony
Hi, Anthony
It works to employ the prebuilt binary file. Time consumption reduced from 10+ms to 100+us.
Thumbs up
Irving