Skip to content

Commit 26e1cfb

Browse files
authored
Merge pull request #1607 from martin-frbg/dynarch
Move some x86_64 DYNAMIC_ARCH targets to new DYNAMIC_OLDER option
2 parents c628c6f + 63f7395 commit 26e1cfb

File tree

8 files changed

+55
-7
lines changed

8 files changed

+55
-7
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ ifeq ($(DYNAMIC_ARCH), 1)
153153
do $(MAKE) GOTOBLAS_MAKEFILE= -C kernel TARGET_CORE=$$d kernel || exit 1 ;\
154154
done
155155
@echo DYNAMIC_ARCH=1 >> Makefile.conf_last
156+
ifeq ($(DYNAMIC_OLDER), 1)
157+
@echo DYNAMIC_OLDER=1 >> Makefile.conf_last
158+
endif
156159
endif
157160
ifdef USE_THREAD
158161
@echo USE_THREAD=$(USE_THREAD) >> Makefile.conf_last

Makefile.install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ endif
9898
@echo Generating openblas.pc in "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)"
9999
@echo 'libdir='$(OPENBLAS_LIBRARY_DIR) > "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
100100
@echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
101-
@echo 'openblas_config= USE_64BITINT='$(USE_64BITINT) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(CORE) 'MAX_THREADS='$(NUM_THREADS)>> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
101+
@echo 'openblas_config= USE_64BITINT='$(USE_64BITINT) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'DYNAMIC_OLDER='$(DYNAMIC_OLDER) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(CORE) 'MAX_THREADS='$(NUM_THREADS)>> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
102102
@echo 'version='$(VERSION) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
103103
@echo 'extralib='$(EXTRALIB) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
104104
@cat openblas.pc.in >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"

Makefile.rule

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ VERSION = 0.3.1.dev
1717
# If you want to support multiple architecture in one binary
1818
# DYNAMIC_ARCH = 1
1919

20+
# If you want the full list of x86_64 architectures supported in DYNAMIC_ARCH
21+
# mode (including individual optimizied codes for PENRYN, DUNNINGTON, OPTERON,
22+
# OPTERON_SSE3, ATOM and NANO rather than fallbacks to older architectures)
23+
# DYNAMIC_OLDER = 1
24+
2025
# C compiler including binary type(32bit / 64bit). Default is gcc.
2126
# Don't use Intel Compiler or PGI, it won't generate right codes as I expect.
2227
# CC = gcc

Makefile.system

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,18 @@ DYNAMIC_CORE = KATMAI COPPERMINE NORTHWOOD PRESCOTT BANIAS \
472472
endif
473473

474474
ifeq ($(ARCH), x86_64)
475-
DYNAMIC_CORE = PRESCOTT CORE2 PENRYN DUNNINGTON NEHALEM OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO
475+
DYNAMIC_CORE = PRESCOTT CORE2
476+
ifeq ($(DYNAMIC_OLDER), 1)
477+
DYNAMIC_CORE += PENRYN DUNNINGTON
478+
endif
479+
DYNAMIC_CORE += NEHALEM
480+
ifeq ($(DYNAMIC_OLDER), 1)
481+
DYNAMIC_CORE += OPTERON OPTERON_SSE3
482+
endif
483+
DYNAMIC_CORE += BARCELONA
484+
ifeq ($(DYNAMIC_OLDER), 1)
485+
DYNAMIC_CORE += BOBCAT ATOM NANO
486+
endif
476487
ifneq ($(NO_AVX), 1)
477488
DYNAMIC_CORE += SANDYBRIDGE BULLDOZER PILEDRIVER STEAMROLLER EXCAVATOR
478489
endif
@@ -917,6 +928,10 @@ ifeq ($(DYNAMIC_ARCH), 1)
917928
CCOMMON_OPT += -DDYNAMIC_ARCH
918929
endif
919930

931+
ifeq ($(DYNAMIC_OLDER), 1)
932+
CCOMMON_OPT += -DDYNAMIC_OLDER
933+
endif
934+
920935
ifeq ($(NO_LAPACK), 1)
921936
CCOMMON_OPT += -DNO_LAPACK
922937
#Disable LAPACK C interface

cmake/arch.cmake

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,18 @@ if (DYNAMIC_ARCH)
4949
endif ()
5050

