Merge branch 'dev'

This commit is contained in:
Field G. Van Zee
2019-03-27 17:58:19 -05:00
33 changed files with 550 additions and 255 deletions

View File

@@ -9,6 +9,7 @@ The BLIS framework was primarily authored by
but many others have contributed code and feedback, including
Sameer Agarwal @sandwichmaker (Google)
Murtaza Ali (Texas Instruments)
Sajid Ali @s-sajid-ali (Northwestern University)
Erling Andersen @erling-d-andersen

View File

@@ -50,17 +50,17 @@ Theoretical peak performance, in units of GFLOPS/core, is calculated as the
product of:
1. the maximum sustainable clock rate in GHz; and
2. the maximum number of floating-point operations (flops) that can be
executed per cycle.
executed per cycle (per core).
Note that the maximum sustainable clock rate may change depending on the
conditions.
For example, on some systems the maximum clock rate is higher when only one
core is active (e.g. single-threaded performance) versus when all cores are
active (e.g. multithreaded performance).
The maximum number of flops executable per cycle is generally computed as the
product of:
The maximum number of flops executable per cycle (per core) is generally
computed as the product of:
1. the maximum number of fused multiply-add (FMA) vector instructions that
can be issued per cycle;
can be issued per cycle (per core);
2. the maximum number of elements that can be stored within a single vector
register (for the datatype in question); and
3. 2.0, since an FMA instruction fuses two operations (a multiply and an add).
@@ -91,7 +91,7 @@ allow it to finish.
Where along the x-axis you focus your attention will depend on the segment of
the problem size range that you care about most. Some people's applications
depend heavily on smaller problems, where "small" can mean anything from 200
depend heavily on smaller problems, where "small" can mean anything from 10
to 1000 or even higher. Some people consider 1000 to be quite large, while
others insist that 5000 is merely "medium." What each of us considers to be
small, medium, or large (naturally) depends heavily on the kinds of dense
@@ -133,10 +133,16 @@ size of interest so that we can better assist you.
* sub-configuration exercised: `thunderx2`
* OpenBLAS 52d3f7a
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=0` (single-threaded)
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=1 NUM_THREADS=56` (multithreaded)
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=1 NUM_THREADS=56` (multithreaded, 56 cores)
* Requested threading via `export OPENBLAS_NUM_THREADS=1` (single-threaded)
* Requested threading via `export OPENBLAS_NUM_THREADS=28` (multithreaded, 28 cores)
* Requested threading via `export OPENBLAS_NUM_THREADS=56` (multithreaded, 56 cores)
* ARMPL 18.4
* Requested threading via `export OMP_NUM_THREADS=1` (single-threaded)
* Requested threading via `export OMP_NUM_THREADS=28` (multithreaded, 28 cores)
* Requested threading via `export OMP_NUM_THREADS=56` (multithreaded, 56 cores)
* Affinity:
* Thread affinity for BLIS was specified manually via `GOMP_CPU_AFFINITY="0 1 2 3 ... 55"`. However, multithreaded OpenBLAS appears to revert to single-threaded execution if `GOMP_CPU_AFFINITY` is set. Therefore, when measuring OpenBLAS performance, the `GOMP_CPU_AFFINITY` was unset.
* Thread affinity for BLIS was specified manually via `GOMP_CPU_AFFINITY="0 1 2 3 ... 55"`. However, multithreaded OpenBLAS appears to revert to single-threaded execution if `GOMP_CPU_AFFINITY` is set. Therefore, when measuring OpenBLAS performance, the `GOMP_CPU_AFFINITY` environment variable was unset.
* Frequency throttling (via `cpupower`):
* No changes made.
* Comments:
@@ -184,10 +190,23 @@ size of interest so that we can better assist you.
* sub-configuration exercised: `skx`
* OpenBLAS 0.3.5
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=0` (single-threaded)
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=1 NUM_THREADS=52` (multithreaded)
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=1 NUM_THREADS=52` (multithreaded, 52 cores)
* Requested threading via `export OPENBLAS_NUM_THREADS=1` (single-threaded)
* Requested threading via `export OPENBLAS_NUM_THREADS=26` (multithreaded, 26 cores)
* Requested threading via `export OPENBLAS_NUM_THREADS=52` (multithreaded, 52 cores)
* Eigen 3.3.7
* Prior to compilation, modified top-level `CMakeLists.txt` to ensure that `-march=native` was added to `CXX_FLAGS` variable (h/t Sameer Agarwal).
* configured and built BLAS library via `mkdir build; cd build; cmake ..; make blas`
* Requested threading via `export OMP_NUM_THREADS=1` (single-threaded)
* Requested threading via `export OMP_NUM_THREADS=26` (multithreaded, 26 cores)
* Requested threading via `export OMP_NUM_THREADS=52` (multithreaded, 52 cores)
* **NOTE**: This version of Eigen does not provide multithreaded implementations of `symm`/`hemm`, `syrk`/`herk`, `trmm`, or `trsm`, and therefore those curves are omitted from the multithreaded graphs.
* MKL 2019 update 1
* Requested threading via `export MKL_NUM_THREADS=1` (single-threaded)
* Requested threading via `export MKL_NUM_THREADS=26` (multithreaded, 26 cores)
* Requested threading via `export MKL_NUM_THREADS=52` (multithreaded, 52 cores)
* Affinity:
* Thread affinity for BLIS was specified manually via `GOMP_CPU_AFFINITY="0 1 2 3 ... 51"`. However, multithreaded OpenBLAS appears to revert to single-threaded execution if `GOMP_CPU_AFFINITY` is set. Therefore, when measuring OpenBLAS performance, the `GOMP_CPU_AFFINITY` was unset.
* Thread affinity for BLIS was specified manually via `GOMP_CPU_AFFINITY="0 1 2 3 ... 51"`. However, multithreaded OpenBLAS appears to revert to single-threaded execution if `GOMP_CPU_AFFINITY` is set. Therefore, when measuring OpenBLAS performance, the `GOMP_CPU_AFFINITY` environment variable was unset.
* Frequency throttling (via `cpupower`):
* No changes made.
* Comments:
@@ -235,10 +254,23 @@ size of interest so that we can better assist you.
* sub-configuration exercised: `haswell`
* OpenBLAS 0.3.5
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=0` (single-threaded)
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=1 NUM_THREADS=24` (multithreaded)
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=1 NUM_THREADS=24` (multithreaded, 24 cores)
* Requested threading via `export OPENBLAS_NUM_THREADS=1` (single-threaded)
* Requested threading via `export OPENBLAS_NUM_THREADS=12` (multithreaded, 12 cores)
* Requested threading via `export OPENBLAS_NUM_THREADS=24` (multithreaded, 24 cores)
* Eigen 3.3.7
* Prior to compilation, modified top-level `CMakeLists.txt` to ensure that `-march=native` was added to `CXX_FLAGS` variable (h/t Sameer Agarwal).
* configured and built BLAS library via `mkdir build; cd build; cmake ..; make blas`
* Requested threading via `export OMP_NUM_THREADS=1` (single-threaded)
* Requested threading via `export OMP_NUM_THREADS=12` (multithreaded, 12 cores)
* Requested threading via `export OMP_NUM_THREADS=24` (multithreaded, 24 cores)
* **NOTE**: This version of Eigen does not provide multithreaded implementations of `symm`/`hemm`, `syrk`/`herk`, `trmm`, or `trsm`, and therefore those curves are omitted from the multithreaded graphs.
* MKL 2018 update 2
* Requested threading via `export MKL_NUM_THREADS=1` (single-threaded)
* Requested threading via `export MKL_NUM_THREADS=12` (multithreaded, 12 cores)
* Requested threading via `export MKL_NUM_THREADS=24` (multithreaded, 24 cores)
* Affinity:
* Thread affinity for BLIS was specified manually via `GOMP_CPU_AFFINITY="0 1 2 3 ... 23"`. However, multithreaded OpenBLAS appears to revert to single-threaded execution if `GOMP_CPU_AFFINITY` is set. Therefore, when measuring OpenBLAS performance, the `GOMP_CPU_AFFINITY` was unset.
* Thread affinity for BLIS was specified manually via `GOMP_CPU_AFFINITY="0 1 2 3 ... 23"`. However, multithreaded OpenBLAS appears to revert to single-threaded execution if `GOMP_CPU_AFFINITY` is set. Therefore, when measuring OpenBLAS performance, the `GOMP_CPU_AFFINITY` environment variable was unset.
* Frequency throttling (via `cpupower`):
* No changes made.
* Comments:
@@ -287,10 +319,23 @@ size of interest so that we can better assist you.
* sub-configuration exercised: `zen`
* OpenBLAS 0.3.5
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=0` (single-threaded)
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=1 NUM_THREADS=64` (multithreaded)
* configured with `BINARY=64 NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 USE_THREAD=1 NUM_THREADS=64` (multithreaded, 64 cores)
* Requested threading via `export OPENBLAS_NUM_THREADS=1` (single-threaded)
* Requested threading via `export OPENBLAS_NUM_THREADS=32` (multithreaded, 32 cores)
* Requested threading via `export OPENBLAS_NUM_THREADS=64` (multithreaded, 64 cores)
* Eigen 3.3.7
* Prior to compilation, modified top-level `CMakeLists.txt` to ensure that `-march=native` was added to `CXX_FLAGS` variable (h/t Sameer Agarwal).
* configured and built BLAS library via `mkdir build; cd build; cmake ..; make blas`
* Requested threading via `export OMP_NUM_THREADS=1` (single-threaded)
* Requested threading via `export OMP_NUM_THREADS=32` (multithreaded, 32 cores)
* Requested threading via `export OMP_NUM_THREADS=64` (multithreaded, 64 cores)
* **NOTE**: This version of Eigen does not provide multithreaded implementations of `symm`/`hemm`, `syrk`/`herk`, `trmm`, or `trsm`, and therefore those curves are omitted from the multithreaded graphs.
* MKL 2019 update 1
* Requested threading via `export MKL_NUM_THREADS=1` (single-threaded)
* Requested threading via `export MKL_NUM_THREADS=32` (multithreaded, 32 cores)
* Requested threading via `export MKL_NUM_THREADS=64` (multithreaded, 64 cores)
* Affinity:
* Thread affinity for BLIS was specified manually via `GOMP_CPU_AFFINITY="0 1 2 3 ... 63"`. However, multithreaded OpenBLAS appears to revert to single-threaded execution if `GOMP_CPU_AFFINITY` is set. Therefore, when measuring OpenBLAS performance, the `GOMP_CPU_AFFINITY` was unset.
* Thread affinity for BLIS was specified manually via `GOMP_CPU_AFFINITY="0 1 2 3 ... 63"`. However, multithreaded OpenBLAS appears to revert to single-threaded execution if `GOMP_CPU_AFFINITY` is set. Therefore, when measuring OpenBLAS performance, the `GOMP_CPU_AFFINITY` environment variable was unset.
* Frequency throttling (via `cpupower`):
* Driver: acpi-cpufreq
* Governor: performance

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -81,22 +81,11 @@ endif
#
# --- BLAS and LAPACK implementations ------------------------------------------
# --- BLAS implementations -----------------------------------------------------
#
# BLIS library and header path. This is simply wherever it was installed.
#BLIS_LIB_PATH := $(INSTALL_PREFIX)/lib
#BLIS_INC_PATH := $(INSTALL_PREFIX)/include/blis
# BLIS library.
#BLIS_LIB := $(BLIS_LIB_PATH)/libblis.a
# BLAS library path(s). This is where the BLAS libraries reside.
HOME_LIB_PATH := $(HOME)/flame/lib
#VENDOR_LIB_PATH := /opt/apps/intel/13/composer_xe_2013.2.146/mkl/lib/intel64
MKL_LIB_PATH := $(HOME)/intel/mkl/lib/intel64
#VENDOR_LIB_PATH := ${MKLROOT}/lib/intel64
#ICC_LIB_PATH := /opt/apps/intel/13/composer_xe_2013.2.146/compiler/lib/intel64
HOME_LIB_PATH := $(HOME)/flame/lib
# OpenBLAS
OPENBLAS_LIB := $(HOME_LIB_PATH)/libopenblas.a
@@ -106,7 +95,13 @@ OPENBLASP_LIB := $(HOME_LIB_PATH)/libopenblasp.a
#ATLAS_LIB := $(HOME_LIB_PATH)/libf77blas.a \
# $(HOME_LIB_PATH)/libatlas.a
# Eigen
EIGEN_INC := $(HOME)/flame/eigen/include/eigen3
EIGEN_LIB := $(HOME_LIB_PATH)/libeigen_blas_static.a
EIGENP_LIB := $(EIGEN_LIB)
# MKL
MKL_LIB_PATH := $(HOME)/intel/mkl/lib/intel64
MKL_LIB := -L$(MKL_LIB_PATH) \
-lmkl_intel_lp64 \
-lmkl_core \
@@ -176,10 +171,19 @@ CFLAGS += -I$(TEST_SRC_PATH)
# Locate the libblis library to which we will link.
LIBBLIS_LINK := $(LIB_PATH)/$(LIBBLIS_L)
# Define a set of CFLAGS for use with C++ and Eigen.
CXXFLAGS := $(subst -std=c99,-std=c++11,$(CFLAGS))
CXXFLAGS += -I$(EIGEN_INC)
# Create a copy of CXXFLAGS without -fopenmp in order to disable multithreading.
CXXFLAGS_ST := -march=native $(subst -fopenmp,,$(CXXFLAGS))
CXXFLAGS_MT := -march=native $(CXXFLAGS)
# Which library?
BLI_DEF := -DBLIS
BLA_DEF := -DBLAS
EIG_DEF := -DEIGEN
# Complex implementation type
D3MHW := -DIND=BLIS_3MH
@@ -199,6 +203,7 @@ DNAT := -DIND=BLIS_NAT
#STR_1M := -DSTR=\"1m\"
STR_NAT := -DSTR=\"asm_blis\"
STR_OBL := -DSTR=\"openblas\"
STR_EIG := -DSTR=\"eigen\"
STR_VEN := -DSTR=\"vendor\"
# Single or multithreaded string
@@ -220,6 +225,7 @@ PDEF_2S := -DP_BEGIN=$(P2_BEGIN) -DP_INC=$(P2_INC) -DP_MAX=$(P2_MAX)
all: all-st all-1s all-2s
blis: blis-st blis-1s blis-2s
openblas: openblas-st openblas-1s openblas-2s
eigen: eigen-st eigen-1s eigen-2s
vendor: vendor-st vendor-1s vendor-2s
mkl: vendor
armpl: vendor
@@ -236,9 +242,10 @@ blis-2s: blis-nat-2s
blis-nat: blis-nat-st blis-nat-1s blis-nat-2s
# Define the datatypes, operations, and implementations.
DTS := s d c z
OPS := gemm hemm herk trmm trsm
IMPLS := asm_blis openblas vendor
DTS := s d c z
OPS := gemm hemm herk trmm trsm
BIMPLS := asm_blis openblas vendor
EIMPLS := eigen
# Define functions to construct object filenames from the datatypes and
# operations given an implementation. We define one function for single-
@@ -263,6 +270,13 @@ OPENBLAS_1S_BINS := $(patsubst %.o,%.x,$(OPENBLAS_1S_OBJS))
OPENBLAS_2S_OBJS := $(call get-2s-objs,openblas)
OPENBLAS_2S_BINS := $(patsubst %.o,%.x,$(OPENBLAS_2S_OBJS))
EIGEN_ST_OBJS := $(call get-st-objs,eigen)
EIGEN_ST_BINS := $(patsubst %.o,%.x,$(EIGEN_ST_OBJS))
EIGEN_1S_OBJS := $(call get-1s-objs,eigen)
EIGEN_1S_BINS := $(patsubst %.o,%.x,$(EIGEN_1S_OBJS))
EIGEN_2S_OBJS := $(call get-2s-objs,eigen)
EIGEN_2S_BINS := $(patsubst %.o,%.x,$(EIGEN_2S_OBJS))
VENDOR_ST_OBJS := $(call get-st-objs,vendor)
VENDOR_ST_BINS := $(patsubst %.o,%.x,$(VENDOR_ST_OBJS))
VENDOR_1S_OBJS := $(call get-1s-objs,vendor)
@@ -279,6 +293,10 @@ openblas-st: $(OPENBLAS_ST_BINS)
openblas-1s: $(OPENBLAS_1S_BINS)
openblas-2s: $(OPENBLAS_2S_BINS)
eigen-st: $(EIGEN_ST_BINS)
eigen-1s: $(EIGEN_1S_BINS)
eigen-2s: $(EIGEN_2S_BINS)
vendor-st: $(VENDOR_ST_BINS)
vendor-1s: $(VENDOR_1S_BINS)
vendor-2s: $(VENDOR_2S_BINS)
@@ -293,9 +311,10 @@ armpl-2s: vendor-2s
# Mark the object files as intermediate so that make will remove them
# automatically after building the binaries on which they depend.
.INTERMEDIATE: $(BLIS_NAT_ST_OBJS) $(OPENBLAS_ST_OBJS) $(VENDOR_ST_OBJS)
.INTERMEDIATE: $(BLIS_NAT_1S_OBJS) $(OPENBLAS_1S_OBJS) $(VENDOR_1S_OBJS)
.INTERMEDIATE: $(BLIS_NAT_2S_OBJS) $(OPENBLAS_2S_OBJS) $(VENDOR_2S_OBJS)
.INTERMEDIATE: $(BLIS_NAT_ST_OBJS) $(BLIS_NAT_1S_OBJS) $(BLIS_NAT_2S_OBJS)
.INTERMEDIATE: $(OPENBLAS_ST_OBJS) $(OPENBLAS_1S_OBJS) $(OPENBLAS_2S_OBJS)
.INTERMEDIATE: $(EIGEN_ST_OBJS) $(EIGEN_1S_OBJS) $(EIGEN_2S_OBJS)
.INTERMEDIATE: $(VENDOR_ST_OBJS) $(VENDOR_1S_OBJS) $(VENDOR_2S_OBJS)
# --Object file rules --
@@ -305,41 +324,86 @@ armpl-2s: vendor-2s
# A function to return the datatype cpp macro def from the datatype
# character.
get-dt-cpp = -DDT=bli_$(1)type
get-dt-cpp = $(strip \
$(if $(findstring s,$(1)),-DDT=BLIS_FLOAT -DIS_FLOAT,\
$(if $(findstring d,$(1)),-DDT=BLIS_DOUBLE -DIS_DOUBLE,\
$(if $(findstring c,$(1)),-DDT=BLIS_SCOMPLEX -DIS_SCOMPLEX,\
-DDT=BLIS_DCOMPLEX -DIS_DCOMPLEX))))
# A function to return other cpp macros that help the test driver
# identify the implementation.
#get-bl-cpp = $(strip \
# $(if $(findstring blis,$(1)),$(STR_NAT) $(BLI_DEF),\
# $(if $(findstring openblas,$(1)),$(STR_OBL) $(BLA_DEF),\
# $(if $(findstring eigen,$(1)),$(STR_EIG) $(EIG_DEF),\
# $(STR_VEN) $(BLA_DEF)))))
get-bl-cpp = $(strip \
$(if $(findstring blis,$(1)),$(STR_NAT) $(BLI_DEF),\
$(if $(findstring openblas,$(1)),$(STR_OBL) $(BLA_DEF),\
$(STR_VEN) $(BLA_DEF))))
$(if $(and $(findstring eigen,$(1)),\
$(findstring gemm,$(2))),\
$(STR_EIG) $(EIG_DEF),\
$(if $(findstring eigen,$(1)),\
$(STR_EIG) $(BLA_DEF),\
$(STR_VEN) $(BLA_DEF))))))
# Rules for BLIS and BLAS libraries.
define make-st-rule
test_$(1)$(2)_$(PS_MAX)_$(3)_st.o: test_$(op).c Makefile
$(CC) $(CFLAGS) $(PDEF_ST) $(call get-dt-cpp,$(1)) $(call get-bl-cpp,$(3)) $(DNAT) $(STR_ST) -c $$< -o $$@
$(CC) $(CFLAGS) $(PDEF_ST) $(call get-dt-cpp,$(1)) $(call get-bl-cpp,$(3),$(2)) $(DNAT) $(STR_ST) -c $$< -o $$@
endef
define make-1s-rule
test_$(1)$(2)_$(P1_MAX)_$(3)_1s.o: test_$(op).c Makefile
$(CC) $(CFLAGS) $(PDEF_1S) $(call get-dt-cpp,$(1)) $(call get-bl-cpp,$(3)) $(DNAT) $(STR_1S) -c $$< -o $$@
$(CC) $(CFLAGS) $(PDEF_1S) $(call get-dt-cpp,$(1)) $(call get-bl-cpp,$(3),$(2)) $(DNAT) $(STR_1S) -c $$< -o $$@
endef
define make-2s-rule
test_$(1)$(2)_$(P2_MAX)_$(3)_2s.o: test_$(op).c Makefile
$(CC) $(CFLAGS) $(PDEF_2S) $(call get-dt-cpp,$(1)) $(call get-bl-cpp,$(3)) $(DNAT) $(STR_2S) -c $$< -o $$@
$(CC) $(CFLAGS) $(PDEF_2S) $(call get-dt-cpp,$(1)) $(call get-bl-cpp,$(3),$(2)) $(DNAT) $(STR_2S) -c $$< -o $$@
endef
$(foreach dt,$(DTS), \
$(foreach op,$(OPS), \
$(foreach im,$(IMPLS),$(eval $(call make-st-rule,$(dt),$(op),$(im))))))
$(foreach im,$(BIMPLS),$(eval $(call make-st-rule,$(dt),$(op),$(im))))))
$(foreach dt,$(DTS), \
$(foreach op,$(OPS), \
$(foreach im,$(IMPLS),$(eval $(call make-1s-rule,$(dt),$(op),$(im))))))
$(foreach im,$(BIMPLS),$(eval $(call make-1s-rule,$(dt),$(op),$(im))))))
$(foreach dt,$(DTS), \
$(foreach op,$(OPS), \
$(foreach im,$(IMPLS),$(eval $(call make-2s-rule,$(dt),$(op),$(im))))))
$(foreach im,$(BIMPLS),$(eval $(call make-2s-rule,$(dt),$(op),$(im))))))
# Rules for Eigen.
define make-eigst-rule
test_$(1)$(2)_$(PS_MAX)_$(3)_st.o: test_$(op).c Makefile
$(CXX) $(CXXFLAGS_ST) $(PDEF_ST) $(call get-dt-cpp,$(1)) $(call get-bl-cpp,$(3),$(2)) $(DNAT) $(STR_ST) -c $$< -o $$@
endef
define make-eig1s-rule
test_$(1)$(2)_$(P1_MAX)_$(3)_1s.o: test_$(op).c Makefile
$(CXX) $(CXXFLAGS_MT) $(PDEF_1S) $(call get-dt-cpp,$(1)) $(call get-bl-cpp,$(3),$(2)) $(DNAT) $(STR_1S) -c $$< -o $$@
endef
define make-eig2s-rule
test_$(1)$(2)_$(P2_MAX)_$(3)_2s.o: test_$(op).c Makefile
$(CXX) $(CXXFLAGS_MT) $(PDEF_2S) $(call get-dt-cpp,$(1)) $(call get-bl-cpp,$(3),$(2)) $(DNAT) $(STR_2S) -c $$< -o $$@
endef
$(foreach dt,$(DTS), \
$(foreach op,$(OPS), \
$(foreach im,$(EIMPLS),$(eval $(call make-eigst-rule,$(dt),$(op),$(im))))))
$(foreach dt,$(DTS), \
$(foreach op,$(OPS), \
$(foreach im,$(EIMPLS),$(eval $(call make-eig1s-rule,$(dt),$(op),$(im))))))
$(foreach dt,$(DTS), \
$(foreach op,$(OPS), \
$(foreach im,$(EIMPLS),$(eval $(call make-eig2s-rule,$(dt),$(op),$(im))))))
# -- Executable file rules --
@@ -349,34 +413,44 @@ $(foreach im,$(IMPLS),$(eval $(call make-2s-rule,$(dt),$(op),$(im))))))
# compatibility layer. This prevents BLIS from inadvertently getting called
# for the BLAS routines we are trying to test with.
test_%_$(PS_MAX)_openblas_st.x: test_%_$(PS_MAX)_openblas_st.o $(LIBBLIS_LINK)
$(LINKER) $(strip $< $(OPENBLAS_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P1_MAX)_openblas_1s.x: test_%_$(P1_MAX)_openblas_1s.o $(LIBBLIS_LINK)
$(LINKER) $(strip $< $(OPENBLASP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P2_MAX)_openblas_2s.x: test_%_$(P2_MAX)_openblas_2s.o $(LIBBLIS_LINK)
$(LINKER) $(strip $< $(OPENBLASP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(PS_MAX)_vendor_st.x: test_%_$(PS_MAX)_vendor_st.o $(LIBBLIS_LINK)
$(LINKER) $(strip $< $(VENDOR_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P1_MAX)_vendor_1s.x: test_%_$(P1_MAX)_vendor_1s.o $(LIBBLIS_LINK)
$(LINKER) $(strip $< $(VENDORP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P2_MAX)_vendor_2s.x: test_%_$(P2_MAX)_vendor_2s.o $(LIBBLIS_LINK)
$(LINKER) $(strip $< $(VENDORP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(PS_MAX)_asm_blis_st.x: test_%_$(PS_MAX)_asm_blis_st.o $(LIBBLIS_LINK)
$(LINKER) $(strip $< $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
$(CC) $(strip $< $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P1_MAX)_asm_blis_1s.x: test_%_$(P1_MAX)_asm_blis_1s.o $(LIBBLIS_LINK)
$(LINKER) $(strip $< $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
$(CC) $(strip $< $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P2_MAX)_asm_blis_2s.x: test_%_$(P2_MAX)_asm_blis_2s.o $(LIBBLIS_LINK)
$(LINKER) $(strip $< $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
$(CC) $(strip $< $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(PS_MAX)_openblas_st.x: test_%_$(PS_MAX)_openblas_st.o $(LIBBLIS_LINK)
$(CC) $(strip $< $(OPENBLAS_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P1_MAX)_openblas_1s.x: test_%_$(P1_MAX)_openblas_1s.o $(LIBBLIS_LINK)
$(CC) $(strip $< $(OPENBLASP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P2_MAX)_openblas_2s.x: test_%_$(P2_MAX)_openblas_2s.o $(LIBBLIS_LINK)
$(CC) $(strip $< $(OPENBLASP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(PS_MAX)_eigen_st.x: test_%_$(PS_MAX)_eigen_st.o $(LIBBLIS_LINK)
$(CXX) $(strip $< $(EIGEN_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P1_MAX)_eigen_1s.x: test_%_$(P1_MAX)_eigen_1s.o $(LIBBLIS_LINK)
$(CXX) $(strip $< $(EIGENP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P2_MAX)_eigen_2s.x: test_%_$(P2_MAX)_eigen_2s.o $(LIBBLIS_LINK)
$(CXX) $(strip $< $(EIGENP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(PS_MAX)_vendor_st.x: test_%_$(PS_MAX)_vendor_st.o $(LIBBLIS_LINK)
$(CC) $(strip $< $(VENDOR_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P1_MAX)_vendor_1s.x: test_%_$(P1_MAX)_vendor_1s.o $(LIBBLIS_LINK)
$(CC) $(strip $< $(VENDORP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
test_%_$(P2_MAX)_vendor_2s.x: test_%_$(P2_MAX)_vendor_2s.o $(LIBBLIS_LINK)
$(CC) $(strip $< $(VENDORP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@)
# -- Clean rules --

View File

@@ -1,9 +1,11 @@
function r_val = plot_l3_perf( opname, ...
data_blis, ...
data_open, ...
data_eige, ...
data_vend, vend_str, ...
nth, ...
rows, cols, ...
with_eigen, ...
cfreq, ...
dfps, ...
theid )
@@ -16,6 +18,7 @@ end
% Set line properties.
color_blis = 'k'; lines_blis = '-'; markr_blis = '';
color_open = 'r'; lines_open = '--'; markr_open = 'o';
color_eige = 'm'; lines_eige = '-.'; markr_eige = 'x';
color_vend = 'b'; lines_vend = '-.'; markr_vend = '.';
% Compute the peak performance in terms of the number of double flops
@@ -48,6 +51,7 @@ titlename = sprintf( titlename, title_opname );
% Set the legend strings.
blis_legend = sprintf( 'BLIS' );
open_legend = sprintf( 'OpenBLAS' );
eige_legend = sprintf( 'Eigen' );
%vend_legend = sprintf( 'MKL' );
%vend_legend = sprintf( 'ARMPL' );
vend_legend = vend_str;
@@ -96,6 +100,15 @@ blis_ln = line( x_axis( :, 1 ), data_blis( :, flopscol ) / nth, ...
open_ln = line( x_axis( :, 1 ), data_open( :, flopscol ) / nth, ...
'Color',color_open, 'LineStyle',lines_open, ...
'LineWidth',linesize );
if data_eige(1,1) ~= -1
eige_ln = line( x_axis( :, 1 ), data_eige( :, flopscol ) / nth, ...
'Color',color_eige, 'LineStyle',lines_eige, ...
'LineWidth',linesize );
else
eige_ln = line( nan, nan, ...
'Color',color_eige, 'LineStyle',lines_eige, ...
'LineWidth',linesize );
end
vend_ln = line( x_axis( :, 1 ), data_vend( :, flopscol ) / nth, ...
'Color',color_vend, 'LineStyle',lines_vend, ...
'LineWidth',linesize );
@@ -121,45 +134,41 @@ end
if rows == 4 && cols == 5
if nth == 1 && theid == 3
leg = legend( ...
[ ...
blis_ln ...
open_ln ...
vend_ln ...
], ...
blis_legend, ...
open_legend, ...
vend_legend, ...
'Location', legend_loc );
set( leg,'Box','off' );
set( leg,'Color','none' );
set( leg,'FontSize',fontsize-3 );
set( leg,'Units','inches' );
set( leg,'Position',[11.20 12.75 0.7 0.3 ] ); % (0,2br)
if with_eigen == 1
leg = legend( [ blis_ln open_ln eige_ln vend_ln ], ...
blis_legend, open_legend, eige_legend, vend_legend, ...
'Location', legend_loc );
else
leg = legend( [ blis_ln open_ln vend_ln ], ...
blis_legend, open_legend, vend_legend, ...
'Location', legend_loc );
end
set( leg,'Box','off','Color','none','Units','inches','FontSize',fontsize-3 );
%set( leg,'Position',[11.20 12.81 0.7 0.3 ] ); % (0,2br)
set( leg,'Position',[ 4.20 12.81 0.7 0.3 ] ); % (0,0br)
elseif nth > 1 && theid == 4
leg = legend( ...
[ ...
blis_ln ...
open_ln ...
vend_ln ...
], ...
blis_legend, ...
open_legend, ...
vend_legend, ...
'Location', legend_loc );
set( leg,'Box','off' );
set( leg,'Color','none' );
set( leg,'FontSize',fontsize-3 );
set( leg,'Units','inches' );
%set( leg,'Position',[7.70 12.75 0.7 0.3 ] ); % (0,1br)
set( leg,'Position',[10.47 14.28 0.7 0.3 ] ); % (0,2tl)
if with_eigen == 1
leg = legend( [ blis_ln open_ln eige_ln vend_ln ], ...
blis_legend, open_legend, eige_legend, vend_legend, ...
'Location', legend_loc );
else
leg = legend( [ blis_ln open_ln vend_ln ], ...
blis_legend, open_legend, vend_legend, ...
'Location', legend_loc );
end
set( leg,'Box','off','Color','none','Units','inches','FontSize',fontsize-3 );
%set( leg,'Position',[7.70 12.81 0.7 0.3 ] ); % (0,1br)
set( leg,'Position',[10.47 14.17 0.7 0.3 ] ); % (0,2tl)
end
end
%set( leg,'Position',[ 4.20 12.75 0.7 0.3 ] ); % (0,0br)
%set( leg,'Position',[ 7.70 12.75 0.7 0.3 ] ); % (0,1br)
%set( leg,'Position',[10.47 14.28 0.7 0.3 ] ); % (0,2tl)
%set( leg,'Position',[11.20 12.75 0.7 0.3 ] ); % (0,2br)
%set( leg,'Position',[13.95 14.28 0.7 0.3 ] ); % (0,3tl)
%set( leg,'Position',[14.70 12.75 0.7 0.3 ] ); % (0,3br)
%set( leg,'Position',[17.45 14.28 0.7 0.3 ] ); % (0,4tl)
%set( leg,'Position',[18.22 12.75 0.7 0.3 ] ); % (0,4br)
end
end
set( ax1,'FontSize',fontsize );
set( ax1,'TitleFontSizeMultiplier',1.0 ); % default is 1.1.

View File

@@ -4,7 +4,8 @@ function r_val = plot_panel_4x5( cfreq, ...
thr_str, ...
dirpath, ...
arch_str, ...
vend_str )
vend_str, ...
with_eigen )
%cfreq = 1.8;
%dflopspercycle = 32;
@@ -13,6 +14,7 @@ function r_val = plot_panel_4x5( cfreq, ...
% results.
filetemp_blis = '%s/output_%s_%s_asm_blis.m';
filetemp_open = '%s/output_%s_%s_openblas.m';
filetemp_eige = '%s/output_%s_%s_eigen.m';
filetemp_vend = '%s/output_%s_%s_vendor.m';
% Create a variable name "template" for the variables contained in the
@@ -40,8 +42,8 @@ if 1 == 1 % matlab
set(gcf,'PaperPosition', [0 0 11 15.0]);
set(gcf,'PaperPositionMode','manual');
else % octave 4.x
set(gcf,'PaperSize', [15 19.0]);
set(gcf,'PaperPositionMode','auto');
set(gcf,'PaperSize', [15 19.0]);
set(gcf,'PaperPositionMode','auto');
end
set(gcf,'PaperOrientation','landscape');
@@ -58,7 +60,7 @@ for opi = 1:n_opnames
% Construct filenames for the data files from templates.
file_blis = sprintf( filetemp_blis, dirpath, thr_str, opname );
file_open = sprintf( filetemp_open, dirpath, thr_str, opname );
file_vend = sprintf( filetemp_vend, dirpath, thr_str, opname );
file_vend = sprintf( filetemp_vend, dirpath, thr_str, opname );
% Load the data files.
%str = sprintf( ' Loading %s', file_blis ); disp(str);
@@ -79,20 +81,38 @@ for opi = 1:n_opnames
data_open = eval( var_open ); % e.g. data_st_sgemm_openblas( :, : );
data_vend = eval( var_vend ); % e.g. data_st_sgemm_vendor( :, : );
% Only read Eigen data in select cases.
if with_eigen == 1
opname_u = opname; opname_u(1) = '_';
if nth == 1 || strcmp( opname_u, '_gemm' )
file_eige = sprintf( filetemp_eige, dirpath, thr_str, opname );
run( file_eige )
var_eige = sprintf( vartemp, thr_str, opname, 'eigen' );
data_eige = eval( var_eige ); % e.g. data_st_sgemm_eigen( :, : );
else
data_eige(1,1) = -1;
end
else
data_eige(1,1) = -1;
end
% Plot one result in an m x n grid of plots, via the subplot()
% function.
plot_l3_perf( opname, ...
data_blis, ...
data_open, ...
data_eige, ...
data_vend, vend_str, ...
nth, ...
4, 5, ...
with_eigen, ...
cfreq, ...
dflopspercycle, ...
opi );
end
% Construct the name of the file to which we will output the graph.
outfile = sprintf( 'l3_perf_%s_nt%d.pdf', arch_str, nth );

View File

@@ -4,16 +4,32 @@ plot_panel_4x5(2.20,8,28,'1s','../results/tx2/20190205/jc4ic7','tx2_jc4ic7','ARM
plot_panel_4x5(2.20,8,56,'2s','../results/tx2/20190205/jc8ic7','tx2_jc8ic7','ARMPL'); close; clear all;
% skx
plot_panel_4x5(2.00,32,1, 'st','../results/skx/20190306/st', 'skx', 'MKL'); close; clear all;
plot_panel_4x5(2.00,32,26,'1s','../results/skx/20190306/jc2ic13','skx_jc2ic13','MKL'); close; clear all;
plot_panel_4x5(2.00,32,52,'2s','../results/skx/20190306/jc4ic13','skx_jc4ic13','MKL'); close; clear all;
% pre-eigen:
%plot_panel_4x5(2.00,32,1, 'st','../results/skx/20190306/st', 'skx', 'MKL'); close; clear all;
%plot_panel_4x5(2.00,32,26,'1s','../results/skx/20190306/jc2ic13','skx_jc2ic13','MKL'); close; clear all;
%plot_panel_4x5(2.00,32,52,'2s','../results/skx/20190306/jc4ic13','skx_jc4ic13','MKL'); close; clear all;
% with eigen:
plot_panel_4x5(2.00,32,1, 'st','../results/skx/merged20190306_0326/st', 'skx', 'MKL',1); close; clear all;
plot_panel_4x5(2.00,32,26,'1s','../results/skx/merged20190306_0326/jc2ic13','skx_jc2ic13','MKL',1); close; clear all;
plot_panel_4x5(2.00,32,52,'2s','../results/skx/merged20190306_0326/jc4ic13','skx_jc4ic13','MKL',1); close; clear all;
% has
plot_panel_4x5(3.25,16,1, 'st','../results/has/20190206/st', 'has', 'MKL'); close; clear all;
plot_panel_4x5(3.00,16,12,'1s','../results/has/20190206/jc2ic3jr2','has_jc2ic3jr2','MKL'); close; clear all;
plot_panel_4x5(3.00,16,24,'2s','../results/has/20190206/jc4ic3jr2','has_jc4ic3jr2','MKL'); close; clear all;
% pre-eigen:
%plot_panel_4x5(3.25,16,1, 'st','../results/has/20190206/st', 'has', 'MKL',1); close; clear all;
%plot_panel_4x5(3.00,16,12,'1s','../results/has/20190206/jc2ic3jr2','has_jc2ic3jr2','MKL',1); close; clear all;
%plot_panel_4x5(3.00,16,24,'2s','../results/has/20190206/jc4ic3jr2','has_jc4ic3jr2','MKL',1); close; clear all;
% with eigen:
plot_panel_4x5(3.25,16,1, 'st','../results/has/merged20190206_0326/st', 'has', 'MKL',1); close; clear all;
plot_panel_4x5(3.00,16,12,'1s','../results/has/merged20190206_0326/jc2ic3jr2','has_jc2ic3jr2','MKL',1); close; clear all;
plot_panel_4x5(3.00,16,24,'2s','../results/has/merged20190206_0326/jc4ic3jr2','has_jc4ic3jr2','MKL',1); close; clear all;
% epyc
plot_panel_4x5(3.00,8,1, 'st','../results/epyc/merged201903_0619/st','epyc', 'MKL'); close; clear all;
plot_panel_4x5(2.55,8,32,'1s','../results/epyc/merged201903_0619/jc1ic8jr4','epyc_jc1ic8jr4','MKL'); close; clear all;
plot_panel_4x5(2.55,8,64,'2s','../results/epyc/merged201903_0619/jc2ic8jr4','epyc_jc2ic8jr4','MKL'); close; clear all;
% pre-eigen:
%plot_panel_4x5(3.00,8,1, 'st','../results/epyc/merged201903_0619/st','epyc', 'MKL'); close; clear all;
%plot_panel_4x5(2.55,8,32,'1s','../results/epyc/merged201903_0619/jc1ic8jr4','epyc_jc1ic8jr4','MKL'); close; clear all;
%plot_panel_4x5(2.55,8,64,'2s','../results/epyc/merged201903_0619/jc2ic8jr4','epyc_jc2ic8jr4','MKL'); close; clear all;
% with eigen:
plot_panel_4x5(3.00,8,1, 'st','../results/epyc/merged20190306_0319_0326/st', 'epyc', 'MKL',1); close; clear all;
plot_panel_4x5(2.55,8,32,'1s','../results/epyc/merged20190306_0319_0326/jc1ic8jr4','epyc_jc1ic8jr4','MKL',1); close; clear all;
plot_panel_4x5(2.55,8,64,'2s','../results/epyc/merged20190306_0319_0326/jc2ic8jr4','epyc_jc2ic8jr4','MKL',1); close; clear all;

View File

@@ -21,7 +21,8 @@ if [ ${sys} = "blis" ]; then
export GOMP_CPU_AFFINITY="0 1 2 3"
threads="jc1ic1jr1_2400
jc2ic2jr1_4000"
jc2ic3jr2_6000
jc4ic3jr2_8000"
elif [ ${sys} = "stampede2" ]; then
@@ -70,18 +71,27 @@ test_dts="d s z c"
test_ops="gemm hemm herk trmm trsm"
# Implementations to test.
impls="all"
#impls="other"
#impls="blis"
#impls="other"
impls="eigen"
#impls="all"
if [ "${impls}" = "blis" ]; then
test_impls="asm_blis"
elif [ "${impls}" = "eigen" ]; then
test_impls="eigen"
elif [ "${impls}" = "other" ]; then
test_impls="openblas vendor"
elif [ "${impls}" = "eigen" ]; then
test_impls="eigen"
else
test_impls="openblas asm_blis vendor"
@@ -138,6 +148,15 @@ for th in ${threads}; do
for op in ${test_ops}; do
# Eigen does not support multithreading for hemm, herk, trmm,
# or trsm. So if we're getting ready to execute an Eigen driver
# for one of these operations and nt > 1, we skip this test.
if [ "${im}" = "eigen" ] && \
[ "${op}" != "gemm" ] && \
[ "${nt}" != "1" ]; then
continue;
fi
# Find the threading suffix by probing the executable.
binname=$(ls ${exec_root}_${dt}${op}_${psize}_${im}_*.x)
suf_ext=${binname##*_}
@@ -148,13 +167,24 @@ for th in ${threads}; do
# Set the number of threads according to th.
if [ "${suf}" = "1s" ] || [ "${suf}" = "2s" ]; then
export BLIS_JC_NT=${jc_nt}
export BLIS_PC_NT=${pc_nt}
export BLIS_IC_NT=${ic_nt}
export BLIS_JR_NT=${jr_nt}
export BLIS_IR_NT=${ir_nt}
export OPENBLAS_NUM_THREADS=${nt}
export MKL_NUM_THREADS=${nt}
# Set the threading parameters based on the implementation
# that we are preparing to run.
if [ "${im}" = "asm_blis" ]; then
unset OMP_NUM_THREADS
export BLIS_JC_NT=${jc_nt}
export BLIS_PC_NT=${pc_nt}
export BLIS_IC_NT=${ic_nt}
export BLIS_JR_NT=${jr_nt}
export BLIS_IR_NT=${ir_nt}
elif [ "${im}" = "openblas" ]; then
unset OMP_NUM_THREADS
export OPENBLAS_NUM_THREADS=${nt}
elif [ "${im}" = "eigen" ]; then
export OMP_NUM_THREADS=${nt}
elif [ "${im}" = "vendor" ]; then
unset OMP_NUM_THREADS
export MKL_NUM_THREADS=${nt}
fi
export nt_use=${nt}
# Multithreaded OpenBLAS seems to have a problem running
@@ -173,6 +203,7 @@ for th in ${threads}; do
export BLIS_IC_NT=1
export BLIS_JR_NT=1
export BLIS_IR_NT=1
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export MKL_NUM_THREADS=1
export nt_use=1

View File

@@ -33,7 +33,15 @@
*/
#include <unistd.h>
#include "blis.h"
#ifdef EIGEN
#define BLIS_DISABLE_BLAS_DEFS
#include "blis.h"
#include <Eigen/Core>
#include <Eigen/src/misc/blas.h>
using namespace Eigen;
#else
#include "blis.h"
#endif
//#define PRINT
@@ -161,6 +169,42 @@ int main( int argc, char** argv )
bli_ind_enable_dt( ind, dt );
#endif
#ifdef EIGEN
double alpha_r, alpha_i;
bli_getsc( &alpha, &alpha_r, &alpha_i );
void* ap = bli_obj_buffer_at_off( &a );
void* bp = bli_obj_buffer_at_off( &b );
void* cp = bli_obj_buffer_at_off( &c );
const int os_a = bli_obj_col_stride( &a );
const int os_b = bli_obj_col_stride( &b );
const int os_c = bli_obj_col_stride( &c );
Stride<Dynamic,1> stride_a( os_a, 1 );
Stride<Dynamic,1> stride_b( os_b, 1 );
Stride<Dynamic,1> stride_c( os_c, 1 );
#if defined(IS_FLOAT)
Map<MatrixXf, 0, Stride<Dynamic,1> > A( ( float* )ap, m, k, stride_a );
Map<MatrixXf, 0, Stride<Dynamic,1> > B( ( float* )bp, k, n, stride_b );
Map<MatrixXf, 0, Stride<Dynamic,1> > C( ( float* )cp, m, n, stride_c );
#elif defined (IS_DOUBLE)
Map<MatrixXd, 0, Stride<Dynamic,1> > A( ( double* )ap, m, k, stride_a );
Map<MatrixXd, 0, Stride<Dynamic,1> > B( ( double* )bp, k, n, stride_b );
Map<MatrixXd, 0, Stride<Dynamic,1> > C( ( double* )cp, m, n, stride_c );
#elif defined (IS_SCOMPLEX)
Map<MatrixXcf, 0, Stride<Dynamic,1> > A( ( std::complex<float>* )ap, m, k, stride_a );
Map<MatrixXcf, 0, Stride<Dynamic,1> > B( ( std::complex<float>* )bp, k, n, stride_b );
Map<MatrixXcf, 0, Stride<Dynamic,1> > C( ( std::complex<float>* )cp, m, n, stride_c );
#elif defined (IS_DCOMPLEX)
Map<MatrixXcd, 0, Stride<Dynamic,1> > A( ( std::complex<double>* )ap, m, k, stride_a );
Map<MatrixXcd, 0, Stride<Dynamic,1> > B( ( std::complex<double>* )bp, k, n, stride_b );
Map<MatrixXcd, 0, Stride<Dynamic,1> > C( ( std::complex<double>* )cp, m, n, stride_c );
#endif
#endif
dtime_save = DBL_MAX;
for ( r = 0; r < n_repeats; ++r )
@@ -175,7 +219,7 @@ int main( int argc, char** argv )
bli_printm( "c", &c, "%4.1f", "" );
#endif
#ifdef BLIS
#if defined(BLIS)
bli_gemm( &alpha,
&a,
@@ -183,21 +227,25 @@ int main( int argc, char** argv )
&beta,
&c );
#else
#elif defined(EIGEN)
C.noalias() += alpha_r * A * B;
#else // if defined(BLAS)
if ( bli_is_float( dt ) )
{
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int nn = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
float* alphap = bli_obj_buffer( &alpha );
float* ap = bli_obj_buffer( &a );
float* bp = bli_obj_buffer( &b );
float* betap = bli_obj_buffer( &beta );
float* cp = bli_obj_buffer( &c );
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int nn = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
float* alphap = ( float* )bli_obj_buffer( &alpha );
float* ap = ( float* )bli_obj_buffer( &a );
float* bp = ( float* )bli_obj_buffer( &b );
float* betap = ( float* )bli_obj_buffer( &beta );
float* cp = ( float* )bli_obj_buffer( &c );
sgemm_( &f77_transa,
&f77_transb,
@@ -212,17 +260,17 @@ int main( int argc, char** argv )
}
else if ( bli_is_double( dt ) )
{
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int nn = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
double* alphap = bli_obj_buffer( &alpha );
double* ap = bli_obj_buffer( &a );
double* bp = bli_obj_buffer( &b );
double* betap = bli_obj_buffer( &beta );
double* cp = bli_obj_buffer( &c );
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int nn = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
double* alphap = ( double* )bli_obj_buffer( &alpha );
double* ap = ( double* )bli_obj_buffer( &a );
double* bp = ( double* )bli_obj_buffer( &b );
double* betap = ( double* )bli_obj_buffer( &beta );
double* cp = ( double* )bli_obj_buffer( &c );
dgemm_( &f77_transa,
&f77_transb,
@@ -237,17 +285,17 @@ int main( int argc, char** argv )
}
else if ( bli_is_scomplex( dt ) )
{
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int nn = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
scomplex* alphap = bli_obj_buffer( &alpha );
scomplex* ap = bli_obj_buffer( &a );
scomplex* bp = bli_obj_buffer( &b );
scomplex* betap = bli_obj_buffer( &beta );
scomplex* cp = bli_obj_buffer( &c );
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int nn = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
scomplex* alphap = ( scomplex* )bli_obj_buffer( &alpha );
scomplex* ap = ( scomplex* )bli_obj_buffer( &a );
scomplex* bp = ( scomplex* )bli_obj_buffer( &b );
scomplex* betap = ( scomplex* )bli_obj_buffer( &beta );
scomplex* cp = ( scomplex* )bli_obj_buffer( &c );
cgemm_( &f77_transa,
&f77_transb,
@@ -262,17 +310,17 @@ int main( int argc, char** argv )
}
else if ( bli_is_dcomplex( dt ) )
{
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int nn = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
dcomplex* alphap = bli_obj_buffer( &alpha );
dcomplex* ap = bli_obj_buffer( &a );
dcomplex* bp = bli_obj_buffer( &b );
dcomplex* betap = bli_obj_buffer( &beta );
dcomplex* cp = bli_obj_buffer( &c );
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int nn = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
dcomplex* alphap = ( dcomplex* )bli_obj_buffer( &alpha );
dcomplex* ap = ( dcomplex* )bli_obj_buffer( &a );
dcomplex* bp = ( dcomplex* )bli_obj_buffer( &b );
dcomplex* betap = ( dcomplex* )bli_obj_buffer( &beta );
dcomplex* cp = ( dcomplex* )bli_obj_buffer( &c );
zgemm_( &f77_transa,
&f77_transb,

View File

@@ -197,11 +197,11 @@ int main( int argc, char** argv )
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
float* alphap = bli_obj_buffer( &alpha );
float* ap = bli_obj_buffer( &a );
float* bp = bli_obj_buffer( &b );
float* betap = bli_obj_buffer( &beta );
float* cp = bli_obj_buffer( &c );
float* alphap = ( float* )bli_obj_buffer( &alpha );
float* ap = ( float* )bli_obj_buffer( &a );
float* bp = ( float* )bli_obj_buffer( &b );
float* betap = ( float* )bli_obj_buffer( &beta );
float* cp = ( float* )bli_obj_buffer( &c );
ssymm_( &f77_side,
&f77_uploa,
@@ -220,11 +220,11 @@ int main( int argc, char** argv )
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
double* alphap = bli_obj_buffer( &alpha );
double* ap = bli_obj_buffer( &a );
double* bp = bli_obj_buffer( &b );
double* betap = bli_obj_buffer( &beta );
double* cp = bli_obj_buffer( &c );
double* alphap = ( double* )bli_obj_buffer( &alpha );
double* ap = ( double* )bli_obj_buffer( &a );
double* bp = ( double* )bli_obj_buffer( &b );
double* betap = ( double* )bli_obj_buffer( &beta );
double* cp = ( double* )bli_obj_buffer( &c );
dsymm_( &f77_side,
&f77_uploa,
@@ -243,11 +243,19 @@ int main( int argc, char** argv )
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
scomplex* alphap = bli_obj_buffer( &alpha );
scomplex* ap = bli_obj_buffer( &a );
scomplex* bp = bli_obj_buffer( &b );
scomplex* betap = bli_obj_buffer( &beta );
scomplex* cp = bli_obj_buffer( &c );
#ifdef EIGEN
float* alphap = ( float* )bli_obj_buffer( &alpha );
float* ap = ( float* )bli_obj_buffer( &a );
float* bp = ( float* )bli_obj_buffer( &b );
float* betap = ( float* )bli_obj_buffer( &beta );
float* cp = ( float* )bli_obj_buffer( &c );
#else
scomplex* alphap = ( scomplex* )bli_obj_buffer( &alpha );
scomplex* ap = ( scomplex* )bli_obj_buffer( &a );
scomplex* bp = ( scomplex* )bli_obj_buffer( &b );
scomplex* betap = ( scomplex* )bli_obj_buffer( &beta );
scomplex* cp = ( scomplex* )bli_obj_buffer( &c );
#endif
chemm_( &f77_side,
&f77_uploa,
@@ -266,11 +274,19 @@ int main( int argc, char** argv )
f77_int lda = bli_obj_col_stride( &a );
f77_int ldb = bli_obj_col_stride( &b );
f77_int ldc = bli_obj_col_stride( &c );
dcomplex* alphap = bli_obj_buffer( &alpha );
dcomplex* ap = bli_obj_buffer( &a );
dcomplex* bp = bli_obj_buffer( &b );
dcomplex* betap = bli_obj_buffer( &beta );
dcomplex* cp = bli_obj_buffer( &c );
#ifdef EIGEN
double* alphap = ( double* )bli_obj_buffer( &alpha );
double* ap = ( double* )bli_obj_buffer( &a );
double* bp = ( double* )bli_obj_buffer( &b );
double* betap = ( double* )bli_obj_buffer( &beta );
double* cp = ( double* )bli_obj_buffer( &c );
#else
dcomplex* alphap = ( dcomplex* )bli_obj_buffer( &alpha );
dcomplex* ap = ( dcomplex* )bli_obj_buffer( &a );
dcomplex* bp = ( dcomplex* )bli_obj_buffer( &b );
dcomplex* betap = ( dcomplex* )bli_obj_buffer( &beta );
dcomplex* cp = ( dcomplex* )bli_obj_buffer( &c );
#endif
zhemm_( &f77_side,
&f77_uploa,

View File

@@ -36,7 +36,6 @@
#include <unistd.h>
#include "blis.h"
//#define PRINT
int main( int argc, char** argv )
@@ -190,14 +189,14 @@ int main( int argc, char** argv )
if ( bli_is_float( dt ) )
{
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
float* alphap = bli_obj_buffer( &alpha );
float* ap = bli_obj_buffer( &a );
float* betap = bli_obj_buffer( &beta );
float* cp = bli_obj_buffer( &c );
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
float* alphap = ( float* )bli_obj_buffer( &alpha );
float* ap = ( float* )bli_obj_buffer( &a );
float* betap = ( float* )bli_obj_buffer( &beta );
float* cp = ( float* )bli_obj_buffer( &c );
ssyrk_( &f77_uploc,
&f77_transa,
@@ -210,14 +209,14 @@ int main( int argc, char** argv )
}
else if ( bli_is_double( dt ) )
{
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
double* alphap = bli_obj_buffer( &alpha );
double* ap = bli_obj_buffer( &a );
double* betap = bli_obj_buffer( &beta );
double* cp = bli_obj_buffer( &c );
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
double* alphap = ( double* )bli_obj_buffer( &alpha );
double* ap = ( double* )bli_obj_buffer( &a );
double* betap = ( double* )bli_obj_buffer( &beta );
double* cp = ( double* )bli_obj_buffer( &c );
dsyrk_( &f77_uploc,
&f77_transa,
@@ -230,14 +229,21 @@ int main( int argc, char** argv )
}
else if ( bli_is_scomplex( dt ) )
{
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
float* alphap = bli_obj_buffer( &alpha );
scomplex* ap = bli_obj_buffer( &a );
float* betap = bli_obj_buffer( &beta );
scomplex* cp = bli_obj_buffer( &c );
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
#ifdef EIGEN
float* alphap = ( float* )bli_obj_buffer( &alpha );
float* ap = ( float* )bli_obj_buffer( &a );
float* betap = ( float* )bli_obj_buffer( &beta );
float* cp = ( float* )bli_obj_buffer( &c );
#else
float* alphap = ( float* )bli_obj_buffer( &alpha );
scomplex* ap = ( scomplex* )bli_obj_buffer( &a );
float* betap = ( float* )bli_obj_buffer( &beta );
scomplex* cp = ( scomplex* )bli_obj_buffer( &c );
#endif
cherk_( &f77_uploc,
&f77_transa,
@@ -250,14 +256,21 @@ int main( int argc, char** argv )
}
else if ( bli_is_dcomplex( dt ) )
{
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
double* alphap = bli_obj_buffer( &alpha );
dcomplex* ap = bli_obj_buffer( &a );
double* betap = bli_obj_buffer( &beta );
dcomplex* cp = bli_obj_buffer( &c );
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width_after_trans( &a );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
#ifdef EIGEN
double* alphap = ( double* )bli_obj_buffer( &alpha );
double* ap = ( double* )bli_obj_buffer( &a );
double* betap = ( double* )bli_obj_buffer( &beta );
double* cp = ( double* )bli_obj_buffer( &c );
#else
double* alphap = ( double* )bli_obj_buffer( &alpha );
dcomplex* ap = ( dcomplex* )bli_obj_buffer( &a );
double* betap = ( double* )bli_obj_buffer( &beta );
dcomplex* cp = ( dcomplex* )bli_obj_buffer( &c );
#endif
zherk_( &f77_uploc,
&f77_transa,

View File

@@ -36,7 +36,6 @@
#include <unistd.h>
#include "blis.h"
//#define PRINT
int main( int argc, char** argv )
@@ -152,7 +151,7 @@ int main( int argc, char** argv )
bli_obj_create( dt, 1, 1, 0, 0, &alpha );
if ( bli_does_trans( side ) )
if ( bli_is_left( side ) )
bli_obj_create( dt, m, m, 0, 0, &a );
else
bli_obj_create( dt, n, n, 0, 0, &a );
@@ -207,9 +206,9 @@ int main( int argc, char** argv )
f77_int kk = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
float* alphap = bli_obj_buffer( &alpha );
float* ap = bli_obj_buffer( &a );
float* cp = bli_obj_buffer( &c );
float* alphap = ( float* )bli_obj_buffer( &alpha );
float* ap = ( float* )bli_obj_buffer( &a );
float* cp = ( float* )bli_obj_buffer( &c );
strmm_( &f77_side,
&f77_uploa,
@@ -227,9 +226,9 @@ int main( int argc, char** argv )
f77_int kk = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
double* alphap = bli_obj_buffer( &alpha );
double* ap = bli_obj_buffer( &a );
double* cp = bli_obj_buffer( &c );
double* alphap = ( double* )bli_obj_buffer( &alpha );
double* ap = ( double* )bli_obj_buffer( &a );
double* cp = ( double* )bli_obj_buffer( &c );
dtrmm_( &f77_side,
&f77_uploa,
@@ -247,9 +246,15 @@ int main( int argc, char** argv )
f77_int kk = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
scomplex* alphap = bli_obj_buffer( &alpha );
scomplex* ap = bli_obj_buffer( &a );
scomplex* cp = bli_obj_buffer( &c );
#ifdef EIGEN
float* alphap = ( float* )bli_obj_buffer( &alpha );
float* ap = ( float* )bli_obj_buffer( &a );
float* cp = ( float* )bli_obj_buffer( &c );
#else
scomplex* alphap = ( scomplex* )bli_obj_buffer( &alpha );
scomplex* ap = ( scomplex* )bli_obj_buffer( &a );
scomplex* cp = ( scomplex* )bli_obj_buffer( &c );
#endif
ctrmm_( &f77_side,
&f77_uploa,
@@ -263,13 +268,19 @@ int main( int argc, char** argv )
}
else if ( bli_is_dcomplex( dt ) )
{
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
dcomplex* alphap = bli_obj_buffer( &alpha );
dcomplex* ap = bli_obj_buffer( &a );
dcomplex* cp = bli_obj_buffer( &c );
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
#ifdef EIGEN
double* alphap = ( double* )bli_obj_buffer( &alpha );
double* ap = ( double* )bli_obj_buffer( &a );
double* cp = ( double* )bli_obj_buffer( &c );
#else
dcomplex* alphap = ( dcomplex* )bli_obj_buffer( &alpha );
dcomplex* ap = ( dcomplex* )bli_obj_buffer( &a );
dcomplex* cp = ( dcomplex* )bli_obj_buffer( &c );
#endif
ztrmm_( &f77_side,
&f77_uploa,

View File

@@ -36,7 +36,6 @@
#include <unistd.h>
#include "blis.h"
//#define PRINT
int main( int argc, char** argv )
@@ -152,7 +151,7 @@ int main( int argc, char** argv )
bli_obj_create( dt, 1, 1, 0, 0, &alpha );
if ( bli_does_trans( side ) )
if ( bli_is_left( side ) )
bli_obj_create( dt, m, m, 0, 0, &a );
else
bli_obj_create( dt, n, n, 0, 0, &a );
@@ -211,9 +210,9 @@ int main( int argc, char** argv )
f77_int kk = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
float* alphap = bli_obj_buffer( &alpha );
float* ap = bli_obj_buffer( &a );
float* cp = bli_obj_buffer( &c );
float* alphap = ( float* )bli_obj_buffer( &alpha );
float* ap = ( float* )bli_obj_buffer( &a );
float* cp = ( float* )bli_obj_buffer( &c );
strsm_( &f77_side,
&f77_uploa,
@@ -231,9 +230,9 @@ int main( int argc, char** argv )
f77_int kk = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
double* alphap = bli_obj_buffer( &alpha );
double* ap = bli_obj_buffer( &a );
double* cp = bli_obj_buffer( &c );
double* alphap = ( double* )bli_obj_buffer( &alpha );
double* ap = ( double* )bli_obj_buffer( &a );
double* cp = ( double* )bli_obj_buffer( &c );
dtrsm_( &f77_side,
&f77_uploa,
@@ -251,9 +250,15 @@ int main( int argc, char** argv )
f77_int kk = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
scomplex* alphap = bli_obj_buffer( &alpha );
scomplex* ap = bli_obj_buffer( &a );
scomplex* cp = bli_obj_buffer( &c );
#ifdef EIGEN
float* alphap = ( float* )bli_obj_buffer( &alpha );
float* ap = ( float* )bli_obj_buffer( &a );
float* cp = ( float* )bli_obj_buffer( &c );
#else
scomplex* alphap = ( scomplex* )bli_obj_buffer( &alpha );
scomplex* ap = ( scomplex* )bli_obj_buffer( &a );
scomplex* cp = ( scomplex* )bli_obj_buffer( &c );
#endif
ctrsm_( &f77_side,
&f77_uploa,
@@ -267,13 +272,19 @@ int main( int argc, char** argv )
}
else if ( bli_is_dcomplex( dt ) )
{
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
dcomplex* alphap = bli_obj_buffer( &alpha );
dcomplex* ap = bli_obj_buffer( &a );
dcomplex* cp = bli_obj_buffer( &c );
f77_int mm = bli_obj_length( &c );
f77_int kk = bli_obj_width( &c );
f77_int lda = bli_obj_col_stride( &a );
f77_int ldc = bli_obj_col_stride( &c );
#ifdef EIGEN
double* alphap = ( double* )bli_obj_buffer( &alpha );
double* ap = ( double* )bli_obj_buffer( &a );
double* cp = ( double* )bli_obj_buffer( &c );
#else
dcomplex* alphap = ( dcomplex* )bli_obj_buffer( &alpha );
dcomplex* ap = ( dcomplex* )bli_obj_buffer( &a );
dcomplex* cp = ( dcomplex* )bli_obj_buffer( &c );
#endif
ztrsm_( &f77_side,
&f77_uploa,