Hi all,
[NOTE: I have already posted this question very verbosely on StackOverflow here [1], so please refer to it if you need further insights. Therefore, I'll spare the nitty-gritty details here and just summarize what my problem is]
I'm trying to fetch the resulting binaries after an OpenCL program compilation on an LG V20 phone (which has a Snapdragon 820 SoC) using clGetProgramBuildInfo with CL_PROGRAM_BINARIES. This is supported by the standard, and even Qualcomm recommends compiling CL binaries offline and loading them at application initialization ([2]):
Build kernel source code offline and load the binary at runtime to reduce latency when the application launches
However, no matter how hard I try but it seems that Qualcomm's libOpenCL.so implementation simply refuses to give me the resulting executable bytes after compiling my CL program (check SO post for details). So, my question is: How can I get a blob that I can later on reuse with clCreateProgramWithBinary then?
Any help appreciated.
[1] http://stackoverflow.com/questions/41965894/cant-get-compiled-opencl-binaries-with-clgetprograminfo-on-qualcomm-adreno-gpus
[2] https://developer.qualcomm.com/download/adrenosdk/adreno-opencl-programming-guide.pdf
I have been able to succesfully retrieve binaries from the Adreno on an 820 using the following code...
Hi Rick,
Thank you so much; it's working now! I'm not quite sure what was I doing wrong exactly, because my code was following a very similar reasoning as yours, but as I was initially using C++ bindings instead of pure C, my best bet so far is that maybe those bindings are not as polished as the C API as of today.
In any case, huge thanks again for your help.
hi asamarin:
I study opencl few days, i have a question about build offline
how could i do for cl file build offline, don't build online, becasue it would cost long time
thanks in advance!