5151
if (X86_64)
52-
set(DYNAMIC_CORE PRESCOTT CORE2 PENRYN DUNNINGTON NEHALEM OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO)
52+
set(DYNAMIC_CORE PRESCOTT CORE2)
53+
if (DYNAMIC_OLDER)
54+
set (DYNAMIC_CORE ${DYNAMIC_CORE} PENRYN DUNNINGTON)
55+
endif ()
56+
set (DYNAMIC_CORE ${DYNAMIC_CORE} NEHALEM)
57+
if (DYNAMIC_OLDER)
58+
set (DYNAMIC_CORE ${DYNAMIC_CORE} OPTERON OPTERON_SSE3)
59+
endif ()
60+
set (DYNAMIC_CORE ${DYNAMIC_CORE} BARCELONA)
61+
if (DYNAMIC_OLDER)
62+
set (DYNAMIC_CORE ${DYNAMIC_CORE} BOBCAT ATOM NANO)
63+
endif ()
5364
if (NOT NO_AVX)
5465
set(DYNAMIC_CORE ${DYNAMIC_CORE} SANDYBRIDGE BULLDOZER PILEDRIVER STEAMROLLER EXCAVATOR)
5566
endif ()

cmake/openblas.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
22
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
33

4-
openblas_config=USE_64BITINT=@USE_64BITINT@ NO_CBLAS=@NO_CBLAS@ NO_LAPACK=@NO_LAPACK@ NO_LAPACKE=@NO_LAPACKE@ DYNAMIC_ARCH=@DYNAMIC_ARCH@ NO_AFFINITY=@NO_AFFINITY@ USE_OPENMP=@USE_OPENMP@ @CORE@ MAX_THREADS=@NUM_THREADS@
4+
openblas_config=USE_64BITINT=@USE_64BITINT@ NO_CBLAS=@NO_CBLAS@ NO_LAPACK=@NO_LAPACK@ NO_LAPACKE=@NO_LAPACKE@ DYNAMIC_ARCH=@DYNAMIC_ARCH@ DYNAMIC_OLDER=@DYNAMIC_OLDER@ NO_AFFINITY=@NO_AFFINITY@ USE_OPENMP=@USE_OPENMP@ @CORE@ MAX_THREADS=@NUM_THREADS@
55
Name: OpenBLAS
66
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version
77
Version: @OPENBLAS_VERSION@

cmake/system.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ endif ()
163163

164164
if (DYNAMIC_ARCH)
165165
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_ARCH")
166+
if (DYNAMIC_OLDER)
167+
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER")
168+
endif ()
166169
endif ()
167170

168171
if (NO_LAPACK)

driver/others/dynamic.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,27 @@ EXTERN gotoblas_t gotoblas_BANIAS;
5656
EXTERN gotoblas_t gotoblas_ATHLON;
5757

5858
extern gotoblas_t gotoblas_PRESCOTT;
59+
extern gotoblas_t gotoblas_CORE2;
60+
extern gotoblas_t gotoblas_NEHALEM;
61+
extern gotoblas_t gotoblas_BARCELONA;
62+
#ifdef DYNAMIC_OLDER
5963
extern gotoblas_t gotoblas_ATOM;
6064
extern gotoblas_t gotoblas_NANO;
61-
extern gotoblas_t gotoblas_CORE2;
6265
extern gotoblas_t gotoblas_PENRYN;
6366
extern gotoblas_t gotoblas_DUNNINGTON;
64-
extern gotoblas_t gotoblas_NEHALEM;
6567
extern gotoblas_t gotoblas_OPTERON;
6668
extern gotoblas_t gotoblas_OPTERON_SSE3;
67-
extern gotoblas_t gotoblas_BARCELONA;
6869
extern gotoblas_t gotoblas_BOBCAT;
70+
#else
71+
#define gotoblas_ATOM gotoblas_NEHALEM
72+
#define gotoblas_NANO gotoblas_NEHALEM
73+
#define gotoblas_PENRYN gotoblas_CORE2
74+
#define gotoblas_DUNNINGTON gotoblas_CORE2
75+
#define gotoblas_OPTERON gotoblas_CORE2
76+
#define gotoblas_OPTERON_SSE3 gotoblas_CORE2
77+
#define gotoblas_BOBCAT gotoblas_CORE2
78+
#endif
79+
6980
#ifndef NO_AVX
7081
extern gotoblas_t gotoblas_SANDYBRIDGE;
7182
extern gotoblas_t gotoblas_BULLDOZER;

0 commit comments

Comments
 (0)