clMathLibraries / clBLAS

a software library containing BLAS functions written in OpenCL
Apache License 2.0
839 stars 240 forks source link

Getting the generated kernels #104

Closed blueberry closed 9 years ago

blueberry commented 9 years ago

Is there a way to see how a generated kernel for a certain blas operation looks like? I am looking at how to use clBLAS kernels in another library, but can not follow the generation process in clBLAS. Is there something like "dump the generated kernels to a string"?

CNugteren commented 9 years ago

One option would be to simply printf the kernels yourself by modifying the source. I did that myself a while back, and, if I recall it correctly, it can be done like this (example for GEMM):

gregsomers commented 9 years ago

Compile clBLAS from source. You need the cmake variable BLAS_DUMP_CLBLAS_KERNELS set to ON. You can do the interactive config cmake -i, it will prompt to enter a value.

After linking with the newly compiled lib, it will dump all of the kernels to the directory the program was executed from. It should dump the kernel for every single clBLAS call.

blueberry commented 9 years ago

Thank you, Greg.

On Tue, Jun 9, 2015 at 8:33 PM, Greg Somers notifications@github.com wrote:

Compile clBLAS from source. You need the cmake variable BLAS_DUMP_CLBLAS_KERNELS set to ON. You can do the interactive config cmake -i, it will prompt to enter a value.

After linking with the newly compiled lib, it will dump all of the kernels to the directory the program was executed from. It should dump the kernel for every single clBLAS call.

ā€” Reply to this email directly or view it on GitHub https://github.com/clMathLibraries/clBLAS/issues/104#issuecomment-110457342 .

TimmyLiu commented 9 years ago

Can we close this issue?