Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,8 @@ In chronological order:
* Nathan Sircombe <nathan.sircombe@arm.com>
* [2026-04-16] Add CPU ID for Neoverse V3
hheei <hheei@users.noreply.github.com>

* Aadityansha Verma <https://github.com/aadityansha06>
* [2026-07-14] Add independent transpose support for C in GEADD (sgeadd/dgeadd/cgeadd/zgeadd).


10 changes: 5 additions & 5 deletions cblas.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,13 @@ void cblas_cimatcopy(OPENBLAS_CONST enum CBLAS_ORDER CORDER, OPENBLAS_CONST enum
void cblas_zimatcopy(OPENBLAS_CONST enum CBLAS_ORDER CORDER, OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double* calpha, double* a,
OPENBLAS_CONST blasint clda, OPENBLAS_CONST blasint cldb);

void cblas_sgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST float calpha, OPENBLAS_CONST float *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST float cbeta,
float *c, OPENBLAS_CONST blasint cldc);
void cblas_dgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double calpha, OPENBLAS_CONST double *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST double cbeta,
void cblas_sgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS_A,OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS_C,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST float calpha, OPENBLAS_CONST float *a, OPENBLAS_CONST blasint clda,OPENBLAS_CONST float cbeta, float *c,
OPENBLAS_CONST blasint cldc);
void cblas_dgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS_A,OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS_C,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double calpha, OPENBLAS_CONST double *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST double cbeta,
double *c, OPENBLAS_CONST blasint cldc);
void cblas_cgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST float *calpha, OPENBLAS_CONST float *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST float *cbeta,
void cblas_cgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS_A,OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS_C,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST float *calpha, OPENBLAS_CONST float *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST float *cbeta,
float *c, OPENBLAS_CONST blasint cldc);
void cblas_zgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double *calpha, OPENBLAS_CONST double *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST double *cbeta,
void cblas_zgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS_A,OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS_C,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double *calpha, OPENBLAS_CONST double *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST double *cbeta,
double *c, OPENBLAS_CONST blasint cldc);

