Impact of matrix sparsity on cblas_gemm and cublasSgemm : I have recently discovered that the performance of a cblas_sgemm call for matrix multiplication dramatically improves if the matrices have a "large" number of zeros in them. It improves to the point that it beats its cublas cousin by more than a 100 times. This could be most probably attributed to some **automatic detection of sparsity** and suitable format conversion by cblas_sgemm function. 

Unfortunately, no such behavior is exhibited by its cuda counterpart i.e. cublasSgemm. 

So, the question is, how can I get the same type of optimization on cublasSgemm for matrices that **may have** a large number of zeros. 

And what technique does cblas_sgemm use to automatically adjust to sparse matrices?

Please, do not recommend cuSparse / CUSP etc because

 1. I am not sure about the sparsity of input matrices beforehand
 2. I am working on an iterative algorithm where for initial few iterations the matrices **may be** sparse but gradually become dense as time goes on.

Thanks in advance