Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

CBLAS error handler

jeff_c71
Beginner
408 Views
I've been trying to override error handling for CBLAS calls, but can't seem to find any instructions on this. The best I've been able to find is this post:
http://software.intel.com/en-us/forums/showthread.php?t=64051
Defining XERBLA does override the error handler for standard BLAS calls (ie. dgemm, etc.). However, defining cblas_xerbla has no effect. When I call, for instance, cblas_dgemm with bad parameters I just get the generic "Parameter x was incorrect on entry to cblas_gemm" error message.
Does anyone know of a way to define a custom error handler for CBLAS functions? Any help would be greatly appreciated.
0 Kudos
1 Reply
Alexander_K_Intel3
408 Views
Hi,

Thisway it works at my side:

Example source:
[cpp]#include void cblas_xerbla(char *str, int n) { printf( "MY_XERBLA: %s detected error in parameter %dn", str, n ); } int main() { double a=1.; MKL_INT n=1, bad=-1; CBLAS_ORDER order=CblasRowMajor; CBLAS_TRANSPOSE trans=CblasNoTrans; cblas_dgemm( order, trans, trans, n, n, n, a, &a, bad, &a, n, a, &a, n );
return 0; }
}

[/cpp]


Compilation:
Linux ia32:
icc *.c -I$MKLROOT/include -L$MKLROOT/lib/ia32 \
-Wl,--start-group \
$MKLROOT/lib/ia32/libmkl_intel.a \
$MKLROOT/lib/ia32/libmkl_intel_thread.a \
$MKLROOT/lib/ia32/libmkl_core.a \
-Wl,--end-group -openmp -lpthread


Windows intel64:
set LIB=%LIB%;%MKLROOT%\lib\intel64
icl *.c -F640000000 -I%MKLROOT%\include mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib /Qopenmp

W.B.R.,
Alexander
0 Kudos
Reply