Hello I have a question about using MKL and CBLAS.
In generic/THBlas.c, lines 320 and 322 call the BLAS functions dgemm_ and sgemm_.

  
      github.com
  
  
    pytorch/pytorch/blob/de9845588d2b6f411641b442cdb5c5fe7e2dba75/torch/lib/TH/generic/THBlas.c#L319-L322 8

#if defined(TH_REAL_IS_DOUBLE)
dgemm_(&transa, &transb, &i_m, &i_n, &i_k, &alpha, a, &i_lda, b, &i_ldb, &beta, c, &i_ldc);
#else
sgemm_(&transa, &transb, &i_m, &i_n, &i_k, &alpha, a, &i_lda, b, &i_ldb, &beta, c, &i_ldc);



  
  
    
    
  
  


I would like to substitute them with their CBLAS counterparts referenced here:
https://software.intel.com/en-us/mkl-developer-reference-c-cblas-gemm 12
I tried to include “mkl.h” in THBlas.c but the PyTorch setup does not recognize the header file. Without the header file the setup throws errors for CBLAS_LAYOUT and CBLAS_TRANSPOSE types.
The end goal is to use Sparse BLAS routines referenced here:
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-csrmm 5
My PyTorch was installed with Anaconda which includes the MKL library.
What steps do I need to make the switch?