diff options
author | Martin Köhler <koehlerm@mpi-magdeburg.mpg.de> | 2014-09-08 17:57:44 +0200 |
---|---|---|
committer | Martin Köhler <koehlerm@mpi-magdeburg.mpg.de> | 2014-09-08 17:57:44 +0200 |
commit | 7794766d3cce1011cc95120bcd8579f4fd62e193 (patch) | |
tree | 424a55bc8ff4d60b8f85a46ed2c7ffbd43a8feeb | |
parent | 868f8a875665ab5987578aa0221b6d7711b0f940 (diff) | |
download | openblas-7794766d3cce1011cc95120bcd8579f4fd62e193.tar.gz openblas-7794766d3cce1011cc95120bcd8579f4fd62e193.tar.bz2 openblas-7794766d3cce1011cc95120bcd8579f4fd62e193.zip |
Add cblas_(s/d/c/z)omatcopy in order to have cblas interface for them.
-rw-r--r-- | cblas.h | 10 | ||||
-rw-r--r-- | cblas_noconst.h | 8 | ||||
-rw-r--r-- | exports/gensymbol | 3 | ||||
-rw-r--r-- | interface/Makefile | 22 | ||||
-rw-r--r-- | interface/omatcopy.c | 21 | ||||
-rw-r--r-- | interface/zomatcopy.c | 21 |
6 files changed, 80 insertions, 5 deletions
@@ -318,6 +318,16 @@ void cblas_caxpby(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *alpha, OPENBLA void cblas_zaxpby(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *alpha, OPENBLAS_CONST double *x, OPENBLAS_CONST blasint incx,OPENBLAS_CONST double *beta, double *y, OPENBLAS_CONST blasint incy); +void cblas_somatcopy(OPENBLAS_CONST enum CBLAS_ORDER CORDER, OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST float calpha, OPENBLAS_CONST float *a, + OPENBLAS_CONST blasint clda, float *b, OPENBLAS_CONST blasint cldb); +void cblas_domatcopy(OPENBLAS_CONST enum CBLAS_ORDER CORDER, OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double calpha, OPENBLAS_CONST double *a, + OPENBLAS_CONST blasint clda, double *b, OPENBLAS_CONST blasint cldb); +void cblas_comatcopy(OPENBLAS_CONST enum CBLAS_ORDER CORDER, OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST float* calpha, OPENBLAS_CONST float* a, + OPENBLAS_CONST blasint clda, float*b, OPENBLAS_CONST blasint cldb); +void cblas_zomatcopy(OPENBLAS_CONST enum CBLAS_ORDER CORDER, OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double* calpha, OPENBLAS_CONST double* a, + OPENBLAS_CONST blasint clda, double *b, OPENBLAS_CONST blasint cldb); + + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/cblas_noconst.h b/cblas_noconst.h index 1f79e8188..1592abc7f 100644 --- a/cblas_noconst.h +++ b/cblas_noconst.h @@ -306,6 +306,14 @@ void cblas_caxpby(blasint n, float *alpha, float *x, blasint incx,float *beta, f void cblas_zaxpby(blasint n, double *alpha, double *x, blasint incx,double *beta, double *y, blasint incy); +void cblas_somatcopy( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows, blasint ccols, float calpha, float *a, + blasint clda, float *b, blasint cldb); +void cblas_domatcopy( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows, blasint ccols, double calpha, double *a, + blasint clda, double *b, blasint cldb); +void cblas_comatcopy( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows, blasint ccols, void* calpha, void* a, + blasint clda, void *b, blasint cldb); +void cblas_zomatcopy( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows, blasint ccols, void* calpha, void* a, + blasint clda, void *b, blasint cldb); #ifdef __cplusplus } diff --git a/exports/gensymbol b/exports/gensymbol index 0769ae0f3..17d8a2b9c 100644 --- a/exports/gensymbol +++ b/exports/gensymbol @@ -52,7 +52,8 @@ cblas_zhpr, cblas_zscal, cblas_zswap, cblas_zsymm, cblas_zsyr2k, cblas_zsyrk, cblas_ztbmv, cblas_ztbsv, cblas_ztpmv, cblas_ztpsv, cblas_ztrmm, cblas_ztrmv, cblas_ztrsm, cblas_ztrsv, cblas_cdotc_sub, cblas_cdotu_sub, cblas_zdotc_sub, cblas_zdotu_sub, - cblas_saxpby,cblas_daxpby,cblas_caxpby,cblas_zaxpby + cblas_saxpby,cblas_daxpby,cblas_caxpby,cblas_zaxpby, + cblas_somatcopy, cblas_domatcopy, cblas_comatcopy, cblas_zomatcopy ); @exblasobjs = ( diff --git a/interface/Makefile b/interface/Makefile index 6992248ba..e4822352f 100644 --- a/interface/Makefile +++ b/interface/Makefile @@ -267,7 +267,7 @@ CSBLAS2OBJS = \ CSBLAS3OBJS = \ cblas_sgemm.$(SUFFIX) cblas_ssymm.$(SUFFIX) cblas_strmm.$(SUFFIX) cblas_strsm.$(SUFFIX) \ - cblas_ssyrk.$(SUFFIX) cblas_ssyr2k.$(SUFFIX) + cblas_ssyrk.$(SUFFIX) cblas_ssyr2k.$(SUFFIX) cblas_somatcopy.$(SUFFIX) CDBLAS1OBJS = \ cblas_idamax.$(SUFFIX) cblas_dasum.$(SUFFIX) cblas_daxpy.$(SUFFIX) \ @@ -283,7 +283,7 @@ CDBLAS2OBJS = \ CDBLAS3OBJS += \ cblas_dgemm.$(SUFFIX) cblas_dsymm.$(SUFFIX) cblas_dtrmm.$(SUFFIX) cblas_dtrsm.$(SUFFIX) \ - cblas_dsyrk.$(SUFFIX) cblas_dsyr2k.$(SUFFIX) + cblas_dsyrk.$(SUFFIX) cblas_dsyr2k.$(SUFFIX) cblas_domatcopy.$(SUFFIX) CCBLAS1OBJS = \ cblas_icamax.$(SUFFIX) cblas_scasum.$(SUFFIX) cblas_caxpy.$(SUFFIX) \ @@ -305,7 +305,8 @@ CCBLAS2OBJS = \ CCBLAS3OBJS = \ cblas_cgemm.$(SUFFIX) cblas_csymm.$(SUFFIX) cblas_ctrmm.$(SUFFIX) cblas_ctrsm.$(SUFFIX) \ cblas_csyrk.$(SUFFIX) cblas_csyr2k.$(SUFFIX) \ - cblas_chemm.$(SUFFIX) cblas_cherk.$(SUFFIX) cblas_cher2k.$(SUFFIX) + cblas_chemm.$(SUFFIX) cblas_cherk.$(SUFFIX) cblas_cher2k.$(SUFFIX) \ + cblas_comatcopy.$(SUFFIX) CZBLAS1OBJS = \ cblas_izamax.$(SUFFIX) cblas_dzasum.$(SUFFIX) cblas_zaxpy.$(SUFFIX) \ @@ -327,7 +328,8 @@ CZBLAS2OBJS = \ CZBLAS3OBJS = \ cblas_zgemm.$(SUFFIX) cblas_zsymm.$(SUFFIX) cblas_ztrmm.$(SUFFIX) cblas_ztrsm.$(SUFFIX) \ cblas_zsyrk.$(SUFFIX) cblas_zsyr2k.$(SUFFIX) \ - cblas_zhemm.$(SUFFIX) cblas_zherk.$(SUFFIX) cblas_zher2k.$(SUFFIX) + cblas_zhemm.$(SUFFIX) cblas_zherk.$(SUFFIX) cblas_zher2k.$(SUFFIX)\ + cblas_zomatcopy.$(SUFFIX) ifndef NO_CBLAS @@ -2035,15 +2037,27 @@ cblas_caxpby.$(SUFFIX) cblas_caxpby.$(PSUFFIX) : zaxpby.c domatcopy.$(SUFFIX) domatcopy.$(PSUFFIX) : omatcopy.c $(CC) -c $(CFLAGS) $< -o $(@F) +cblas_domatcopy.$(SUFFIX) cblas_domatcopy.$(PSUFFIX) : omatcopy.c + $(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F) + somatcopy.$(SUFFIX) somatcopy.$(PSUFFIX) : omatcopy.c $(CC) -c $(CFLAGS) $< -o $(@F) +cblas_somatcopy.$(SUFFIX) cblas_somatcopy.$(PSUFFIX) : omatcopy.c + $(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F) + comatcopy.$(SUFFIX) comatcopy.$(PSUFFIX) : zomatcopy.c $(CC) -c $(CFLAGS) $< -o $(@F) +cblas_comatcopy.$(SUFFIX) cblas_comatcopy.$(PSUFFIX) : zomatcopy.c + $(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F) + zomatcopy.$(SUFFIX) zomatcopy.$(PSUFFIX) : zomatcopy.c $(CC) -c $(CFLAGS) $< -o $(@F) +cblas_zomatcopy.$(SUFFIX) cblas_zomatcopy.$(PSUFFIX) : zomatcopy.c + $(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F) + dimatcopy.$(SUFFIX) dimatcopy.$(PSUFFIX) : imatcopy.c $(CC) -c $(CFLAGS) $< -o $(@F) diff --git a/interface/omatcopy.c b/interface/omatcopy.c index 0c418b3c9..59650cfa0 100644 --- a/interface/omatcopy.c +++ b/interface/omatcopy.c @@ -47,6 +47,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define BlasNoTrans 0 #define BlasTrans 1 +#ifndef CBLAS void NAME( char* ORDER, char* TRANS, blasint *rows, blasint *cols, FLOAT *alpha, FLOAT *a, blasint *lda, FLOAT *b, blasint *ldb) { @@ -66,7 +67,27 @@ void NAME( char* ORDER, char* TRANS, blasint *rows, blasint *cols, FLOAT *alpha, if ( Trans == 'R' ) trans = BlasNoTrans; if ( Trans == 'T' ) trans = BlasTrans; if ( Trans == 'C' ) trans = BlasTrans; +#else +void CNAME(enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows, blasint ccols, FLOAT calpha, FLOAT *a, blasint clda, FLOAT *b, blasint cldb) +{ + blasint *rows, *cols, *lda, *ldb; + FLOAT *alpha; + int order=-1,trans=-1; + blasint info = -1; + + if ( CORDER == CblasColMajor ) order = BlasColMajor; + if ( CORDER == CblasRowMajor ) order = BlasRowMajor; + if ( CTRANS == CblasNoTrans || CTRANS == CblasConjNoTrans ) trans = BlasNoTrans; + if ( CTRANS == CblasTrans || CTRANS == CblasConjTrans ) trans = BlasTrans; + + rows = &crows; + cols = &ccols; + lda = &clda; + ldb = &cldb; + alpha = &calpha; + +#endif if ( order == BlasColMajor) { if ( trans == BlasNoTrans && *ldb < *rows ) info = 9; diff --git a/interface/zomatcopy.c b/interface/zomatcopy.c index eec4d3c1c..7345633a2 100644 --- a/interface/zomatcopy.c +++ b/interface/zomatcopy.c @@ -49,6 +49,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define BlasTransConj 2 #define BlasConj 3 +#ifndef CBLAS void NAME( char* ORDER, char* TRANS, blasint *rows, blasint *cols, FLOAT *alpha, FLOAT *a, blasint *lda, FLOAT *b, blasint *ldb) { @@ -69,6 +70,26 @@ void NAME( char* ORDER, char* TRANS, blasint *rows, blasint *cols, FLOAT *alpha, if ( Trans == 'C' ) trans = BlasTransConj; if ( Trans == 'R' ) trans = BlasConj; +#else +void CNAME(enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows, blasint ccols, FLOAT *alpha, FLOAT *a, blasint clda, FLOAT*b, blasint cldb) +{ + blasint *rows, *cols, *lda, *ldb; + int order=-1,trans=-1; + blasint info = -1; + + if ( CORDER == CblasColMajor ) order = BlasColMajor; + if ( CORDER == CblasRowMajor ) order = BlasRowMajor; + + if ( CTRANS == CblasNoTrans) trans = BlasNoTrans; + if ( CTRANS == CblasConjNoTrans ) trans = BlasConj; + if ( CTRANS == CblasTrans) trans = BlasTrans; + if ( CTRANS == CblasConjTrans) trans = BlasTransConj; + + rows = &crows; + cols = &ccols; + lda = &clda; + ldb = &cldb; +#endif if ( order == BlasColMajor) { if ( trans == BlasNoTrans && *ldb < *rows ) info = 9; |