Skip to content
Open
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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,8 @@ if(NOT NO_CBLAS)
message (STATUS "Generating cblas.h in ${CMAKE_INSTALL_INCLUDEDIR}")
set(CBLAS_H ${CMAKE_BINARY_DIR}/generated/cblas.h)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/cblas.h CBLAS_H_CONTENTS)
string(REPLACE "common" "openblas_config" CBLAS_H_CONTENTS_NEW "${CBLAS_H_CONTENTS}")
string(REPLACE "common" "openblas_config" CBLAS_H_CONTENTS_NEW2 "${CBLAS_H_CONTENTS}")
string(REPLACE "OPENBLAS_EXPORT " "" CBLAS_H_CONTENTS_NEW "${CBLAS_H_CONTENTS_NEW2}")
if (NOT ${SYMBOLPREFIX} STREQUAL "")
string(REPLACE " cblas" " ${SYMBOLPREFIX}cblas" CBLAS_H_CONTENTS "${CBLAS_H_CONTENTS_NEW}")
string(REPLACE " openblas" " ${SYMBOLPREFIX}openblas" CBLAS_H_CONTENTS_NEW "${CBLAS_H_CONTENTS}")
Expand Down
3 changes: 2 additions & 1 deletion Makefile.install
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ ifdef SYMBOLSUFFIX
@sed 's/\(openblas_complex_\)\([^ ]*\)$(SYMBOLSUFFIX)/\1\2 /g' cblas.tmp > cblas.tmp2
@sed 's/goto[^() ]*/&$(SYMBOLSUFFIX)/g' cblas.tmp2 > cblas.tmp
endif
@sed 's/common/openblas_config/g' cblas.tmp > "$(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/cblas.h"
@sed 's/OPENBLAS_EXPORT //' cblas.tmp > cblas.tmp2
@sed 's/common/openblas_config/g' cblas.tmp2 > "$(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/cblas.h"
endif

