c++kaldi

A kaldi function only has header file in C++


I tried to find the definition of a function cblas_Xaxpy in Kaldi, so I was directed by GOTO Definition to the final place cblas-wrappers.h, where I found

inline void cblas_Xaxpy(const int N, const float alpha, const float *X,
                        const int incX, float *Y, const int incY) {
  cblas_saxpy(N, alpha, X, incX, Y, incY);
}

Apparently the key is cblas_saxpy, first I tried to direct to the source file of this header file, but I did not find any. So I have tried search the whole directory and the parent directory concerning the project and I could not find any file containing the real definition of cblas_saxpy. But this is the original code and I ran it smoothly.

Then I am confused: if this is the correct version, then there should be some place to define the function cblas_saxpy's implementation, but where is it ?


Solution

  • cblas_saxpy() is defined in the LAPACK library. (As this is a C library, the source code does not need to be present to compile software against the library.) The definition of cblas_saxpy in that library is a wrapper around some extremely old Fortran code.