pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.88k stars 21.33k forks source link

[Suggestion] Intel MKL support #263

Open Ristovski opened 7 years ago

Ristovski commented 7 years ago

Since we already have CUDA. Are there any plans to integrate Intel MKL/MKL-DNN support? Dlib does this, and it greatly speeds up the neural networks. I am aware this would not be a trivial task, but good to have nonetheless.

mikechen1984 commented 5 years ago

you can make it work by yourself, just replace cblas code from mkl

mikechen1984 commented 5 years ago

include

void gemm(int TA, int TB, int M, int N, int K, float ALPHA, float A, int lda, float B, int ldb, float BETA, float *C, int ldc) {

if USE_MKL

cblas_sgemm(CblasRowMajor, TA?CblasTrans:CblasNoTrans, TB?CblasTrans:CblasNoTrans, M, N, K, ALPHA, A, lda, B, ldb, BETA, C, ldc);

else

gemm_cpu( TA,  TB,  M, N, K, ALPHA,A,lda, B, ldb,BETA,C,ldc);

endif

}