ifneq ($(OSNAME), AIX)
Expand Down
508 changes: 254 additions & 254 deletions cblas.h

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion common.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ extern "C" {
#define __USE_SVID
#endif

#include "exports.h"
#ifdef BUILD_KERNEL
#include "config_kernel.h"
#else
Expand Down Expand Up @@ -193,8 +194,10 @@ extern "C" {

#ifdef NEEDBUNDERSCORE
#define BLASFUNC(FUNC) FUNC##_
#define OPENBLAS_API(FUNC) OPENBLAS_EXPORT FUNC##_
#else
#define BLASFUNC(FUNC) FUNC
#define OPENBLAS_API(FUNC) OPENBLAS_EXPORT FUNC
#endif

#undef USE_PTHREAD_LOCK
Expand Down Expand Up @@ -712,7 +715,7 @@ int get_num_proc (int);
int get_node_equal (void);
#endif

void goto_set_num_threads(int);
OPENBLAS_EXPORT void goto_set_num_threads(int);

void gotoblas_affinity_init(void);
void gotoblas_affinity_quit(void);
Expand Down
994 changes: 497 additions & 497 deletions common_interface.h

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions common_loongarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,24 @@ static inline int get_cpu_model(char *model_name) {

#if defined(ASSEMBLER) && !defined(NEEDPARAM)

#define PROLOGUE_EXPORT \
.text ;\
.align 5 ;\
.globl REALNAME ;\
.type REALNAME, @function ;\
REALNAME: ;\

#ifdef __ELF__
#define PROLOGUE \
.text ;\
.align 5 ;\
.globl REALNAME ;\
.hidden REALNAME ;\
.type REALNAME, @function ;\
REALNAME: ;\
#else
#define PROLOGUE PROLOGUE_EXPORT
#endif

#if defined(__linux__) && defined(__ELF__)
#define GNUSTACK .section .note.GNU-stack,"",@progbits
Expand Down
10 changes: 10 additions & 0 deletions common_mips.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,20 @@ static inline int blas_quickdivide(blasint x, blasint y){

#if defined(ASSEMBLER) && !defined(NEEDPARAM)

#define PROLOGUE_EXPORT \
.arm ;\
.global REALNAME ;\
REALNAME:

#ifdef __ELF__
#define PROLOGUE \
.arm ;\
.global REALNAME ;\
.hidden REALNAME ;\
REALNAME:
#else
#define PROLOGUE PROLOGUE_EXPORT
#endif

#define EPILOGUE

Expand Down
16 changes: 16 additions & 0 deletions common_mips64.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,32 @@ static inline int blas_quickdivide(blasint x, blasint y){
#define ASSEMBLER_ARCH mips64
#endif

#define PROLOGUE_EXPORT \
.text ;\
.set ASSEMBLER_ARCH ;\
.align 5 ;\
.globl REALNAME ;\
.ent REALNAME ;\
.type REALNAME, @function ;\
REALNAME: ;\
.set noreorder ;\
.set nomacro

#ifdef __ELF__
#define PROLOGUE \
.text ;\
.set ASSEMBLER_ARCH ;\
.align 5 ;\
.globl REALNAME ;\
.hidden REALNAME ;\
.ent REALNAME ;\
.type REALNAME, @function ;\
REALNAME: ;\
.set noreorder ;\
.set nomacro
#else
#define PROLOGUE PROLOGUE_EXPORT
#endif

#if defined(__linux__) && defined(__ELF__)
#define GNUSTACK .section .note.GNU-stack,"",@progbits
Expand Down
29 changes: 29 additions & 0 deletions common_power.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,13 @@ static inline int blas_quickdivide(blasint x, blasint y){
#if defined(OS_LINUX) || defined(OS_FREEBSD)
#ifndef __64BIT__
#define PROLOGUE \
.section .text;\
.align 6;\
.globl REALNAME;\
.hidden REALNAME ;\
.type REALNAME, @function;\
REALNAME:
#define PROLOGUE_EXPORT \
.section .text;\
.align 6;\
.globl REALNAME;\
Expand All @@ -541,6 +548,13 @@ static inline int blas_quickdivide(blasint x, blasint y){
#else
#if _CALL_ELF == 2
#define PROLOGUE \
.section .text;\
.align 6;\
.globl REALNAME;\
.hidden REALNAME ;\
.type REALNAME, @function;\
REALNAME:
#define PROLOGUE_EXPORT \
.section .text;\
.align 6;\
.globl REALNAME;\
Expand All @@ -549,6 +563,21 @@ static inline int blas_quickdivide(blasint x, blasint y){
#define EPILOGUE .size REALNAME, .-REALNAME
#else
#define PROLOGUE \
.section .text;\
.align 5;\
.globl REALNAME;\
.hidden REALNAME ;\
.section ".opd","aw";\
.align 3;\
REALNAME:;\
.quad .REALNAME, .TOC.@tocbase, 0;\
.previous;\
.size REALNAME, 24;\
.type .REALNAME, @function;\
.globl .REALNAME;\
.hidden .REALNAME ;\
.REALNAME:
#define PROLOGUE_EXPORT \
.section .text;\
.align 5;\
.globl REALNAME;\
Expand Down
24 changes: 23 additions & 1 deletion common_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ static __inline int blas_quickdivide(unsigned int x, unsigned int y){

#ifdef OS_DARWIN
#define PROLOGUE .text;.align 5; .globl REALNAME; REALNAME:
#define PROLOGUE_EXPORT PROLOGUE
#define EPILOGUE .subsections_via_symbols
#define PROFCODE
#endif
Expand All @@ -318,12 +319,24 @@ static __inline int blas_quickdivide(unsigned int x, unsigned int y){
#endif

#if defined(OS_WINNT) || defined(OS_CYGWIN_NT) || defined(OS_INTERIX)
#define PROLOGUE_EXPORT \
.text; \
.align 16; \
.globl REALNAME ;\
.def REALNAME;.scl 2;.type 32;.endef; \
REALNAME:

#ifdef __ELF__
#define PROLOGUE \
.text; \
.align 16; \
.globl REALNAME ;\
.hidden REALNAME ;\
.def REALNAME;.scl 2;.type 32;.endef; \
REALNAME:
#else
#define PROLOGUE PROLOGUE_EXPORT
#endif

#define PROFCODE

Expand All @@ -339,7 +352,16 @@ static __inline int blas_quickdivide(unsigned int x, unsigned int y){
.text; \
.align 16; \
.globl REALNAME ;\
.type REALNAME, @function; \
.hidden REALNAME ;\
.type REALNAME, @function; \
REALNAME: \
_CET_ENDBR

#define PROLOGUE_EXPORT \
.text; \
.align 16; \
.globl REALNAME ;\
.type REALNAME, @function; \
REALNAME: \
_CET_ENDBR

Expand Down
23 changes: 22 additions & 1 deletion common_x86_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ static __inline unsigned int blas_quickdivide(unsigned int x, unsigned int y){

#ifdef OS_DARWIN
#define PROLOGUE .text;.align 5; .globl REALNAME; REALNAME:
#define PROLOGUE_EXPORT .text;.align 5; .globl REALNAME; REALNAME:
#define EPILOGUE .subsections_via_symbols
#define PROFCODE
#endif
Expand Down Expand Up @@ -437,12 +438,23 @@ static __inline unsigned int blas_quickdivide(unsigned int x, unsigned int y){
#endif

#if defined(OS_WINDOWS) && !defined(C_PGI)
#define PROLOGUE_EXPORT \
.text; \
.align 16; \
.globl REALNAME ;\
.def REALNAME;.scl 2;.type 32;.endef; \
REALNAME:
#ifdef __ELF__
#define PROLOGUE \
.text; \
.align 16; \
.globl REALNAME ;\
.hidden REALNAME ; \
.def REALNAME;.scl 2;.type 32;.endef; \
REALNAME:
#else
#define PROLOGUE PROLOGUE_EXPORT
#endif

#define PROFCODE

Expand All @@ -454,7 +466,16 @@ static __inline unsigned int blas_quickdivide(unsigned int x, unsigned int y){
.text; \
.align 512; \
.globl REALNAME ;\
.type REALNAME, @function; \
.hidden REALNAME ;\
.type REALNAME, @function; \
REALNAME: \
_CET_ENDBR

#define PROLOGUE_EXPORT \
.text; \
.align 512; \
.globl REALNAME ;\
.type REALNAME, @function; \
REALNAME: \
_CET_ENDBR

Expand Down
2 changes: 2 additions & 0 deletions driver/others/blas_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ if (openblas_threads_callback_) {
return 0;
}

OPENBLAS_EXPORT
void goto_set_num_threads(int num_threads) {

long i;
Expand Down Expand Up @@ -933,6 +934,7 @@ void goto_set_num_threads(int num_threads) {

}

OPENBLAS_EXPORT
void openblas_set_num_threads(int num_threads) {
goto_set_num_threads(num_threads);

Expand Down
2 changes: 2 additions & 0 deletions driver/others/blas_server_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ int BLASFUNC(blas_thread_shutdown)(void){
return 0;
}

OPENBLAS_EXPORT
void goto_set_num_threads(int num_threads)
{
long i;
Expand Down Expand Up @@ -583,6 +584,7 @@ void goto_set_num_threads(int num_threads)
blas_cpu_number = num_threads;
}

OPENBLAS_EXPORT
void openblas_set_num_threads(int num)
{
goto_set_num_threads(num);
Expand Down
4 changes: 4 additions & 0 deletions driver/others/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ int blas_get_cpu_number(void){
#endif


OPENBLAS_EXPORT
int openblas_get_num_procs(void) {
#ifndef SMP
return 1;
Expand All @@ -508,6 +509,7 @@ int openblas_get_num_procs(void) {
#endif
}

OPENBLAS_EXPORT
int openblas_get_num_threads(void) {
#ifndef SMP
return 1;
Expand Down Expand Up @@ -2071,6 +2073,7 @@ int blas_get_cpu_number(void){
#endif


OPENBLAS_EXPORT
int openblas_get_num_procs(void) {
#ifndef SMP
return 1;
Expand All @@ -2079,6 +2082,7 @@ int openblas_get_num_procs(void) {
#endif
}

OPENBLAS_EXPORT
int openblas_get_num_threads(void) {
#ifndef SMP
return 1;
Expand Down
2 changes: 2 additions & 0 deletions driver/others/openblas_get_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ char *gotoblas_corename(void);
static char tmp_config_str[256];
int openblas_get_parallel(void);

OPENBLAS_EXPORT
char* CNAME(void) {
char tmpstr[20];
strcpy(tmp_config_str, openblas_config_str);
Expand All @@ -93,6 +94,7 @@ char tmpstr[20];
}


OPENBLAS_EXPORT
char* openblas_get_corename(void) {
#ifndef DYNAMIC_ARCH
return CHAR_CORENAME;
Expand Down
1 change: 1 addition & 0 deletions driver/others/openblas_get_num_procs.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

extern int openblas_get_num_procs(void);

OPENBLAS_EXPORT
int openblas_get_num_procs_(void) {
return openblas_get_num_procs();
}
1 change: 1 addition & 0 deletions driver/others/openblas_get_num_threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

extern int openblas_get_num_threads(void);

OPENBLAS_EXPORT
int openblas_get_num_threads_(void) {
return openblas_get_num_threads();
}
3 changes: 3 additions & 0 deletions driver/others/openblas_get_parallel.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ static int parallel = 0;
#endif


OPENBLAS_EXPORT

#ifdef NEEDBUNDERSCORE
int CNAME(void) {
return parallel;
}

OPENBLAS_EXPORT
int NAME(void) {
return parallel;
}
Expand Down
Loading
Loading