/* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _ERROR_CBLAS_V2_H_ #define _ERROR_CBLAS_V2_H_ //////////////////////////////////////////////////////////////////////////////// #define CBLAS_MAX(a,b) ((a)>(b) ? (a) : (b)) //////////////////////////////////////////////////////////////////////////////// #define CHECK_INT_LONGITUDE(pos,posIfError,data) \ if((data)>MAX_INT) \ (pos) = (posIfError); //////////////////////////////////////////////////////////////////////////////// #define CHECK_ORDER(pos,posIfError,order) \ if(((order)!=CblasRowMajor)&&((order)!=CblasColMajor)) \ (pos) = (posIfError); //////////////////////////////////////////////////////////////////////////////// #define CHECK_TRANSPOSE(pos,posIfError,Trans) \ if(((Trans)!=CblasNoTrans)&&((Trans)!=CblasTrans)&&((Trans)!=CblasConjTrans)) \ (pos) = (posIfError); //////////////////////////////////////////////////////////////////////////////// #define CHECK_UPLO(pos,posIfError,Uplo) \ if(((Uplo)!=CblasUpper)&&((Uplo)!=CblasLower)) \ (pos) = (posIfError); //////////////////////////////////////////////////////////////////////////////// #define CHECK_DIAG(pos,posIfError,Diag) \ if(((Diag)!=CblasNonUnit)&&((Diag)!=CblasUnit)) \ (pos) = (posIfError); //////////////////////////////////////////////////////////////////////////////// #define CHECK_SIDE(pos,posIfError,Side) \ if(((Side)!=CblasLeft)&&((Side)!=CblasRight)) \ (pos) = (posIfError); //////////////////////////////////////////////////////////////////////////////// #define CHECK_DIM(pos,posIfError,dim) \ if((dim)<0) \ (pos) = (posIfError); //////////////////////////////////////////////////////////////////////////////// #define CHECK_STRIDE(pos,posIfError,stride) \ if((stride)==0) \ (pos) = (posIfError); //////////////////////////////////////////////////////////////////////////////// /* * ============================================================================= * Prototypes for level 2 BLAS * ============================================================================= */ /* * Routines with standard 4 prefixes (S, D, C, Z) */ #define CBLAS_ERROR_GEMV(pos,order,TransA,M,N,alpha,A,lda,X,incX,beta,Y,incY) \ 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)