void cblas_sgemm_batch(OPENBLAS_CONST enum CBLAS_ORDER Order, OPENBLAS_CONST enum CBLAS_TRANSPOSE * TransA_array, OPENBLAS_CONST enum CBLAS_TRANSPOSE * TransB_array, OPENBLAS_CONST blasint * M_array, OPENBLAS_CONST blasint * N_array, OPENBLAS_CONST blasint * K_array,
Expand Down
8 changes: 4 additions & 4 deletions common_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -801,10 +801,10 @@ void BLASFUNC(dimatcopy) (char *, char *, blasint *, blasint *, double *, do
void BLASFUNC(cimatcopy) (char *, char *, blasint *, blasint *, float *, float *, blasint *, blasint *);
void BLASFUNC(zimatcopy) (char *, char *, blasint *, blasint *, double *, double *, blasint *, blasint *);

void BLASFUNC(sgeadd) (blasint *, blasint *, float *, float *, blasint *, float *, float *, blasint*);
void BLASFUNC(dgeadd) (blasint *, blasint *, double *, double *, blasint *, double *, double *, blasint*);
void BLASFUNC(cgeadd) (blasint *, blasint *, float *, float *, blasint *, float *, float *, blasint*);
void BLASFUNC(zgeadd) (blasint *, blasint *, double *, double *, blasint *, double *, double *, blasint*);
void BLASFUNC(sgeadd) (blasint *, blasint *, float *, float *, blasint *, float *, float *, blasint*,char*, char*);
void BLASFUNC(dgeadd) (blasint *, blasint *, double *, double *, blasint *, double *, double *, blasint*,char *, char *);
void BLASFUNC(cgeadd) (blasint *, blasint *, float *, float *, blasint *, float *, float *, blasint*,char *, char *);
void BLASFUNC(zgeadd) (blasint *, blasint *, double *, double *, blasint *, double *, double *, blasint*,char *, char *);


#ifdef __cplusplus
Expand Down
8 changes: 4 additions & 4 deletions common_level3.h
Original file line number Diff line number Diff line change
Expand Up @@ -2050,10 +2050,10 @@ int zimatcopy_k_rnc(BLASLONG, BLASLONG, double, double, double *, BLASLONG);
int zimatcopy_k_ctc(BLASLONG, BLASLONG, double, double, double *, BLASLONG);
int zimatcopy_k_rtc(BLASLONG, BLASLONG, double, double, double *, BLASLONG);

int sgeadd_k(BLASLONG, BLASLONG, float, float*, BLASLONG, float, float *, BLASLONG);
int dgeadd_k(BLASLONG, BLASLONG, double, double*, BLASLONG, double, double *, BLASLONG);
int cgeadd_k(BLASLONG, BLASLONG, float, float, float*, BLASLONG, float, float, float *, BLASLONG);
int zgeadd_k(BLASLONG, BLASLONG, double,double, double*, BLASLONG, double, double, double *, BLASLONG);
int sgeadd_k(BLASLONG, BLASLONG, float, float*, BLASLONG, float, float *, BLASLONG,BLASLONG,BLASLONG);
int dgeadd_k(BLASLONG, BLASLONG, double, double*, BLASLONG, double, double *, BLASLONG,BLASLONG,BLASLONG);
int cgeadd_k(BLASLONG, BLASLONG, float, float, float*, BLASLONG, float, float, float *, BLASLONG,BLASLONG,BLASLONG);
int zgeadd_k(BLASLONG, BLASLONG, double,double, double*, BLASLONG, double, double, double *, BLASLONG,BLASLONG,BLASLONG);

int sgemm_batch_thread(blas_arg_t * queue, BLASLONG nums);
int dgemm_batch_thread(blas_arg_t * queue, BLASLONG nums);
Expand Down
8 changes: 4 additions & 4 deletions common_param.h
Original file line number Diff line number Diff line change
Expand Up @@ -1256,16 +1256,16 @@ int (*shgemv_t) (BLASLONG, BLASLONG, float, hfloat16 *, BLASLONG, hfloat16 *, BL
#endif

#if (BUILD_SINGLE==1)
int (*sgeadd_k) (BLASLONG, BLASLONG, float, float *, BLASLONG, float, float *, BLASLONG);
int (*sgeadd_k) (BLASLONG, BLASLONG, float, float *, BLASLONG, float, float *, BLASLONG, BLASLONG, BLASLONG);
#endif
#if (BUILD_DOUBLE==1)
int (*dgeadd_k) (BLASLONG, BLASLONG, double, double *, BLASLONG, double, double *, BLASLONG);
int (*dgeadd_k) (BLASLONG, BLASLONG, double, double *, BLASLONG, double, double *, BLASLONG, BLASLONG, BLASLONG);
#endif
#if (BUILD_COMPLEX==1)
int (*cgeadd_k) (BLASLONG, BLASLONG, float, float, float *, BLASLONG, float, float, float *, BLASLONG);
int (*cgeadd_k) (BLASLONG, BLASLONG, float, float, float *, BLASLONG, float, float, float *, BLASLONG, BLASLONG, BLASLONG);
#endif
#if (BUILD_COMPLEX16==1)
int (*zgeadd_k) (BLASLONG, BLASLONG, double, double, double *, BLASLONG, double, double, double *, BLASLONG);
int (*zgeadd_k) (BLASLONG, BLASLONG, double, double, double *, BLASLONG, double, double, double *, BLASLONG, BLASLONG, BLASLONG);
#endif
} gotoblas_t;

Expand Down
61 changes: 51 additions & 10 deletions interface/geadd.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#ifndef CBLAS

void NAME(blasint *M, blasint *N, FLOAT *ALPHA, FLOAT *a, blasint *LDA,
FLOAT *BETA, FLOAT *c, blasint *LDC)
FLOAT *BETA, FLOAT *c, blasint *LDC, char *TRANS_A,char *TRANS_C)
{

blasint m = *M;
Expand All @@ -62,14 +62,31 @@ void NAME(blasint *M, blasint *N, FLOAT *ALPHA, FLOAT *a, blasint *LDA,
FLOAT beta = *BETA;

blasint info;
char transa = (*TRANS_A == 'T') || (*TRANS_A == 't') || (*TRANS_A == 'C') || (*TRANS_A == 'c');
char transc = (*TRANS_C == 'T') || (*TRANS_C == 't') || (*TRANS_C == 'C') || (*TRANS_C == 'c');


PRINT_DEBUG_NAME;

info = 0;
if(transa){
if (lda < MAX(1, n))info = 5;


} else{

if (lda < MAX(1, m)) info = 5;
}


if(transc){
if (ldc < MAX(1, n)) info = 8;

if (lda < MAX(1, m)) info = 5;
if (ldc < MAX(1, m)) info = 8;

}else{

if (ldc < MAX(1, m)) info = 8;
}

if (n < 0) info = 2;
if (m < 0) info = 1;
Expand All @@ -80,7 +97,7 @@ void NAME(blasint *M, blasint *N, FLOAT *ALPHA, FLOAT *a, blasint *LDA,
}

#else
void CNAME( enum CBLAS_ORDER order, blasint m, blasint n, FLOAT alpha, FLOAT *a, blasint lda, FLOAT beta,
void CNAME( enum CBLAS_ORDER order,enum CBLAS_TRANSPOSE transa, enum CBLAS_TRANSPOSE transc,blasint m, blasint n, FLOAT alpha, FLOAT *a, blasint lda, FLOAT beta,
FLOAT *c, blasint ldc)
{
/*
Expand All @@ -100,9 +117,17 @@ void CNAME(enum CBLAS_ORDER order,
if (order == CblasColMajor) {

info = -1;

if (ldc < MAX(1, m)) info = 8;
if (lda < MAX(1, m)) info = 5;
if ( (transc == CblasNoTrans) || (transc == CblasConjNoTrans) ) {
if (ldc < MAX(1, m)) info = 8;
} else {
if (ldc < MAX(1, n)) info = 8;
}

if ( (transa == CblasNoTrans) || (transa == CblasConjNoTrans) ) {
if (lda < MAX(1, m)) info = 5;
} else {
if (lda < MAX(1, n)) info = 5;
}
if (n < 0) info = 2;
if (m < 0) info = 1;

Expand All @@ -115,8 +140,17 @@ void CNAME(enum CBLAS_ORDER order,
n = m;
m = t;

if (ldc < MAX(1, m)) info = 8;
if (lda < MAX(1, m)) info = 5;
if ( (transc == CblasNoTrans) || (transc == CblasConjNoTrans) ) {
if (ldc < MAX(1, m)) info = 8;
} else {
if (ldc < MAX(1, n)) info = 8;
}

if ( (transa == CblasNoTrans) || (transa == CblasConjNoTrans) ) {
if (lda < MAX(1, m)) info = 5;
} else {
if (lda < MAX(1, n)) info = 5;
}
if (n < 0) info = 1;
if (m < 0) info = 2;
}
Expand All @@ -136,7 +170,14 @@ void CNAME(enum CBLAS_ORDER order,
FUNCTION_PROFILE_START();


GEADD_K(m,n,alpha, a, lda, beta, c, ldc);
GEADD_K(m,n,alpha, a, lda, beta, c, ldc,
#ifdef CBLAS
(transa == CblasTrans) || (transa == CblasConjTrans),
(transc == CblasTrans) || (transc == CblasConjTrans)
#else
transa, transc
#endif
);


FUNCTION_PROFILE_END(1, 2* m * n , 2 * m * n);
Expand Down
74 changes: 62 additions & 12 deletions interface/zgeadd.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#ifndef CBLAS

void NAME(blasint *M, blasint *N, FLOAT *ALPHA, FLOAT *a, blasint *LDA,
FLOAT *BETA, FLOAT *c, blasint *LDC)
FLOAT *BETA, FLOAT *c, blasint *LDC,char *TRANS_A,char *TRANS_C)
{

blasint m = *M;
Expand All @@ -60,14 +60,34 @@ void NAME(blasint *M, blasint *N, FLOAT *ALPHA, FLOAT *a, blasint *LDA,
blasint ldc = *LDC;

blasint info;
char transa = (*TRANS_A == 'T') || (*TRANS_A == 't') || (*TRANS_A == 'C') || (*TRANS_A == 'c');
char transc = (*TRANS_C == 'T') || (*TRANS_C == 't') || (*TRANS_C == 'C') || (*TRANS_C == 'c');


PRINT_DEBUG_NAME;

info = 0;


if (lda < MAX(1, m)) info = 5;
if (ldc < MAX(1, m)) info = 8;
if(transa){
if (lda < MAX(1, n))info = 5;


} else{

if (lda < MAX(1, m)) info = 5;
}


if(transc){
if (ldc < MAX(1, n)) info = 8;


}else{

if (ldc < MAX(1, m)) info = 8;
}


if (n < 0) info = 2;
if (m < 0) info = 1;
Expand All @@ -78,7 +98,7 @@ void NAME(blasint *M, blasint *N, FLOAT *ALPHA, FLOAT *a, blasint *LDA,
}

#else
void CNAME( enum CBLAS_ORDER order, blasint m, blasint n, FLOAT *ALPHA, FLOAT *a, blasint lda, FLOAT *BETA,
void CNAME( enum CBLAS_ORDER order,enum CBLAS_TRANSPOSE transa, enum CBLAS_TRANSPOSE transc, blasint m, blasint n, FLOAT *ALPHA, FLOAT *a, blasint lda, FLOAT *BETA,
FLOAT *c, blasint ldc)
{
/*
Expand All @@ -99,11 +119,19 @@ void CNAME(enum CBLAS_ORDER order,

info = -1;

if (ldc < MAX(1, m)) info = 8;
if (lda < MAX(1, m)) info = 5;
if ( (transc == CblasNoTrans) || (transc == CblasConjNoTrans) ) {
if (ldc < MAX(1, m)) info = 8;
} else {
if (ldc < MAX(1, n)) info = 8;
}

if ( (transa == CblasNoTrans) || (transa == CblasConjNoTrans) ) {
if (lda < MAX(1, m)) info = 5;
} else {
if (lda < MAX(1, n)) info = 5;
}
if (n < 0) info = 2;
if (m < 0) info = 1;

if (m < 0) info = 1;
}

if (order == CblasRowMajor) {
Expand All @@ -112,13 +140,24 @@ void CNAME(enum CBLAS_ORDER order,
t = n;
n = m;
m = t;

if (ldc < MAX(1, m)) info = 8;
if (lda < MAX(1, m)) info = 5;
if ( (transc == CblasNoTrans) || (transc == CblasConjNoTrans) ) {
if (ldc < MAX(1, m)) info = 8;
} else {
if (ldc < MAX(1, n)) info = 8;
}

if ( (transa == CblasNoTrans) || (transa == CblasConjNoTrans) ) {
if (lda < MAX(1, m)) info = 5;
} else {
if (lda < MAX(1, n)) info = 5;
}
if (n < 0) info = 1;
if (m < 0) info = 2;
}




if (info >= 0) {
BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME));
return;
Expand All @@ -134,7 +173,18 @@ void CNAME(enum CBLAS_ORDER order,
FUNCTION_PROFILE_START();


GEADD_K(m,n,ALPHA[0],ALPHA[1], a, lda, BETA[0], BETA[1], c, ldc);
GEADD_K(m,n,ALPHA[0],ALPHA[1], a, lda, BETA[0], BETA[1], c, ldc,

#ifdef CBLAS
(transa == CblasTrans) || (transa == CblasConjTrans),
(transc == CblasTrans) || (transc == CblasConjTrans)
#else
transa, transc
#endif
);





FUNCTION_PROFILE_END(1, 2* m * n , 2 * m * n);
Expand Down
Loading
Loading