clMathLibraries / clBLAS

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

CPU performance compared to Matlab #132

Open wanderine opened 9 years ago

wanderine commented 9 years ago

I'm using clBLAS to perform some matrix operations, but I'm disappointed by the CPU performance. For example, if I calculate A*A^T for a matrix of size 2250 x 228 000, it takes about 5 seconds in Matlab but several minutes with clBLAS (even though all cores are being used). Is there some setup that takes a long time for the first clBLAS matrix operation?

I'm running clBLAS in Fedora 21 and CentOS 6.6. My CPU is an Intel 5820K, 6 cores. I have 32 GB of memory.

pavanky commented 9 years ago

@wanderine Did you run the tune tool to tune it for your hardware ? I think the defaults perform well on AMD GPUs and not on CPUs.

That said, you will most likely not be beating the MATLAB performance because it uses MKL which is highly tuned for Intel CPUs.