-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lapack 3.12.1 compatibility with blis 1.1 #848
Comments
|
Thanks for the pointer. I'll take a look |
I noted that there is already
|
This seems to be the minimal change to rename the diff --git a/frame/compat/cblas/src/cblas_f77.h b/frame/compat/cblas/src/cblas_f77.h
index acb354aa..31e9124d 100644
--- a/frame/compat/cblas/src/cblas_f77.h
+++ b/frame/compat/cblas/src/cblas_f77.h
@@ -205,10 +205,10 @@
#define F77_caxpby caxpby_
#define F77_zaxpby zaxpby_
-#define F77_sgemmt sgemmt_
-#define F77_dgemmt dgemmt_
-#define F77_cgemmt cgemmt_
-#define F77_zgemmt zgemmt_
+#define F77_sgemmt sgemmtr_
+#define F77_dgemmt dgemmtr_
+#define F77_cgemmt cgemmtr_
+#define F77_zgemmt zgemmtr_
#define F77_sgemm_batch sgemm_batch_
#define F77_dgemm_batch dgemm_batch_
diff --git a/frame/compat/extra/bla_gemmt.c b/frame/compat/extra/bla_gemmt.c
index 266663df..627a3784 100644
--- a/frame/compat/extra/bla_gemmt.c
+++ b/frame/compat/extra/bla_gemmt.c
@@ -148,7 +148,7 @@ void PASTEF77(ch,blasname) \
bli_init_auto(); \
\
/* Perform BLAS parameter checking. */ \
- PASTEBLACHK(blasname) \
+ PASTEBLACHK(blisname) \
( \
MKSTR(ch), \
MKSTR(blasname), \
@@ -226,6 +226,6 @@ void PASTEF77(ch,blasname) \
#endif
#ifdef BLIS_ENABLE_BLAS
-INSERT_GENTFUNC_BLAS( gemmt, gemmt )
+INSERT_GENTFUNC_BLAS( gemmtr, gemmt )
#endif
diff --git a/frame/compat/extra/bla_gemmt.h b/frame/compat/extra/bla_gemmt.h
index 3bef5a89..0a9de986 100644
--- a/frame/compat/extra/bla_gemmt.h
+++ b/frame/compat/extra/bla_gemmt.h
@@ -55,6 +55,6 @@ BLIS_EXPORT_BLAS void PASTEF77(ch,blasname) \
);
#ifdef BLIS_ENABLE_BLAS
-INSERT_GENTPROT_BLAS( gemmt )
+INSERT_GENTPROT_BLAS( gemmtr )
#endif |
Some packages use |
I tried the following change on master: diff --git a/frame/compat/bli_blas.h b/frame/compat/bli_blas.h
index fca75e0f..e37a7e42 100644
--- a/frame/compat/bli_blas.h
+++ b/frame/compat/bli_blas.h
@@ -71,6 +71,7 @@
// If BLIS_ENABLE_BLAS_DEFS is defined, then we should #include the BLAS
// prototypes.
#include "bli_blas_defs.h"
+BLIS_EXPORT_BLAS void sgemmtr_ __attribute__((alias("sgemmt_")));
#else
// Even if BLAS prototypes are not to be #included into blis.h, we still
// need to #include the prototypes when compiling BLIS. And gcc says
I'm confused by the preprocessor macros, and have not found where the |
The prototype in the .h file should be "normal" (exactly like sgemmt but with the name changed). Then, in the .c file put the version with attribute. An alias declaration can appear only once in the library and must be in the same translation unit as the referenced symbol. |
The following seems simple and working (I'm still trying to figure out how to make alias attribute work though). diff --git a/frame/compat/check/bla_gemmt_check.h b/frame/compat/check/bla_gemmt_check.h
index 0a754248..90c54385 100644
--- a/frame/compat/check/bla_gemmt_check.h
+++ b/frame/compat/check/bla_gemmt_check.h
@@ -89,4 +89,7 @@
} \
}
+#define bla_gemmtr_check( dt_str, op_str, uploc, transa, transb, m, k, lda, ldb, ldc ) \
+ bla_gemmt_check( dt_str, op_str, uploc, transa, transb, m, k, lda, ldb, ldc )
+
#endif
diff --git a/frame/compat/extra/bla_gemmt.c b/frame/compat/extra/bla_gemmt.c
index 266663df..a38eb55b 100644
--- a/frame/compat/extra/bla_gemmt.c
+++ b/frame/compat/extra/bla_gemmt.c
@@ -227,5 +227,6 @@ void PASTEF77(ch,blasname) \
#ifdef BLIS_ENABLE_BLAS
INSERT_GENTFUNC_BLAS( gemmt, gemmt )
+INSERT_GENTFUNC_BLAS( gemmtr , gemmt )
#endif
diff --git a/frame/compat/extra/bla_gemmt.h b/frame/compat/extra/bla_gemmt.h
index 3bef5a89..9dda6ff3 100644
--- a/frame/compat/extra/bla_gemmt.h
+++ b/frame/compat/extra/bla_gemmt.h
@@ -56,5 +56,6 @@ BLIS_EXPORT_BLAS void PASTEF77(ch,blasname) \
#ifdef BLIS_ENABLE_BLAS
INSERT_GENTPROT_BLAS( gemmt )
+INSERT_GENTPROT_BLAS( gemmtr )
#endif
I can see both |
The last remaining bit is to correctly make preprocessor concat diff --git a/frame/compat/check/bla_gemmt_check.h b/frame/compat/check/bla_gemmt_check.h
index 0a754248..90c54385 100644
--- a/frame/compat/check/bla_gemmt_check.h
+++ b/frame/compat/check/bla_gemmt_check.h
@@ -89,4 +89,7 @@
} \
}
+#define bla_gemmtr_check( dt_str, op_str, uploc, transa, transb, m, k, lda, ldb, ldc ) \
+ bla_gemmt_check( dt_str, op_str, uploc, transa, transb, m, k, lda, ldb, ldc )
+
#endif
diff --git a/frame/compat/extra/bla_gemmt.c b/frame/compat/extra/bla_gemmt.c
index 266663df..6e105126 100644
--- a/frame/compat/extra/bla_gemmt.c
+++ b/frame/compat/extra/bla_gemmt.c
@@ -39,6 +39,8 @@
//
// Define BLAS-to-BLIS interfaces.
//
+#define STRINGIFY( name ) #name
+#define EXPAND_AND_STRINGIFY( name ) STRINGIFY( name )
#ifdef BLIS_BLAS3_CALLS_TAPI
@@ -118,7 +120,9 @@ void PASTEF77(ch,blasname) \
\
/* Finalize BLIS. */ \
bli_finalize_auto(); \
-}
+}; \
+void PASTEF77 (ch, gemmtr)() \
+ __attribute__ ((alias(EXPAND_AND_STRINGIFY(PASTEF77(ch,blasname)))));
#else
@@ -221,7 +225,9 @@ void PASTEF77(ch,blasname) \
\
/* Finalize BLIS. */ \
bli_finalize_auto(); \
-}
+}; \
+void PASTEF77 (ch, gemmtr)() \
+ __attribute__ ((alias(EXPAND_AND_STRINGIFY(PASTEF77(ch,blasname)))));
#endif
diff --git a/frame/compat/extra/bla_gemmt.h b/frame/compat/extra/bla_gemmt.h
index 3bef5a89..9dda6ff3 100644
--- a/frame/compat/extra/bla_gemmt.h
+++ b/frame/compat/extra/bla_gemmt.h
@@ -56,5 +56,6 @@ BLIS_EXPORT_BLAS void PASTEF77(ch,blasname) \
#ifdef BLIS_ENABLE_BLAS
INSERT_GENTPROT_BLAS( gemmt )
+INSERT_GENTPROT_BLAS( gemmtr )
#endif
Now both |
I think |
Should the same be done for CBLAS? |
The PR is filed at #849 . I'll look into cblas later when I'm available. |
lapack 3.12.1 has introduced a couple of new symbols such as
sgemmtr_
. But it seems missing from BLIS 1.1. As described in the pull request, when we useupdate-alternatives
to switch to BLIS, the program will fail to find that symbol, see example here. Some relevant test failures from the Debian side also points to the same issue: https://qa.debian.org/excuses.php?experimental=1&package=lapack .Any suggestion on this? Is copying some code from lapack and glue them into BLIS a reasonable temporary workaround?
The text was updated successfully, but these errors were encountered: