CNugteren / CLBlast

Tuned OpenCL BLAS
Apache License 2.0
1.06k stars 202 forks source link

ERROR IN ROCK5b #547

Closed superHappy-yo closed 4 months ago

superHappy-yo commented 4 months ago

image

It don't happened in my compute(Intel),but I copy it to rock5b,and there are errors happend after I compile it and test my code(im2col+gemm).

CNugteren commented 4 months ago

Thanks for reporting. The error message is from a simple kernel code pre-processor inside CLBlast. So unless you did something wrong, this is definitely a CLBlast issue. Let's first check if everything went OK on your side. I can find that line 3 times in my CLBlast/src/kernels/level3/xgemm_direct_part2.opencl file. Can you double check that that file is complete and correct? It seems from the error log that there might be a { missing at the end of for (int _kib = 0; _kib < KWBD; _kib += 1) {, but I can't see that issue locally.

superHappy-yo commented 4 months ago

Thanks for reply. I can run it on my computer,but it couldn't work on Radxa ROCK 5B with ubuntu. I used the default format tool in vscode to format the code. Maybe this action make it error? I check my code and I can run it on my Intel computer(ubuntu).

And I want to add a new function in CLblast.I add a function named "gemmMec" in Xgemm.cpp and add a gemm_mec.opencl. It can run correctly. What else do I need to do to make full use of the library and reach the best speed? Can you help me? 图片

CNugteren commented 4 months ago

I can run it on my computer,but it couldn't work on Radxa ROCK 5B with ubuntu. I used the default format tool in vscode to format the code. Maybe this action make it error? I check my code and I can run it on my Intel computer(ubuntu).

Yes, you should not re-format the OpenCL code. CLBlast contains a very simple pre-processor that makes many assumptions on the code contents and style, this is why the error showed up. So I guess this matter is now solved.

And I want to add a new function in CLblast.I add a function named "gemmMec" in Xgemm.cpp and add a gemm_mec.opencl. It can run correctly. What else do I need to do to make full use of the library and reach the best speed? Can you help me?

Is this something you want to contribute to the main CLBlast, or is this some very specific kernel of your own? Because if this is your own kernel, I would not recommend adding it to CLBlast directly. Instead you are probably looking for a kernel tuner? So perhaps my own CLTune or the much better kernel-tuner can be of help?

In any case I propose to close this issue. If you have questions adding a new feature to CLBlast for public usage, please open a new issue with descriptions about what the function should do, and then we can see whether it makes sense to add it.