help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] About invalid parameters in cblas implementation [News fo


From: José Luis García Pallero
Subject: Re: [Help-gsl] About invalid parameters in cblas implementation [News for an old discussion]
Date: Tue, 21 Sep 2010 12:25:04 +0200

El día 16 de agosto de 2010 23:22, José Luis García Pallero
<address@hidden> escribió:
>> Can you make a patch for the level-2 cblas functions only, I'm
>> reasonably happy with those but not sure about the level-3.
>
> Ok, but I think it will take a while. Now I don't have much time.
>
>> I think it would be better to move the pos argument inside the macro, as it
>> shouldn't be needed outside it (example below).
>
> I prefer maintain the pos argument outside (I think this was
> discussed). If pos is outside we could use the same macro in the cblas
> functions and in the GSL wreppers of cblas to check the errors and
> return a GSL error code. The "problem" with cblas is that an incorrect
> input argument STOPS the execution of the program (in GSL this will
> cause memory leaks, for example).
>
>> #define CBLAS_ERROR_GEMV(order,TransA,M,N,alpha,A,lda,X,incX,beta,Y,incY) \
>> { int pos = 0; \
>> CHECK_ORDER(pos,1,order); \
>> CHECK_TRANSPOSE(pos,2,TransA); \
>> CHECK_DIM(pos,3,M); \
>> CHECK_DIM(pos,4,N); \
>> if((order)==CblasRowMajor) { \
>>    if((lda)<CBLAS_MAX(1,N)) { \
>>        pos = 7; \
>>    } \
>> } else if((order)==CblasColMajor) { \
>>    if((lda)<CBLAS_MAX(1,M)) { \
>>        pos = 7; \
>>    } \
>> } \
>> CHECK_STRIDE(pos,9,incX); \
>> CHECK_STRIDE(pos,12,incY); \
>> REPORT_ERROR(pos) ; }

Hello,

Attached I send a patch for the level-2 blas functions of the error
check macros. This patch was made with mercurial cvs (I've hever used
bazaar) translated from the original bazaar repository of gsl. I've
checked the code with the oficial gsl-1.14 code because I have
problems with the autogen.sh from the repository. Plus the modified
original files I have added a new one called error_cblas.h (that
constains the error check macros) to the cblas folder. My known about
autotools are very limited, but I suppose that the error_cblas.h file
must be added to the tag noinst_HEADERS in Makefile.am. This was done
and appears in the patch
The code runs OK and I send too a small test that contains one
function with a wrong argument. With the original code, the test runs
OK, but with the new one the error is reported and the program stops.
As we discussed in previous mails, I think that the 'pos' variable in
the macros must be passed to the macro in order to use the macros in
the gsl blas wrappers functions too.

Cheers

-- 
*****************************************
José Luis García Pallero
address@hidden
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************

Attachment: error_cblas.patch
Description: Text Data

Attachment: test.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]