Skip to content

Commit e3d352f

Browse files
authored
Added runtime selection of 'power' config family. (#718)
Details: - Created a 'power' umbrella configuration family, which, when targeted at configure-time, will build both 'power9' and 'power10' subconfigs. (With this feature, a BLIS shared library could be compiled on a power9 system and run on power10 and vice-versa. Unoptimised code will execute if it is linked and run on any other generic system.) - This new configuration family will only work with gcc, since that is the only compiler supported by both power9 and power10 subconfigs in BLIS. - Documented power9 and power10 as supported microarchitectures in the docs/HardwareSupport.md document.
1 parent e730c68 commit e3d352f

File tree

6 files changed

+134
-2
lines changed

6 files changed

+134
-2
lines changed

config/power/bli_family_power.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
3+
BLIS
4+
An object-based framework for developing high-performance BLAS-like
5+
libraries.
6+
7+
Copyright (C) 2014, The University of Texas at Austin
8+
9+
Redistribution and use in source and binary forms, with or without
10+
modification, are permitted provided that the following conditions are
11+
met:
12+
- Redistributions of source code must retain the above copyright
13+
notice, this list of conditions and the following disclaimer.
14+
- Redistributions in binary form must reproduce the above copyright
15+
notice, this list of conditions and the following disclaimer in the
16+
documentation and/or other materials provided with the distribution.
17+
- Neither the name(s) of the copyright holder(s) nor the names of its
18+
contributors may be used to endorse or promote products derived
19+
from this software without specific prior written permission.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
33+
*/
34+
35+
//#ifndef BLIS_FAMILY_H
36+
//#define BLIS_FAMILY_H
37+
38+
39+
40+
//#endif
41+

config/power/make_defs.mk

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#
2+
#
3+
# BLIS
4+
# An object-based framework for developing high-performance BLAS-like
5+
# libraries.
6+
#
7+
# Copyright (C) 2014, The University of Texas at Austin
8+
#
9+
# Redistribution and use in source and binary forms, with or without
10+
# modification, are permitted provided that the following conditions are
11+
# met:
12+
# - Redistributions of source code must retain the above copyright
13+
# notice, this list of conditions and the following disclaimer.
14+
# - Redistributions in binary form must reproduce the above copyright
15+
# notice, this list of conditions and the following disclaimer in the
16+
# documentation and/or other materials provided with the distribution.
17+
# - Neither the name(s) of the copyright holder(s) nor the names of its
18+
# contributors may be used to endorse or promote products derived
19+
# from this software without specific prior written permission.
20+
#
21+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25+
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
#
33+
#
34+
35+
36+
# Declare the name of the current configuration and add it to the
37+
# running list of configurations included by common.mk.
38+
THIS_CONFIG := power
39+
#CONFIGS_INCL += $(THIS_CONFIG)
40+
41+
#
42+
# --- Determine the C compiler and related flags ---
43+
#
44+
45+
# NOTE: The build system will append these variables with various
46+
# general-purpose/configuration-agnostic flags in common.mk. You
47+
# may specify additional flags here as needed.
48+
CPPROCFLAGS :=
49+
CMISCFLAGS :=
50+
CPICFLAGS :=
51+
CWARNFLAGS :=
52+
53+
ifneq ($(DEBUG_TYPE),off)
54+
CDBGFLAGS := -g
55+
endif
56+
57+
ifeq ($(DEBUG_TYPE),noopt)
58+
COPTFLAGS := -O0
59+
else
60+
COPTFLAGS := -O2
61+
endif
62+
63+
# Flags specific to optimized kernels.
64+
CKOPTFLAGS := $(COPTFLAGS) -O3
65+
CKVECFLAGS :=
66+
67+
# Flags specific to reference kernels.
68+
CROPTFLAGS := $(CKOPTFLAGS)
69+
ifeq ($(CC_VENDOR),gcc)
70+
CRVECFLAGS := $(CKVECFLAGS) -funsafe-math-optimizations -ffp-contract=fast
71+
else
72+
ifeq ($(CC_VENDOR),clang)
73+
CRVECFLAGS := $(CKVECFLAGS) -funsafe-math-optimizations -ffp-contract=fast
74+
else
75+
CRVECFLAGS := $(CKVECFLAGS)
76+
endif
77+
endif
78+
79+
# Store all of the variables here to new variables containing the
80+
# configuration name.
81+
$(eval $(call store-make-defs,$(THIS_CONFIG)))
82+

config_registry

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ amd64_legacy: excavator steamroller piledriver bulldozer generic
1414
amd64: zen3 zen2 zen generic
1515
arm64: armsve firestorm thunderx2 cortexa57 cortexa53 generic
1616
arm32: cortexa15 cortexa9 generic
17+
power: power10 power9 generic
1718

1819
# Intel architectures.
1920
skx: skx/skx/haswell/zen

docs/HardwareSupport.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ A few remarks / reminders:
3939
| ARMv8.1 A64FX (SVE) | `a64fx` | `d` | |
4040
| IBM Blue Gene/Q (QPX int) | `bgq` | `d` | |
4141
| IBM Power7 (QPX int) | `power7` | `d` | |
42+
| IBM Power9 | `power9` | `sdcz` | |
43+
| IBM Power10 | `power10` | `sdcz` | |
4244
| template (C99) | `template` | `sdcz` | `sdcz` |
4345

4446
## Level-1f kernels

frame/base/bli_arch.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ arch_t bli_arch_query_id_impl( void )
175175
defined BLIS_FAMILY_AMD64 || \
176176
defined BLIS_FAMILY_X86_64 || \
177177
defined BLIS_FAMILY_ARM64 || \
178-
defined BLIS_FAMILY_ARM32
178+
defined BLIS_FAMILY_ARM32 || \
179+
defined BLIS_FAMILY_POWER
179180
id = bli_cpuid_query_id();
180181
#endif
181182

frame/include/bli_arch_config.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,12 @@ CNTX_INIT_PROTS( generic )
237237
#include "bli_family_cortexa9.h"
238238
#endif
239239

240-
// -- IBM Power --
240+
// -- IBM Power families --
241+
#ifdef BLIS_FAMILY_POWER
242+
#include "bli_family_power.h"
243+
#endif
244+
245+
// -- IBM Power architectures --
241246

242247
#ifdef BLIS_FAMILY_POWER10
243248
#include "bli_family_power10.h"

0 commit comments

Comments
 (0)