oneDAL
oneDAL copied to clipboard
`xsyrk` vs `xxsyrk` vs `dsyrk` (in netlib LAPACK)
Hi,
In the mkl function call, I have seen two types of call of same basic function, prefixed with x
and xx
.e.g, xsyrk
and xxsyrk
.
What is difference between these two type of functions and how is it different from function implementation in netlib LAPACK or OpenBLAS.
Reading MklLapack code you can find xx
functions set number of threads to 1 locally:
template <CpuType cpu>
struct MklLapack<double, cpu>
{
typedef DAAL_INT SizeType;
static void xgetrf(DAAL_INT * m, DAAL_INT * n, double * a, DAAL_INT * lda, DAAL_INT * ipiv, DAAL_INT * info)
{
__DAAL_MKLFN_CALL(lapack_, dgetrf, (m, n, a, lda, ipiv, info));
}
static void xxgetrf(DAAL_INT * m, DAAL_INT * n, double * a, DAAL_INT * lda, DAAL_INT * ipiv, DAAL_INT * info)
{
int old_threads = fpk_serv_set_num_threads_local(1);
__DAAL_MKLFN_CALL(lapack_, dgetrf, (m, n, a, lda, ipiv, info));
fpk_serv_set_num_threads_local(old_threads);
}
...
}
Thankyou @Alexsandruss for your response. I still have two questions,
- Why
xx..
version of function set number of local thread to 1. What are the cases when this function will be used? - I can see
xxgemm
function call https://github.com/oneapi-src/oneDAL/blob/23786e6b02f6a0e10eccc31f00e737abef8319eb/cpp/daal/src/externals/service_blas_mkl.h#L140 doesn't set thread number to 1 but instead call a different functionxdgemm
. Please comment on this.
Thanks!
@ajay-fuji is this still a pressing issue?
I still want to understand reason behind setting local threads to 1 in one case (xx
) not in other case.