mirror of
https://github.com/amd/blis.git
synced 2026-07-17 09:07:31 +00:00
Merge branch 'rt'
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -31,6 +31,10 @@
|
||||
config.mk
|
||||
bli_config.h
|
||||
|
||||
# -- monolithic headers --
|
||||
|
||||
include/*/*.h
|
||||
|
||||
# -- makefile fragments --
|
||||
|
||||
.fragment.mk
|
||||
|
||||
25
.travis.yml
25
.travis.yml
@@ -11,14 +11,15 @@ compiler:
|
||||
|
||||
env:
|
||||
- RUN_TEST=1 THREADING="none" BUILD_CONFIG="auto"
|
||||
- RUN_TEST=1 THREADING="none" BUILD_CONFIG="reference"
|
||||
- RUN_TEST=1 THREADING="none" BUILD_CONFIG="dunnington"
|
||||
- RUN_TEST=1 THREADING="none" BUILD_CONFIG="penryn"
|
||||
- RUN_TEST=0 THREADING="none" BUILD_CONFIG="sandybridge"
|
||||
- RUN_TEST=0 THREADING="none" BUILD_CONFIG="knl"
|
||||
- RUN_TEST=0 THREADING="none" BUILD_CONFIG="haswell"
|
||||
- RUN_TEST=0 THREADING="none" BUILD_CONFIG="knl"
|
||||
- RUN_TEST=0 THREADING="none" BUILD_CONFIG="bulldozer"
|
||||
- RUN_TEST=0 THREADING="none" BUILD_CONFIG="piledriver"
|
||||
- RUN_TEST=0 THREADING="none" BUILD_CONFIG="carrizo"
|
||||
- RUN_TEST=0 THREADING="none" BUILD_CONFIG="steamroller"
|
||||
- RUN_TEST=0 THREADING="none" BUILD_CONFIG="excavator"
|
||||
- RUN_TEST=0 THREADING="none" BUILD_CONFIG="zen"
|
||||
- RUN_TEST=0 THREADING="openmp" BUILD_CONFIG="auto"
|
||||
- RUN_TEST=0 THREADING="pthreads" BUILD_CONFIG="auto"
|
||||
|
||||
@@ -31,21 +32,23 @@ matrix:
|
||||
- os: osx
|
||||
compiler: gcc
|
||||
- os: osx
|
||||
env: RUN_TEST=1 THREADING="none" BUILD_CONFIG="reference"
|
||||
- os: osx
|
||||
env: RUN_TEST=1 THREADING="none" BUILD_CONFIG="dunnington"
|
||||
env: RUN_TEST=1 THREADING="none" BUILD_CONFIG="penryn"
|
||||
- os: osx
|
||||
env: RUN_TEST=0 THREADING="none" BUILD_CONFIG="sandybridge"
|
||||
- os: osx
|
||||
env: RUN_TEST=0 THREADING="none" BUILD_CONFIG="knl"
|
||||
- os: osx
|
||||
env: RUN_TEST=0 THREADING="none" BUILD_CONFIG="haswell"
|
||||
- os: osx
|
||||
env: RUN_TEST=0 THREADING="none" BUILD_CONFIG="knl"
|
||||
- os: osx
|
||||
env: RUN_TEST=0 THREADING="none" BUILD_CONFIG="bulldozer"
|
||||
- os: osx
|
||||
env: RUN_TEST=0 THREADING="none" BUILD_CONFIG="piledriver"
|
||||
- os: osx
|
||||
env: RUN_TEST=0 THREADING="none" BUILD_CONFIG="carrizo"
|
||||
env: RUN_TEST=0 THREADING="none" BUILD_CONFIG="steamroller"
|
||||
- os: osx
|
||||
env: RUN_TEST=0 THREADING="none" BUILD_CONFIG="excavator"
|
||||
- os: osx
|
||||
env: RUN_TEST=0 THREADING="none" BUILD_CONFIG="zen"
|
||||
- os: osx
|
||||
env: RUN_TEST=0 THREADING="openmp" BUILD_CONFIG="auto"
|
||||
|
||||
@@ -68,6 +71,6 @@ script:
|
||||
- export BLIS_JC_NT=1
|
||||
- export BLIS_IR_NT=1
|
||||
- export BLIS_JR_NT=1
|
||||
- if [ $RUN_TEST -eq 1 ]; then make BLIS_ENABLE_TEST_OUTPUT=yes test; fi
|
||||
- if [ $RUN_TEST -eq 1 ]; then travis_wait 30 make BLIS_ENABLE_TEST_OUTPUT=yes test; fi
|
||||
- if [ $RUN_TEST -eq 1 ]; then ./build/check-test.sh ./output.testsuite; fi
|
||||
|
||||
|
||||
569
Makefile
569
Makefile
@@ -47,62 +47,27 @@
|
||||
|
||||
.PHONY: all libs test install uninstall clean \
|
||||
check-env check-env-mk check-env-fragments check-env-make-defs \
|
||||
testsuite testsuite-run testsuite-bin \
|
||||
install-libs install-headers install-lib-symlinks \
|
||||
testsuite testsuite-bin testsuite-run \
|
||||
flat-header \
|
||||
install-libs install-header install-lib-symlinks \
|
||||
showconfig \
|
||||
cleanlib distclean cleanmk cleanleaves \
|
||||
cleanlib cleanh cleantest cleanmk distclean \
|
||||
changelog \
|
||||
uninstall-libs uninstall-headers uninstall-lib-symlinks \
|
||||
uninstall-libs uninstall-header uninstall-lib-symlinks \
|
||||
uninstall-old
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Makefile initialization --------------------------------------------------
|
||||
# --- Include common makefile definitions --------------------------------------
|
||||
#
|
||||
|
||||
# The base name of the BLIS library that we will build.
|
||||
BLIS_LIB_BASE_NAME := libblis
|
||||
|
||||
# Define the name of the common makefile.
|
||||
COMMON_MK_FILE := common.mk
|
||||
COMMON_MK_FILE := common.mk
|
||||
|
||||
# All makefile fragments in the tree will have this name.
|
||||
FRAGMENT_MK := .fragment.mk
|
||||
|
||||
# Locations of important files.
|
||||
CONFIG_DIR := config
|
||||
FRAME_DIR := frame
|
||||
BUILD_DIR := build
|
||||
OBJ_DIR := obj
|
||||
LIB_DIR := lib
|
||||
TESTSUITE_DIR := testsuite
|
||||
|
||||
# The names of the testsuite binary executable and related default names
|
||||
# of its input/configuration files.
|
||||
TESTSUITE_NAME := test_$(BLIS_LIB_BASE_NAME)
|
||||
TESTSUITE_CONF_GEN := input.general
|
||||
TESTSUITE_CONF_OPS := input.operations
|
||||
TESTSUITE_OUT_FILE := output.testsuite
|
||||
|
||||
# The name of the "special" directories, which contain source code that
|
||||
# use non-standard compiler flags.
|
||||
NOOPT_DIR := noopt
|
||||
KERNELS_DIR := kernels
|
||||
|
||||
# Text strings that alert the user to the fact that special source code is
|
||||
# being compiled.
|
||||
NOOPT_TEXT := "(NOTE: using flags for no optimization)"
|
||||
KERNELS_TEXT := "(NOTE: using flags for kernels)"
|
||||
|
||||
# CHANGELOG file.
|
||||
CHANGELOG := CHANGELOG
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Include common makefile --------------------------------------------------
|
||||
#
|
||||
# Construct the path to the makefile configuration file that was generated by
|
||||
# the configure script.
|
||||
COMMON_MK_PATH := $(COMMON_MK_FILE)
|
||||
|
||||
# Include the configuration file.
|
||||
-include $(COMMON_MK_FILE)
|
||||
@@ -115,26 +80,26 @@ else
|
||||
COMMON_MK_PRESENT := no
|
||||
endif
|
||||
|
||||
# Now we have access to CONFIG_NAME, which tells us which sub-directory of the
|
||||
# config directory to use as our configuration. Also using CONFIG_NAME, we
|
||||
# construct the path to the general framework source tree.
|
||||
CONFIG_PATH := $(DIST_PATH)/$(CONFIG_DIR)/$(CONFIG_NAME)
|
||||
FRAME_PATH := $(DIST_PATH)/$(FRAME_DIR)
|
||||
|
||||
# Construct base paths for the object file tree.
|
||||
BASE_OBJ_PATH := ./$(OBJ_DIR)/$(CONFIG_NAME)
|
||||
BASE_OBJ_CONFIG_PATH := $(BASE_OBJ_PATH)/$(CONFIG_DIR)
|
||||
BASE_OBJ_FRAME_PATH := $(BASE_OBJ_PATH)/$(FRAME_DIR)
|
||||
|
||||
# Construct base path for the library.
|
||||
BASE_LIB_PATH := ./$(LIB_DIR)/$(CONFIG_NAME)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Main target variable definitions -----------------------------------------
|
||||
#
|
||||
|
||||
# --- Object/library paths ---
|
||||
|
||||
# Construct the base object file path for the current configuration.
|
||||
BASE_OBJ_PATH := ./$(OBJ_DIR)/$(CONFIG_NAME)
|
||||
|
||||
# Construct base object file paths corresponding to the four locations
|
||||
# of source code.
|
||||
BASE_OBJ_CONFIG_PATH := $(BASE_OBJ_PATH)/$(CONFIG_DIR)
|
||||
BASE_OBJ_FRAME_PATH := $(BASE_OBJ_PATH)/$(FRAME_DIR)
|
||||
BASE_OBJ_REFKERN_PATH := $(BASE_OBJ_PATH)/$(REFKERN_DIR)
|
||||
BASE_OBJ_KERNELS_PATH := $(BASE_OBJ_PATH)/$(KERNELS_DIR)
|
||||
|
||||
# Construct the base path for the library.
|
||||
BASE_LIB_PATH := ./$(LIB_DIR)/$(CONFIG_NAME)
|
||||
|
||||
# Construct the architecture-version string, which will be used to name the
|
||||
# library upon installation.
|
||||
@@ -144,27 +109,23 @@ VERS_CONF := $(VERSION)-$(CONFIG_NAME)
|
||||
|
||||
# Note: These names will be modified later to include the configuration and
|
||||
# version strings.
|
||||
BLIS_LIB_NAME := $(BLIS_LIB_BASE_NAME).a
|
||||
BLIS_DLL_NAME := $(BLIS_LIB_BASE_NAME).so
|
||||
BLIS_LIB_NAME := $(BLIS_LIB_BASE_NAME).a
|
||||
BLIS_DLL_NAME := $(BLIS_LIB_BASE_NAME).so
|
||||
|
||||
# --- BLIS framework source and object variable names ---
|
||||
# Append the base library path to the library names.
|
||||
BLIS_LIB_PATH := $(BASE_LIB_PATH)/$(BLIS_LIB_NAME)
|
||||
BLIS_DLL_PATH := $(BASE_LIB_PATH)/$(BLIS_DLL_NAME)
|
||||
|
||||
# These are the makefile variables that source code files will be accumulated
|
||||
# into by the makefile fragments.
|
||||
MK_FRAME_SRC :=
|
||||
MK_CONFIG_SRC :=
|
||||
# --- BLIS framework object variable names ---
|
||||
|
||||
# These hold object filenames corresponding to above.
|
||||
MK_FRAME_OBJS :=
|
||||
MK_CONFIG_OBJS :=
|
||||
|
||||
# Append the base library path to the library names.
|
||||
MK_ALL_BLIS_LIB := $(BASE_LIB_PATH)/$(BLIS_LIB_NAME)
|
||||
MK_ALL_BLIS_DLL := $(BASE_LIB_PATH)/$(BLIS_DLL_NAME)
|
||||
MK_REFKERN_OBJS :=
|
||||
MK_KERNELS_OBJS :=
|
||||
|
||||
# --- Define install target names for static libraries ---
|
||||
|
||||
MK_BLIS_LIB := $(MK_ALL_BLIS_LIB)
|
||||
MK_BLIS_LIB := $(BLIS_LIB_PATH)
|
||||
MK_BLIS_LIB_INST := $(patsubst $(BASE_LIB_PATH)/%.a, \
|
||||
$(INSTALL_PREFIX)/lib/%.a, \
|
||||
$(MK_BLIS_LIB))
|
||||
@@ -174,7 +135,7 @@ MK_BLIS_LIB_INST_W_VERS_CONF := $(patsubst $(BASE_LIB_PATH)/%.a, \
|
||||
|
||||
# --- Define install target names for shared libraries ---
|
||||
|
||||
MK_BLIS_DLL := $(MK_ALL_BLIS_DLL)
|
||||
MK_BLIS_DLL := $(BLIS_DLL_PATH)
|
||||
MK_BLIS_DLL_INST := $(patsubst $(BASE_LIB_PATH)/%.so, \
|
||||
$(INSTALL_PREFIX)/lib/%.so, \
|
||||
$(MK_BLIS_DLL))
|
||||
@@ -209,104 +170,95 @@ MK_INCL_DIR_INST := $(INSTALL_PREFIX)/include/blis
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Include makefile fragments -----------------------------------------------
|
||||
#
|
||||
|
||||
# Initialize our list of directory paths to makefile fragments with the empty
|
||||
# list. This variable will accumulate all of the directory paths in which
|
||||
# makefile fragments reside.
|
||||
FRAGMENT_DIR_PATHS :=
|
||||
|
||||
# This variable is used by the include statements as they recursively include
|
||||
# one another. For the framework source tree ('frame' directory), we initialize
|
||||
# it to the top-level directory since that is its parent.
|
||||
PARENT_PATH := $(DIST_PATH)
|
||||
|
||||
# Recursively include all the makefile fragments in the framework itself.
|
||||
-include $(addsuffix /$(FRAGMENT_MK), $(FRAME_PATH))
|
||||
|
||||
# Now set PARENT_PATH to $(DIST_PATH)/config in preparation to include the
|
||||
# fragments in the configuration sub-directory.
|
||||
PARENT_PATH := $(DIST_PATH)/$(CONFIG_DIR)
|
||||
|
||||
# Recursively include all the makefile fragments in the configuration
|
||||
# sub-directory.
|
||||
-include $(addsuffix /$(FRAGMENT_MK), $(CONFIG_PATH))
|
||||
|
||||
# Create a list of the makefile fragments.
|
||||
MAKEFILE_FRAGMENTS := $(addsuffix /$(FRAGMENT_MK), $(FRAGMENT_DIR_PATHS))
|
||||
|
||||
# Detect whether we actually got any makefile fragments. If we didn't, then it
|
||||
# is likely that the user has not yet generated them (via configure).
|
||||
ifeq ($(strip $(MAKEFILE_FRAGMENTS)),)
|
||||
MAKEFILE_FRAGMENTS_PRESENT := no
|
||||
else
|
||||
MAKEFILE_FRAGMENTS_PRESENT := yes
|
||||
endif
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Compiler include path definitions ----------------------------------------
|
||||
#
|
||||
|
||||
# Expand the fragment paths that contain .h files to attain the set of header
|
||||
# files present in all fragment paths.
|
||||
MK_HEADER_FILES := $(foreach frag_path, . $(FRAGMENT_DIR_PATHS), \
|
||||
$(wildcard $(frag_path)/*.h))
|
||||
|
||||
# Strip the leading, internal, and trailing whitespace from our list of header
|
||||
# files. This makes the "make install-headers" much more readable.
|
||||
MK_HEADER_FILES := $(strip $(MK_HEADER_FILES))
|
||||
|
||||
# Expand the fragment paths that contain .h files, and take the first
|
||||
# expansion. Then, strip the header filename to leave the path to each header
|
||||
# location. Notice this process even weeds out duplicates! Add the config
|
||||
# directory manually since it contains FLA_config.h.
|
||||
MK_HEADER_DIR_PATHS := $(dir $(foreach frag_path, . $(FRAGMENT_DIR_PATHS), \
|
||||
$(firstword $(wildcard $(frag_path)/*.h))))
|
||||
|
||||
# Add -I to each header path so we can specify our include search paths to the
|
||||
# C compiler.
|
||||
INCLUDE_PATHS := $(strip $(patsubst %, -I%, $(MK_HEADER_DIR_PATHS)))
|
||||
CFLAGS := $(CFLAGS) $(INCLUDE_PATHS)
|
||||
CFLAGS_NOOPT := $(CFLAGS_NOOPT) $(INCLUDE_PATHS)
|
||||
CFLAGS_KERNELS := $(CFLAGS_KERNELS) $(INCLUDE_PATHS)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Special preprocessor macro definitions -----------------------------------
|
||||
#
|
||||
|
||||
# Define a C preprocessor macro to communicate the current version so that it
|
||||
# can be embedded into the library and queried later.
|
||||
VERS_DEF := -DBLIS_VERSION_STRING=\"$(VERSION)\"
|
||||
CFLAGS := $(CFLAGS) $(VERS_DEF)
|
||||
CFLAGS_NOOPT := $(CFLAGS_NOOPT) $(VERS_DEF)
|
||||
CFLAGS_KERNELS := $(CFLAGS_KERNELS) $(VERS_DEF)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Library object definitions -----------------------------------------------
|
||||
#
|
||||
|
||||
# Convert source file paths to object file paths by replacing the base source
|
||||
# directories with the base object directories, and also replacing the source
|
||||
# file suffix (eg: '.c') with '.o'.
|
||||
MK_BLIS_FRAME_OBJS := $(patsubst $(FRAME_PATH)/%.c, $(BASE_OBJ_FRAME_PATH)/%.o, \
|
||||
$(filter %.c, $(MK_FRAME_SRC)))
|
||||
# In this section, we will isolate the relevant source code filepaths and
|
||||
# convert them to lists of object filepaths. Relevant source code falls into
|
||||
# four categories: configuration source; architecture-specific kernel source;
|
||||
# reference kernel source; and general framework source.
|
||||
|
||||
MK_BLIS_CONFIG_OBJS := $(patsubst $(CONFIG_PATH)/%.S, $(BASE_OBJ_CONFIG_PATH)/%.o, \
|
||||
$(filter %.S, $(MK_CONFIG_SRC)))
|
||||
MK_BLIS_CONFIG_OBJS += $(patsubst $(CONFIG_PATH)/%.c, $(BASE_OBJ_CONFIG_PATH)/%.o, \
|
||||
$(filter %.c, $(MK_CONFIG_SRC)))
|
||||
# $(call gen-obj-paths-from-src file_exts, src_files, base_src_path, base_obj_path)
|
||||
#gen-obj-paths-from-src = $(foreach ch, $(1), \
|
||||
# $(patsubst $(3)/%.$(ch), \
|
||||
# $(4)/%.o, \
|
||||
# $(2) \
|
||||
# ) \
|
||||
# )
|
||||
|
||||
# First, identify the source code found in the configuration sub-directories.
|
||||
MK_CONFIG_C := $(filter %.c, $(MK_CONFIG_SRC))
|
||||
MK_CONFIG_S := $(filter %.s, $(MK_CONFIG_SRC))
|
||||
MK_CONFIG_SS := $(filter %.S, $(MK_CONFIG_SRC))
|
||||
MK_CONFIG_C_OBJS := $(patsubst $(CONFIG_PATH)/%.c, $(BASE_OBJ_CONFIG_PATH)/%.o, \
|
||||
$(MK_CONFIG_C) \
|
||||
)
|
||||
MK_CONFIG_S_OBJS := $(patsubst $(CONFIG_PATH)/%.s, $(BASE_OBJ_CONFIG_PATH)/%.o, \
|
||||
$(MK_CONFIG_S) \
|
||||
)
|
||||
MK_CONFIG_SS_OBJS := $(patsubst $(CONFIG_PATH)/%.S, $(BASE_OBJ_CONFIG_PATH)/%.o, \
|
||||
$(MK_CONFIG_SS) \
|
||||
)
|
||||
MK_CONFIG_OBJS := $(MK_CONFIG_C_OBJS) \
|
||||
$(MK_CONFIG_S_OBJS) \
|
||||
$(MK_CONFIG_SS_OBJS)
|
||||
|
||||
# A more concise but obfuscated way of encoding the above lines.
|
||||
#MK_CONFIG_OBJS := $(call gen-obj-paths-from-src c s S,
|
||||
# $(MK_CONFIG_SRC),
|
||||
# $(CONFIG_PATH),
|
||||
# $(BASE_OBJ_CONFIG_PATH)
|
||||
# )
|
||||
|
||||
# Now, identify all of the architecture-specific kernel source code. We
|
||||
# start by filtering only .c and .[sS] files (ignoring any .h files, though
|
||||
# there shouldn't be any), and then instantiating object file paths from the
|
||||
# source file paths. Note that MK_KERNELS_SRC is already limited to the
|
||||
# kernel source corresponding to the kernel sets in KERNEL_LIST. This
|
||||
# is because the configure script only propogated makefile fragments into
|
||||
# those specific kernel subdirectories.
|
||||
MK_KERNELS_C := $(filter %.c, $(MK_KERNELS_SRC))
|
||||
MK_KERNELS_S := $(filter %.s, $(MK_KERNELS_SRC))
|
||||
MK_KERNELS_SS := $(filter %.S, $(MK_KERNELS_SRC))
|
||||
MK_KERNELS_C_OBJS := $(patsubst $(KERNELS_PATH)/%.c, $(BASE_OBJ_KERNELS_PATH)/%.o, \
|
||||
$(MK_KERNELS_C) \
|
||||
)
|
||||
MK_KERNELS_S_OBJS := $(patsubst $(KERNELS_PATH)/%.s, $(BASE_OBJ_KERNELS_PATH)/%.o, \
|
||||
$(MK_KERNELS_S) \
|
||||
)
|
||||
MK_KERNELS_SS_OBJS := $(patsubst $(KERNELS_PATH)/%.S, $(BASE_OBJ_KERNELS_PATH)/%.o, \
|
||||
$(MK_KERNELS_SS) \
|
||||
)
|
||||
MK_KERNELS_OBJS := $(MK_KERNELS_C_OBJS) \
|
||||
$(MK_KERNELS_S_OBJS) \
|
||||
$(MK_KERNELS_SS_OBJS)
|
||||
|
||||
# Next, identify all of the reference kernel source code, then filter only
|
||||
# .c files (ignoring .h files), and finally instantiate object file paths
|
||||
# from the source files paths once for each sub-configuration in CONFIG_LIST,
|
||||
# appending the name of the sub-config to the object filename.
|
||||
MK_REFKERN_C := $(filter %.c, $(MK_REFKERN_SRC))
|
||||
MK_REFKERN_OBJS := $(foreach arch, $(CONFIG_LIST), \
|
||||
$(patsubst $(REFKERN_PATH)/%_$(REF_SUF).c, \
|
||||
$(BASE_OBJ_REFKERN_PATH)/$(arch)/%_$(arch)_$(REF_SUF).o, \
|
||||
$(MK_REFKERN_C) \
|
||||
) \
|
||||
)
|
||||
|
||||
# And now, identify all of the portable framework source code, then filter
|
||||
# only .c files (ignoring .h files), and finally instantiate object file
|
||||
# paths from the source file paths.
|
||||
MK_FRAME_C := $(filter %.c, $(MK_FRAME_SRC))
|
||||
MK_FRAME_OBJS := $(patsubst $(FRAME_PATH)/%.c, $(BASE_OBJ_FRAME_PATH)/%.o, \
|
||||
$(MK_FRAME_C) \
|
||||
)
|
||||
|
||||
# Combine all of the object files into some readily-accessible variables.
|
||||
MK_ALL_BLIS_OBJS := $(MK_BLIS_CONFIG_OBJS) \
|
||||
$(MK_BLIS_FRAME_OBJS)
|
||||
MK_BLIS_OBJS := $(MK_CONFIG_OBJS) \
|
||||
$(MK_KERNELS_OBJS) \
|
||||
$(MK_REFKERN_OBJS) \
|
||||
$(MK_FRAME_OBJS)
|
||||
|
||||
# Optionally filter out the BLAS and CBLAS compatibility layer object files.
|
||||
# This is not actually necessary, since each affected file is guarded by C
|
||||
@@ -315,14 +267,20 @@ MK_ALL_BLIS_OBJS := $(MK_BLIS_CONFIG_OBJS) \
|
||||
BASE_OBJ_BLAS_PATH := $(BASE_OBJ_FRAME_PATH)/compat
|
||||
BASE_OBJ_CBLAS_PATH := $(BASE_OBJ_FRAME_PATH)/compat/cblas
|
||||
ifeq ($(BLIS_ENABLE_CBLAS),no)
|
||||
MK_ALL_BLIS_OBJS := $(filter-out $(BASE_OBJ_CBLAS_PATH)/%.o, $(MK_ALL_BLIS_OBJS) )
|
||||
MK_BLIS_OBJS := $(filter-out $(BASE_OBJ_CBLAS_PATH)/%.o, $(MK_BLIS_OBJS) )
|
||||
endif
|
||||
ifeq ($(BLIS_ENABLE_BLAS2BLIS),no)
|
||||
MK_ALL_BLIS_OBJS := $(filter-out $(BASE_OBJ_BLAS_PATH)/%.o, $(MK_ALL_BLIS_OBJS) )
|
||||
MK_BLIS_OBJS := $(filter-out $(BASE_OBJ_BLAS_PATH)/%.o, $(MK_BLIS_OBJS) )
|
||||
endif
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Monolithic header definitions --------------------------------------------
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Test suite definitions ---------------------------------------------------
|
||||
#
|
||||
@@ -340,27 +298,14 @@ BASE_OBJ_TESTSUITE_PATH := $(BASE_OBJ_PATH)/$(TESTSUITE_DIR)
|
||||
# Convert source file paths to object file paths by replacing the base source
|
||||
# directories with the base object directories, and also replacing the source
|
||||
# file suffix (eg: '.c') with '.o'.
|
||||
MK_TESTSUITE_OBJS := $(patsubst $(TESTSUITE_SRC_PATH)/%.c, \
|
||||
MK_TESTSUITE_OBJS := $(strip \
|
||||
$(patsubst $(TESTSUITE_SRC_PATH)/%.c, \
|
||||
$(BASE_OBJ_TESTSUITE_PATH)/%.o, \
|
||||
$(wildcard $(TESTSUITE_SRC_PATH)/*.c))
|
||||
$(wildcard $(TESTSUITE_SRC_PATH)/*.c)) \
|
||||
)
|
||||
|
||||
# The test suite binary executable filename.
|
||||
ifeq ($(CONFIG_NAME),pnacl)
|
||||
# Linked executable
|
||||
MK_TESTSUITE_BIN_UNSTABLE := $(BASE_OBJ_TESTSUITE_PATH)/test_libblis.unstable.pexe
|
||||
# Finalized executable
|
||||
MK_TESTSUITE_BIN_PNACL := $(BASE_OBJ_TESTSUITE_PATH)/test_libblis.pexe
|
||||
# Translated executable (for x86-64)
|
||||
TESTSUITE_BIN := test_libblis.x86-64.nexe
|
||||
else
|
||||
ifeq ($(CONFIG_NAME),emscripten)
|
||||
# JS script name.
|
||||
TESTSUITE_BIN := test_libblis.js
|
||||
else
|
||||
# Binary executable name.
|
||||
TESTSUITE_BIN := test_libblis.x
|
||||
endif # emscripten
|
||||
endif # pnacl
|
||||
TESTSUITE_BIN := test_libblis.x
|
||||
|
||||
|
||||
|
||||
@@ -389,50 +334,112 @@ libs: blis-lib
|
||||
|
||||
test: testsuite
|
||||
|
||||
install: libs install-libs install-headers install-lib-symlinks
|
||||
install: libs install-libs install-header install-lib-symlinks
|
||||
|
||||
uninstall: uninstall-libs uninstall-lib-symlinks uninstall-headers
|
||||
uninstall: uninstall-libs uninstall-header uninstall-lib-symlinks
|
||||
|
||||
clean: cleanlib cleantest
|
||||
|
||||
|
||||
# --- Consolidated blis.h header creation ---
|
||||
|
||||
flat-header: check-env $(BLIS_H_FLAT)
|
||||
|
||||
$(BLIS_H_FLAT): $(MK_HEADER_FILES)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(FLATTEN_H) -c -v1 $(BLIS_H_SRC_PATH) $@ "$(MK_HEADER_DIR_PATHS)"
|
||||
else
|
||||
@echo -n "Generating monolithic blis.h"
|
||||
@$(FLATTEN_H) -c -v1 $(BLIS_H_SRC_PATH) $@ "$(MK_HEADER_DIR_PATHS)"
|
||||
@echo "Generated $@"
|
||||
endif
|
||||
|
||||
|
||||
# --- General source code / object code rules ---
|
||||
|
||||
# Define two functions, each of which takes one argument (an object file
|
||||
# path). The functions determine which CFLAGS and text string are needed to
|
||||
# compile the object file. Note that we match without a preceding forward slash,
|
||||
# so the directory name may have 'kernels' as a substring (e.g. 'ukernels' or
|
||||
# 'kernels_opt').
|
||||
get_cflags_for_obj = $(if $(findstring $(NOOPT_DIR),$1),$(CFLAGS_NOOPT),\
|
||||
$(if $(findstring $(KERNELS_DIR),$1),$(CFLAGS_KERNELS),\
|
||||
$(CFLAGS)))
|
||||
# FGVZ: Add support for compiling .s and .S files in 'config'/'kernels'
|
||||
# directories.
|
||||
# - May want to add an extra foreach loop around function eval/call.
|
||||
|
||||
get_ctext_for_obj = $(if $(findstring $(NOOPT_DIR),$1),$(NOOPT_TEXT),\
|
||||
$(if $(findstring $(KERNELS_DIR),$1),$(KERNELS_TEXT),))
|
||||
|
||||
$(BASE_OBJ_FRAME_PATH)/%.o: $(FRAME_PATH)/%.c $(MK_HEADER_FILES) $(MAKE_DEFS_MK_PATH)
|
||||
# first argument: a configuration name from config_list, used to look up the
|
||||
# CFLAGS to use during compilation.
|
||||
define make-config-rule
|
||||
$(BASE_OBJ_CONFIG_PATH)/$(1)/%.o: $(CONFIG_PATH)/$(1)/%.c $(BLIS_H_FLAT) $(MAKE_DEFS_MK_PATHS)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(CC) $(call get_cflags_for_obj,$@) -c $< -o $@
|
||||
$(CC) $(call get-config-cflags-for,$(1)) -c $$< -o $$@
|
||||
else
|
||||
@echo "Compiling $<" $(call get_ctext_for_obj,$@)
|
||||
@$(CC) $(call get_cflags_for_obj,$@) -c $< -o $@
|
||||
@echo "Compiling $$@" $(call get-config-text-for,$(1))
|
||||
@$(CC) $(call get-config-cflags-for,$(1)) -c $$< -o $$@
|
||||
endif
|
||||
endef
|
||||
|
||||
$(BASE_OBJ_CONFIG_PATH)/%.o: $(CONFIG_PATH)/%.c $(MK_HEADER_FILES) $(MAKE_DEFS_MK_PATH)
|
||||
# first argument: a configuration name from the union of config_list and
|
||||
# config_name, used to look up the CFLAGS to use during compilation.
|
||||
define make-frame-rule
|
||||
$(BASE_OBJ_FRAME_PATH)/%.o: $(FRAME_PATH)/%.c $(BLIS_H_FLAT) $(MAKE_DEFS_MK_PATHS)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(CC) $(call get_cflags_for_obj,$@) -c $< -o $@
|
||||
$(CC) $(call get-frame-cflags-for,$(1)) -c $$< -o $$@
|
||||
else
|
||||
@echo "Compiling $<" $(call get_ctext_for_obj,$@)
|
||||
@$(CC) $(call get_cflags_for_obj,$@) -c $< -o $@
|
||||
@echo "Compiling $$@" $(call get-frame-text-for,$(1))
|
||||
@$(CC) $(call get-frame-cflags-for,$(1)) -c $$< -o $$@
|
||||
endif
|
||||
endef
|
||||
|
||||
$(BASE_OBJ_CONFIG_PATH)/%.o: $(CONFIG_PATH)/%.S $(MK_HEADER_FILES) $(MAKE_DEFS_MK_PATH)
|
||||
# first argument: a kernel set (name) being targeted (e.g. haswell).
|
||||
define make-refkern-rule
|
||||
$(BASE_OBJ_REFKERN_PATH)/$(1)/%_$(1)_ref.o: $(REFKERN_PATH)/%_ref.c $(BLIS_H_FLAT) $(MAKE_DEFS_MK_PATHS)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(CC) $(call get_cflags_for_obj,$@) -c $< -o $@
|
||||
$(CC) $(call get-refkern-cflags-for,$(1)) -c $$< -o $$@
|
||||
else
|
||||
@echo "Compiling $<" $(call get_ctext_for_obj,$@)
|
||||
@$(CC) $(call get_cflags_for_obj,$@) -c $< -o $@
|
||||
@echo "Compiling $$@" $(call get-refkern-text-for,$(1))
|
||||
@$(CC) $(call get-refkern-cflags-for,$(1)) -c $$< -o $$@
|
||||
endif
|
||||
endef
|
||||
|
||||
# first argument: a kernel set (name) being targeted (e.g. haswell).
|
||||
# second argument: the configuration whose CFLAGS we should use in compilation.
|
||||
# third argument: the kernel file suffix being considered.
|
||||
#$(BASE_OBJ_KERNELS_PATH)/$(1)/%.o: $(KERNELS_PATH)/$(1)/%.$(3) $(MK_HEADER_FILES) $(MAKE_DEFS_MK_PATHS)
|
||||
define make-kernels-rule
|
||||
$(BASE_OBJ_KERNELS_PATH)/$(1)/%.o: $(KERNELS_PATH)/$(1)/%.c $(BLIS_H_FLAT) $(MAKE_DEFS_MK_PATHS)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(CC) $(call get-kernel-cflags-for,$(2)) -c $$< -o $$@
|
||||
else
|
||||
@echo "Compiling $$@" $(call get-kernel-text-for,$(1))
|
||||
@$(CC) $(call get-kernel-cflags-for,$(2)) -c $$< -o $$@
|
||||
endif
|
||||
endef
|
||||
|
||||
# Define functions to choose the correct sub-configuration name for the
|
||||
# given kernel set. This function is called when instantiating the
|
||||
# make-kernels-rule.
|
||||
get-config-for-kset = $(lastword $(subst :, ,$(filter $(1):%,$(KCONFIG_MAP))))
|
||||
|
||||
# Instantiate the build rule for files in the configuration directory for
|
||||
# each of the sub-configurations in CONFIG_LIST with the CFLAGS designated
|
||||
# for that sub-configuration.
|
||||
$(foreach conf, $(CONFIG_LIST), $(eval $(call make-config-rule,$(conf))))
|
||||
|
||||
# Instantiate the build rule for non-kernel framework files. Use the CFLAGS for
|
||||
# the configuration family, which exists in the directory whose name is equal to
|
||||
# CONFIG_NAME. (BTW: If it is a singleton family, then CONFIG_NAME is equal to
|
||||
# CONFIG_LIST.)
|
||||
#$(eval $(call make-frame-rule,$(firstword $(CONFIG_NAME))))
|
||||
$(foreach conf, $(CONFIG_NAME), $(eval $(call make-frame-rule,$(conf))))
|
||||
|
||||
# Instantiate the build rule for reference kernels for each of the sub-
|
||||
# configurations in CONFIG_LIST with the CFLAGS designated for that sub-
|
||||
# configuration.
|
||||
$(foreach conf, $(CONFIG_LIST), $(eval $(call make-refkern-rule,$(conf))))
|
||||
|
||||
# Instantiate the build rule for optimized kernels for each of the kernel
|
||||
# sets in KERNEL_LIST with the CFLAGS designated for the sub-configuration
|
||||
# specified by the KCONFIG_MAP.
|
||||
$(foreach kset, $(KERNEL_LIST), $(eval $(call make-kernels-rule,$(kset),$(call get-config-for-kset,$(kset)))))
|
||||
|
||||
# FGVZ: for later, to compile multiple kernel source suffixes.
|
||||
#$(foreach suf, $(KERNEL_SUFS), \
|
||||
#$(foreach kset, $(KERNEL_LIST), $(eval $(call make-kernels-rule,$(kset),$(suf)))))
|
||||
|
||||
|
||||
# --- Environment check rules ---
|
||||
@@ -450,8 +457,8 @@ ifeq ($(MAKEFILE_FRAGMENTS_PRESENT),no)
|
||||
endif
|
||||
|
||||
check-env-make-defs: check-env-fragments
|
||||
ifeq ($(MAKE_DEFS_MK_PRESENT),no)
|
||||
$(error Cannot proceed: make_defs.mk not detected! Invalid configuration)
|
||||
ifeq ($(ALL_MAKE_DEFS_MK_PRESENT),no)
|
||||
$(error Cannot proceed: Some make_defs.mk files not found or mislabeled!)
|
||||
endif
|
||||
|
||||
|
||||
@@ -462,7 +469,7 @@ blis-lib: check-env $(MK_LIBS)
|
||||
|
||||
# --- Static library archiver rules ---
|
||||
|
||||
$(MK_ALL_BLIS_LIB): $(MK_ALL_BLIS_OBJS)
|
||||
$(MK_BLIS_LIB): $(MK_BLIS_OBJS)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(AR) $(ARFLAGS) $@ $?
|
||||
$(RANLIB) $@
|
||||
@@ -475,7 +482,7 @@ endif
|
||||
|
||||
# --- Dynamic library linker rules ---
|
||||
|
||||
$(MK_ALL_BLIS_DLL): $(MK_ALL_BLIS_OBJS)
|
||||
$(MK_BLIS_DLL): $(MK_BLIS_OBJS)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(LINKER) $(SOFLAGS) $(LDFLAGS) -o $@ $?
|
||||
else
|
||||
@@ -492,58 +499,12 @@ testsuite-bin: check-env $(TESTSUITE_BIN)
|
||||
|
||||
$(BASE_OBJ_TESTSUITE_PATH)/%.o: $(TESTSUITE_SRC_PATH)/%.c
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
$(CC) $(call get-frame-cflags-for,$(CONFIG_NAME)) -c $< -o $@
|
||||
else
|
||||
@echo "Compiling $<"
|
||||
@$(CC) $(CFLAGS) -c $< -o $@
|
||||
@$(CC) $(call get-frame-cflags-for,$(CONFIG_NAME)) -c $< -o $@
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NAME),pnacl)
|
||||
|
||||
# Link executable (produces unstable LLVM bitcode)
|
||||
$(MK_TESTSUITE_BIN_UNSTABLE): $(MK_TESTSUITE_OBJS) $(MK_BLIS_LIB)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(LINKER) $(MK_TESTSUITE_OBJS) $(MK_BLIS_LIB) $(LDFLAGS) -o $@
|
||||
else
|
||||
@echo "Linking $@ against '$(MK_BLIS_LIB) $(LDFLAGS)'"
|
||||
@$(LINKER) $(MK_TESTSUITE_OBJS) $(MK_BLIS_LIB) $(LDFLAGS) -o $@
|
||||
endif
|
||||
|
||||
# Finalize PNaCl executable (i.e. convert from LLVM bitcode to PNaCl bitcode)
|
||||
$(MK_TESTSUITE_BIN_PNACL): $(MK_TESTSUITE_BIN_UNSTABLE)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(FINALIZER) $(FINFLAGS) -o $@ $<
|
||||
else
|
||||
@echo "Finalizing $@"
|
||||
@$(FINALIZER) $(FINFLAGS) -o $@ $<
|
||||
endif
|
||||
|
||||
# Translate PNaCl executable to x86-64 NaCl executable
|
||||
$(TESTSUITE_BIN): $(MK_TESTSUITE_BIN_PNACL)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(TRANSLATOR) $(TRNSFLAGS) $(TRNSAMD64FLAGS) $< -o $@
|
||||
else
|
||||
@echo "Translating $< -> $@"
|
||||
@$(TRANSLATOR) $(TRNSFLAGS) $(TRNSAMD64FLAGS) $< -o $@
|
||||
endif
|
||||
|
||||
else # Non-PNaCl case
|
||||
|
||||
ifeq ($(CONFIG_NAME),emscripten)
|
||||
# Generate JavaScript and embed testsuite resources normally
|
||||
$(TESTSUITE_BIN): $(MK_TESTSUITE_OBJS) $(MK_BLIS_LIB) $(TESTSUITE_CONF_GEN_PATH) $(TESTSUITE_CONF_OPS_PATH)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(LINKER) $(MK_TESTSUITE_OBJS) $(MK_BLIS_LIB) $(LDFLAGS) -o $@ \
|
||||
--embed-file $(TESTSUITE_CONF_GEN_PATH)@input.general \
|
||||
--embed-file $(TESTSUITE_CONF_OPS_PATH)@input.operations
|
||||
else
|
||||
@echo "Linking $@ against '$(MK_BLIS_LIB) $(LDFLAGS)'"
|
||||
@$(LINKER) $(MK_TESTSUITE_OBJS) $(MK_BLIS_LIB) $(LDFLAGS) -o $@ \
|
||||
--embed-file $(TESTSUITE_CONF_GEN_PATH)@input.general \
|
||||
--embed-file $(TESTSUITE_CONF_OPS_PATH)@input.operations
|
||||
endif
|
||||
else
|
||||
# Link executable normally
|
||||
$(TESTSUITE_BIN): $(MK_TESTSUITE_OBJS) $(MK_BLIS_LIB)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(LINKER) $(MK_TESTSUITE_OBJS) $(MK_BLIS_LIB) $(LDFLAGS) -o $@
|
||||
@@ -551,67 +512,35 @@ else
|
||||
@echo "Linking $@ against '$(MK_BLIS_LIB) $(LDFLAGS)'"
|
||||
@$(LINKER) $(MK_TESTSUITE_OBJS) $(MK_BLIS_LIB) $(LDFLAGS) -o $@
|
||||
endif
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
testsuite-run: testsuite-bin
|
||||
ifeq ($(CONFIG_NAME),pnacl)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(NACL_SDK_ROOT)/tools/sel_ldr_x86_64 -a -c -q \
|
||||
-B $(NACL_SDK_ROOT)/tools/irt_core_x86_64.nexe -- \
|
||||
$(TESTSUITE_BIN) -g $(TESTSUITE_CONF_GEN_PATH) \
|
||||
-o $(TESTSUITE_CONF_OPS_PATH) \
|
||||
> $(TESTSUITE_OUT_FILE)
|
||||
else
|
||||
@echo "Running $(TESTSUITE_BIN) with output redirected to '$(TESTSUITE_OUT_FILE)'"
|
||||
@$(NACL_SDK_ROOT)/tools/sel_ldr_x86_64 -a -c -q \
|
||||
-B $(NACL_SDK_ROOT)/tools/irt_core_x86_64.nexe -- \
|
||||
$(TESTSUITE_BIN) -g $(TESTSUITE_CONF_GEN_PATH) \
|
||||
-o $(TESTSUITE_CONF_OPS_PATH) \
|
||||
> $(TESTSUITE_OUT_FILE)
|
||||
endif
|
||||
else
|
||||
ifeq ($(CONFIG_NAME),emscripten)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(JSINT) $(TESTSUITE_BIN)
|
||||
else
|
||||
@echo "Running $(TESTSUITE_BIN)"
|
||||
@$(JSINT) $(TESTSUITE_BIN)
|
||||
endif
|
||||
else
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
./$(TESTSUITE_BIN) -g $(TESTSUITE_CONF_GEN_PATH) \
|
||||
-o $(TESTSUITE_CONF_OPS_PATH) \
|
||||
> $(TESTSUITE_OUT_FILE)
|
||||
|
||||
else ifeq ($(BLIS_ENABLE_TEST_OUTPUT), yes)
|
||||
./$(TESTSUITE_BIN) -g $(TESTSUITE_CONF_GEN_PATH) \
|
||||
-o $(TESTSUITE_CONF_OPS_PATH) | \
|
||||
tee $(TESTSUITE_OUT_FILE)
|
||||
else
|
||||
@echo "Running $(TESTSUITE_BIN) with output redirected to '$(TESTSUITE_OUT_FILE)'"
|
||||
@./$(TESTSUITE_BIN) -g $(TESTSUITE_CONF_GEN_PATH) \
|
||||
-o $(TESTSUITE_CONF_OPS_PATH) \
|
||||
> $(TESTSUITE_OUT_FILE)
|
||||
endif
|
||||
endif # emscripten
|
||||
endif # pnacl
|
||||
|
||||
# --- Install rules ---
|
||||
|
||||
install-libs: check-env $(MK_LIBS_INST_W_VERS_CONF)
|
||||
|
||||
install-headers: check-env $(MK_INCL_DIR_INST)
|
||||
install-header: check-env $(MK_INCL_DIR_INST)
|
||||
|
||||
$(MK_INCL_DIR_INST): $(MK_HEADER_FILES) $(CONFIG_MK_FILE)
|
||||
$(MK_INCL_DIR_INST): $(BLIS_H_FLAT) $(CONFIG_MK_FILE)
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(MKDIR) $(@)
|
||||
$(INSTALL) -m 0644 $(MK_HEADER_FILES) $(@)
|
||||
$(INSTALL) -m 0644 $(BLIS_H_FLAT) $(@)
|
||||
else
|
||||
@$(MKDIR) $(@)
|
||||
@echo "Installing C header files into $(@)/"
|
||||
@$(INSTALL) -m 0644 $(MK_HEADER_FILES) $(@)
|
||||
@echo "Installing $(BLIS_H) into $(@)/"
|
||||
@$(INSTALL) -m 0644 $(BLIS_H_FLAT) $(@)
|
||||
endif
|
||||
|
||||
$(INSTALL_PREFIX)/lib/%-$(VERS_CONF).a: $(BASE_LIB_PATH)/%.a $(CONFIG_MK_FILE)
|
||||
@@ -663,28 +592,45 @@ endif
|
||||
# --- Query current configuration ---
|
||||
|
||||
showconfig: check-env
|
||||
@echo "Current configuration is '$(CONFIG_NAME)', located in '$(CONFIG_PATH)'"
|
||||
@echo "configuration family: $(CONFIG_NAME)"
|
||||
@echo "sub-configurations: $(CONFIG_LIST)"
|
||||
@echo "requisite kernels: $(KERNEL_LIST)"
|
||||
@echo "kernel-to-config map: $(KCONFIG_MAP)"
|
||||
@echo "-----------------------"
|
||||
@echo "BLIS version string: $(VERSION)"
|
||||
@echo "install prefix: $(INSTALL_PREFIX)"
|
||||
@echo "debugging status: $(DEBUG_TYPE)"
|
||||
@echo "multithreading status: $(THREADING_MODEL)"
|
||||
@echo "enable BLAS API? $(BLIS_ENABLE_BLAS2BLIS)"
|
||||
@echo "enable CBLAS API? $(BLIS_ENABLE_CBLAS)"
|
||||
@echo "build static library? $(BLIS_ENABLE_STATIC_BUILD)"
|
||||
@echo "build shared library? $(BLIS_ENABLE_DYNAMIC_BUILD)"
|
||||
|
||||
|
||||
# --- Clean rules ---
|
||||
|
||||
cleanlib: check-env
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
- $(FIND) $(BASE_OBJ_CONFIG_PATH) -name "*.o" | $(XARGS) $(RM_F)
|
||||
- $(FIND) $(BASE_OBJ_FRAME_PATH) -name "*.o" | $(XARGS) $(RM_F)
|
||||
- $(FIND) $(BASE_OBJ_PATH) -name "*.o" | $(XARGS) $(RM_F)
|
||||
- $(FIND) $(BASE_LIB_PATH) -name "*.a" | $(XARGS) $(RM_F)
|
||||
- $(FIND) $(BASE_LIB_PATH) -name "*.so" | $(XARGS) $(RM_F)
|
||||
else
|
||||
@echo "Removing .o files from $(BASE_OBJ_CONFIG_PATH)."
|
||||
@- $(FIND) $(BASE_OBJ_CONFIG_PATH) -name "*.o" | $(XARGS) $(RM_F)
|
||||
@echo "Removing .o files from $(BASE_OBJ_FRAME_PATH)."
|
||||
@- $(FIND) $(BASE_OBJ_FRAME_PATH) -name "*.o" | $(XARGS) $(RM_F)
|
||||
@echo "Removing .o files from $(BASE_OBJ_PATH)."
|
||||
@- $(FIND) $(BASE_OBJ_PATH) -name "*.o" | $(XARGS) $(RM_F)
|
||||
@echo "Removing .a files from $(BASE_LIB_PATH)."
|
||||
@- $(FIND) $(BASE_LIB_PATH) -name "*.a" | $(XARGS) $(RM_F)
|
||||
@echo "Removing .so files from $(BASE_LIB_PATH)."
|
||||
@- $(FIND) $(BASE_LIB_PATH) -name "*.so" | $(XARGS) $(RM_F)
|
||||
endif
|
||||
|
||||
cleanh: check-env
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
$(RM_F) $(BLIS_H_FLAT)
|
||||
else
|
||||
@echo "Removing blis.h file from $(BASE_INC_PATH)."
|
||||
@$(RM_F) $(BLIS_H_FLAT)
|
||||
endif
|
||||
|
||||
cleantest: check-env
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
- $(FIND) $(BASE_OBJ_TESTSUITE_PATH) \( -name "*.o" -o -name "*.pexe" \) | $(XARGS) $(RM_F)
|
||||
@@ -700,19 +646,26 @@ cleanmk: check-env
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
- $(FIND) $(CONFIG_PATH) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
|
||||
- $(FIND) $(FRAME_PATH) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
|
||||
- $(FIND) $(REFKERN_PATH) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
|
||||
- $(FIND) $(KERNELS_PATH) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
|
||||
else
|
||||
@echo "Removing makefile fragments from $(CONFIG_PATH)."
|
||||
@- $(FIND) $(CONFIG_PATH) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
|
||||
@echo "Removing makefile fragments from $(FRAME_PATH)."
|
||||
@- $(FIND) $(FRAME_PATH) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
|
||||
@echo "Removing makefile fragments from $(REFKERN_PATH)."
|
||||
@- $(FIND) $(REFERKN_PATH) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
|
||||
@echo "Removing makefile fragments from $(KERNELS_PATH)."
|
||||
@- $(FIND) $(KERNELS_PATH) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
|
||||
endif
|
||||
|
||||
distclean: check-env cleanmk cleanlib cleantest
|
||||
distclean: check-env cleanmk cleanlib cleanh cleantest
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
- $(RM_F) $(CONFIG_MK_FILE)
|
||||
- $(RM_RF) $(TESTSUITE_OUT_FILE)
|
||||
- $(RM_RF) $(OBJ_DIR)
|
||||
- $(RM_RF) $(LIB_DIR)
|
||||
- $(RM_RF) $(INCLUDE_DIR)
|
||||
else
|
||||
@echo "Removing $(CONFIG_MK_FILE)."
|
||||
@- $(RM_F) $(CONFIG_MK_FILE)
|
||||
@@ -722,6 +675,8 @@ else
|
||||
@- $(RM_RF) $(OBJ_DIR)
|
||||
@echo "Removing $(LIB_DIR)."
|
||||
@- $(RM_RF) $(LIB_DIR)
|
||||
@echo "Removing $(INCLUDE_DIR)."
|
||||
@- $(RM_RF) $(INCLUDE_DIR)
|
||||
endif
|
||||
|
||||
|
||||
@@ -752,7 +707,7 @@ else
|
||||
@- $(RM_F) $(MK_LIBS_INST)
|
||||
endif
|
||||
|
||||
uninstall-headers: check-env
|
||||
uninstall-header: check-env
|
||||
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
|
||||
- $(RM_RF) $(MK_INCL_DIR_INST)
|
||||
else
|
||||
|
||||
@@ -48,7 +48,7 @@ main()
|
||||
fi
|
||||
CPUID_SRC=cpuid_x86.c
|
||||
CPUID_BIN=blis_cpu_detect
|
||||
ARCH=reference
|
||||
ARCH=generic
|
||||
|
||||
# The name of the script, stripped of any preceeding path.
|
||||
script_name=${0##*/}
|
||||
@@ -78,12 +78,12 @@ main()
|
||||
elif [ $ARCH = "ARCH_ARM" ]; then
|
||||
CPUID_SRC=cpuid_arm.c
|
||||
elif [ $ARCH = "ARCH_AARCH64" ]; then
|
||||
#Only support armv8 now
|
||||
echo "armv8a"
|
||||
# Only support armv8 now
|
||||
echo "armv8a"
|
||||
return 0
|
||||
else
|
||||
echo "reference"
|
||||
return 0
|
||||
echo "generic"
|
||||
return 0
|
||||
fi
|
||||
|
||||
#
|
||||
|
||||
@@ -39,24 +39,30 @@
|
||||
#define VENDOR_INTEL 1
|
||||
#define VENDOR_AMD 2
|
||||
|
||||
#define CPUNAME_REFERENCE 0
|
||||
#define CPUNAME_DUNNINGTON 1
|
||||
#define CPUNAME_GENERIC 0
|
||||
#define CPUNAME_PENRYN 1
|
||||
#define CPUNAME_SANDYBRIDGE 2
|
||||
#define CPUNAME_HASWELL 3
|
||||
#define CPUNAME_KNL 4
|
||||
#define CPUNAME_KNC 5
|
||||
#define CPUNAME_KNC 4
|
||||
#define CPUNAME_KNL 5
|
||||
#define CPUNAME_BULLDOZER 6
|
||||
#define CPUNAME_PILEDRIVER 7
|
||||
#define CPUNAME_STEAMROLLER 8
|
||||
#define CPUNAME_EXCAVATOR 9
|
||||
#define CPUNAME_ZEN 10
|
||||
|
||||
static char *cpuname[] = {
|
||||
"reference",
|
||||
"dunnington",
|
||||
"generic",
|
||||
"penryn",
|
||||
"sandybridge",
|
||||
"haswell",
|
||||
"knc",
|
||||
"knl",
|
||||
"mic",
|
||||
"bulldozer",
|
||||
"piledriver",
|
||||
"steamroller",
|
||||
"excavator",
|
||||
"zen",
|
||||
};
|
||||
|
||||
#define BITMASK(a, b, c) ((((a) >> (b)) & (c)))
|
||||
@@ -141,7 +147,7 @@ int cpu_detect()
|
||||
int eax, ebx, ecx, edx;
|
||||
int vendor, family, extend_family, model, extend_model;
|
||||
|
||||
if ( !have_cpuid() ) return CPUNAME_REFERENCE;
|
||||
if ( !have_cpuid() ) return CPUNAME_GENERIC;
|
||||
|
||||
vendor = get_vendor();
|
||||
|
||||
@@ -167,7 +173,7 @@ int cpu_detect()
|
||||
case 0x25: //Westmere
|
||||
case 0x2C: //Westmere
|
||||
case 0x2F: //Westmere
|
||||
return CPUNAME_DUNNINGTON;
|
||||
return CPUNAME_PENRYN;
|
||||
case 0x2A: //Sandy Bridge
|
||||
case 0x2D: //Sandy Bridge
|
||||
case 0x3A: //Ivy Bridge
|
||||
@@ -175,7 +181,7 @@ int cpu_detect()
|
||||
if(support_avx()) {
|
||||
return CPUNAME_SANDYBRIDGE;
|
||||
}else{
|
||||
return CPUNAME_REFERENCE; //OS doesn't support AVX
|
||||
return CPUNAME_GENERIC; //OS doesn't support AVX
|
||||
}
|
||||
case 0x3C: //Haswell
|
||||
case 0x3F: //Haswell
|
||||
@@ -188,13 +194,13 @@ int cpu_detect()
|
||||
if(support_avx()) {
|
||||
return CPUNAME_HASWELL;
|
||||
}else{
|
||||
return CPUNAME_REFERENCE; //OS doesn't support AVX
|
||||
return CPUNAME_GENERIC; //OS doesn't support AVX
|
||||
}
|
||||
case 0x57: //KNL
|
||||
case 0x57: //KNL
|
||||
if(support_avx512()) {
|
||||
return CPUNAME_KNL;
|
||||
}else{
|
||||
return CPUNAME_REFERENCE; //OS doesn't support AVX
|
||||
return CPUNAME_GENERIC; //OS doesn't support AVX
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -214,25 +220,25 @@ int cpu_detect()
|
||||
if(support_avx())
|
||||
return CPUNAME_BULLDOZER;
|
||||
else
|
||||
return CPUNAME_REFERENCE; //OS don't support AVX.
|
||||
return CPUNAME_GENERIC; //OS don't support AVX.
|
||||
case 2:
|
||||
if(support_avx())
|
||||
return CPUNAME_PILEDRIVER;
|
||||
else
|
||||
return CPUNAME_REFERENCE; //OS don't support AVX.
|
||||
return CPUNAME_GENERIC; //OS don't support AVX.
|
||||
case 0:
|
||||
//Steamroller. Temp use Piledriver.
|
||||
// Steamroller. Temp use Piledriver.
|
||||
if(support_avx())
|
||||
return CPUNAME_PILEDRIVER;
|
||||
return CPUNAME_STEAMROLLER;
|
||||
else
|
||||
return CPUNAME_REFERENCE; //OS don't support AVX.
|
||||
return CPUNAME_GENERIC; //OS don't support AVX.
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return CPUNAME_REFERENCE;
|
||||
return CPUNAME_GENERIC;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,14 +35,23 @@
|
||||
#ifndef BLIS_CONFIG_H
|
||||
#define BLIS_CONFIG_H
|
||||
|
||||
#if @enable_pthreads@
|
||||
#define BLIS_ENABLE_PTHREADS
|
||||
#endif
|
||||
// Enabled configuration "family" (config_name)
|
||||
@config_name_define@
|
||||
|
||||
// Enabled sub-configurations (config_list)
|
||||
@config_list_defines@
|
||||
|
||||
// Enabled kernel sets (kernel_list)
|
||||
@kernel_list_defines@
|
||||
|
||||
#if @enable_openmp@
|
||||
#define BLIS_ENABLE_OPENMP
|
||||
#endif
|
||||
|
||||
#if @enable_pthreads@
|
||||
#define BLIS_ENABLE_PTHREADS
|
||||
#endif
|
||||
|
||||
#if @int_type_size@ == 64
|
||||
#define BLIS_INT_TYPE_SIZE 64
|
||||
#elif @int_type_size@ == 32
|
||||
|
||||
@@ -40,14 +40,37 @@ CONFIG_MK_INCLUDED := yes
|
||||
# string forced at configure-time.
|
||||
VERSION := @version@
|
||||
|
||||
# The name of the configuration sub-directory.
|
||||
# The name of the configuration family.
|
||||
CONFIG_NAME := @config_name@
|
||||
|
||||
# The operatin g system name, which should be either 'Linux' or 'Darwin'.
|
||||
# The list of sub-configurations associated with CONFIG_NAME. Each
|
||||
# sub-configuration in CONFIG_LIST corresponds to a configuration
|
||||
# sub-directory in the 'config' directory. See the 'config_registry'
|
||||
# file for the full list of registered configurations.
|
||||
CONFIG_LIST := @config_list@
|
||||
|
||||
# This list of kernels needed for the configurations in CONFIG_LIST.
|
||||
# Each item in this list corresponds to a sub-directory in the top-level
|
||||
# 'kernels' directory. Oftentimes, this list is identical to CONFIG_LIST,
|
||||
# but not always. For example, if configuration X and Y use the same
|
||||
# kernel set X, and configuration W uses kernel set Q, and the CONFIG_LIST
|
||||
# might contained "X Y Z W", then the KERNEL_LIST would contain "X Z Q".
|
||||
KERNEL_LIST := @kernel_list@
|
||||
|
||||
# This list contains some number of "kernel:config" pairs, where "config"
|
||||
# specifies which configuration's compilation flags (CFLAGS) should be
|
||||
# used to compile the source code for the kernel set named "kernel".
|
||||
KCONFIG_MAP := @kconfig_map@
|
||||
|
||||
# The operating system name, which should be either 'Linux' or 'Darwin'.
|
||||
OS_NAME := $(shell uname -s)
|
||||
|
||||
# The directory path to the top level of the source distribution.
|
||||
# NOTE: We allow the includer to override this value by setting DIST_PATH
|
||||
# prior to including this file.
|
||||
ifeq ($(strip $(DIST_PATH)),)
|
||||
DIST_PATH := @dist_path@
|
||||
endif
|
||||
|
||||
# The level of debugging info to generate.
|
||||
DEBUG_TYPE := @debug_type@
|
||||
|
||||
597
build/flatten-headers.sh
Executable file
597
build/flatten-headers.sh
Executable file
@@ -0,0 +1,597 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# BLIS
|
||||
# An object-based framework for developing high-performance BLAS-like
|
||||
# libraries.
|
||||
#
|
||||
# Copyright (C) 2014, The University of Texas at Austin
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# - Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# - Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# - Neither the name of The University of Texas at Austin nor the names
|
||||
# of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#
|
||||
|
||||
#
|
||||
# -- Helper functions ----------------------------------------------------------
|
||||
#
|
||||
|
||||
print_usage()
|
||||
{
|
||||
# Echo usage info.
|
||||
echo " "
|
||||
echo " ${script_name}"
|
||||
echo " "
|
||||
echo " Field G. Van Zee"
|
||||
echo " "
|
||||
echo " Generate a monolithic header by recursively replacing all #include"
|
||||
echo " directives in a selected file with the contents of the header files"
|
||||
echo " they reference."
|
||||
echo " "
|
||||
echo " Usage:"
|
||||
echo " "
|
||||
echo " ${script_name} header header_out dir_list"
|
||||
echo " "
|
||||
echo " Arguments:"
|
||||
echo " "
|
||||
echo " header The filepath to the top-level header, which is file that"
|
||||
echo " will #include all other header files. NOTE: It is okay if"
|
||||
echo " this file resides somewhere in root_dir, described below."
|
||||
echo " "
|
||||
echo " header_out The filepath of the file into which the script will output"
|
||||
echo " the monolithic header."
|
||||
echo " "
|
||||
echo " dir_list The list of directory paths in which to search for the"
|
||||
echo " headers that are #included by 'header'. By default, these"
|
||||
echo " directories are scanned for .h files, but sub-directories"
|
||||
echo " within the various directories are not inspected. If the"
|
||||
echo " -r option is given, these directories are recursively"
|
||||
echo " scanned. In either case, the subset of directories scanned"
|
||||
echo " that actually contains .h files is then searched whenever"
|
||||
echo " a #include directive is encountered in 'header' (or any"
|
||||
echo " file subsequently #included). If a referenced header file"
|
||||
echo " is not found, the #include directive is left untouched and"
|
||||
echo " translated directly into 'header_out'."
|
||||
echo " "
|
||||
echo " The following options are accepted:"
|
||||
echo " "
|
||||
echo " -r recursive"
|
||||
echo " Scan the directories listed in 'dir_list' recursively when"
|
||||
echo " searching for .h header files. By default, the directories"
|
||||
echo " are not searched recursively."
|
||||
echo " "
|
||||
echo " -c strip C-style comments"
|
||||
echo " Strip comments enclosed in /* */ delimiters from the"
|
||||
echo " output, including multi-line comments. (This only applies"
|
||||
echo " to #included headers; C-style comments in the top-level"
|
||||
echo " 'header' are never stripped.) By default, C-style comments"
|
||||
echo " are not stripped."
|
||||
echo " "
|
||||
echo " -o SCRIPT output script name"
|
||||
echo " Use SCRIPT as a prefix when outputting messages instead"
|
||||
echo " the script's actual name. Useful when the current script"
|
||||
echo " is going to be called from within another, higher-level"
|
||||
echo " driver script and seeing the current script's name might"
|
||||
echo " unnecessarily confuse the user."
|
||||
echo " "
|
||||
echo " -v [0|1|2] verboseness level"
|
||||
echo " level 0: silent (no output)"
|
||||
echo " level 1: default (single character '.' per header)"
|
||||
echo " level 2: verbose (several lines per header)."
|
||||
echo " "
|
||||
echo " -h help"
|
||||
echo " Output this information and exit."
|
||||
echo " "
|
||||
|
||||
# Exit with non-zero exit status
|
||||
exit 1
|
||||
}
|
||||
|
||||
canonicalize_ws()
|
||||
{
|
||||
local str="$1"
|
||||
|
||||
# Remove leading and trailing whitespace.
|
||||
str=$(echo -e "${str}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||
|
||||
# Remove duplicate spaces between words.
|
||||
str=$(echo -e "${str}" | tr -s " ")
|
||||
|
||||
# Update the input argument.
|
||||
echo "${str}"
|
||||
}
|
||||
|
||||
is_word_in_list()
|
||||
{
|
||||
word="$1"
|
||||
list="$2"
|
||||
rval=""
|
||||
|
||||
for item in ${list}; do
|
||||
|
||||
if [ "${item}" == "${word}" ]; then
|
||||
rval="${word}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${rval}"
|
||||
}
|
||||
|
||||
echovo()
|
||||
{
|
||||
if [ "${verbose_flag}" == "1" ]; then
|
||||
|
||||
# Echo the argument string to stderr instead of stdout.
|
||||
echo "${output_name}: $1" 1>&2;
|
||||
fi
|
||||
}
|
||||
|
||||
echovo_n()
|
||||
{
|
||||
if [ "${verbose_flag}" == "1" ]; then
|
||||
|
||||
# Echo the argument string to stderr instead of stdout.
|
||||
echo -n "$1" 1>&2;
|
||||
fi
|
||||
}
|
||||
|
||||
echovo_n2()
|
||||
{
|
||||
if [ "${verbose_flag}" == "1" ]; then
|
||||
|
||||
# Echo the argument string to stderr instead of stdout.
|
||||
echo "$1" 1>&2;
|
||||
fi
|
||||
}
|
||||
|
||||
# ---
|
||||
|
||||
echovt()
|
||||
{
|
||||
if [ "${verbose_flag}" == "2" ]; then
|
||||
|
||||
# Echo the argument string to stderr instead of stdout.
|
||||
echo "${output_name}: $1" 1>&2;
|
||||
fi
|
||||
}
|
||||
|
||||
echovt_n()
|
||||
{
|
||||
if [ "${verbose_flag}" == "2" ]; then
|
||||
|
||||
# Echo the argument string to stderr instead of stdout.
|
||||
echo -n "${output_name}: $1" 1>&2;
|
||||
fi
|
||||
}
|
||||
|
||||
echovt_n2()
|
||||
{
|
||||
if [ "${verbose_flag}" == "2" ]; then
|
||||
|
||||
# Echo the argument string to stderr instead of stdout.
|
||||
echo "$1" 1>&2;
|
||||
fi
|
||||
}
|
||||
|
||||
find_header_dirs()
|
||||
{
|
||||
local cur_dirpath sub_items result cur_list item child_list
|
||||
|
||||
# Extract the argument: the current directory, and the list of
|
||||
# directories found so far that contain headers.
|
||||
cur_dirpath="$1"
|
||||
|
||||
echovt_n "scanning contents of ${cur_dirpath}"
|
||||
|
||||
# Acquire a list of the directory's contents.
|
||||
sub_items=$(ls ${cur_dirpath})
|
||||
|
||||
# If there is at least one header present, add the current directory to
|
||||
# the list header of directories. Otherwise, the current directory does
|
||||
# not contribute to the list returned to the caller.
|
||||
result=$(echo ${sub_items} | grep "\.h")
|
||||
|
||||
if [ -n "${result}" ]; then
|
||||
cur_list="${cur_dirpath}"
|
||||
echovt_n2 " ...found headers"
|
||||
else
|
||||
cur_list=""
|
||||
echovt_n2 ""
|
||||
fi
|
||||
|
||||
# Iterate over the list of directory contents.
|
||||
for item in ${sub_items}; do
|
||||
|
||||
# Check whether the current item is in the ignore_list. If so, we
|
||||
# ignore it.
|
||||
result=$(is_word_in_list "${item}" "${ignore_list}")
|
||||
if [ -n "${result}" ]; then
|
||||
echovt "ignoring directory '${item}'."
|
||||
continue
|
||||
fi
|
||||
|
||||
# If the current item is a directory, recursively accumulate header
|
||||
# directories for that sub-directory.
|
||||
if [ -d "${cur_dirpath}/${item}" ]; then
|
||||
|
||||
# Recursively find header directories within the sub-directory
|
||||
# ${item} and store the directory list to child_list.
|
||||
child_list=$(find_header_dirs "${cur_dirpath}/${item}")
|
||||
|
||||
# Accumulate the sub-directory's header list with the running list
|
||||
# of header directories
|
||||
cur_list="${cur_list} ${child_list}"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
# Return the list of header directories.
|
||||
echo "${cur_list}"
|
||||
}
|
||||
|
||||
get_header_path()
|
||||
{
|
||||
local filename dirpaths filepath
|
||||
|
||||
filename="$1"
|
||||
dirpaths="$2"
|
||||
filepath=""
|
||||
|
||||
# Search each directory path for the filename given.
|
||||
for dirpath in ${dirpaths}; do
|
||||
|
||||
if [ -f "${dirpath}/${filename}" ]; then
|
||||
|
||||
filepath="${dirpath}/${filename}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Return the filepath that was found. Note that if no filepath was found
|
||||
# in the loop above, the empty string gets returned.
|
||||
echo "${filepath}"
|
||||
}
|
||||
|
||||
replace_pass()
|
||||
{
|
||||
local inputfile dirpaths intermfile skipstr commstr result
|
||||
local header headerlist header_filepath header_esc subintermfile
|
||||
|
||||
inputfile="$1"
|
||||
dirpaths="$2"
|
||||
cursp="$3"
|
||||
|
||||
# Set the output filename, which we will return to the caller.
|
||||
intermfile="${inputfile}.interm"
|
||||
|
||||
# This string is inserted after #include directives after having
|
||||
# determined that they are not present in the directory tree and should
|
||||
# be ignored when assessing whether there are still #include directives
|
||||
# that need to be expanded. Note that it is formatted as a comment and
|
||||
# thus will be ignored when the monolithic header is eventually read C
|
||||
# preprocessor and/or compiler.
|
||||
skipstr="\/\/skipped"
|
||||
|
||||
# Initialize the list of headers referenced in #include directives
|
||||
# found in the current header file.
|
||||
headerlist=""
|
||||
|
||||
result=$(grep '^[[:space:]]*#include ' ${inputfile})
|
||||
|
||||
# Only iterate through the file line-by-line if it contains at least
|
||||
# one #include directive. If it does not contain any #include directives,
|
||||
# then we can leave headerlist initialized to empty and proceed.
|
||||
if [ -n "${result}" ]; then
|
||||
|
||||
# Iterate through each line of the header file, accumulating the names of
|
||||
# header files referenced in #include directives.
|
||||
while read -r curline
|
||||
do
|
||||
|
||||
# Check whether the line begins with a #include directive, but ignore
|
||||
# the line if it contains the skip string.
|
||||
result=$(echo ${curline} | grep '^[[:space:]]*#include ' | grep -v "${skipstr}")
|
||||
|
||||
# If the #include directive was found...
|
||||
if [ -n "${result}" ]; then
|
||||
|
||||
# Isolate the header filename. We must take care to include all
|
||||
# characters that might appear between the "" or <>.
|
||||
header=$(echo ${curline} | sed -e "s/#include [\"<]\([a-zA-Z0-9\_\.\/\-]*\)[\">].*/\1/g")
|
||||
|
||||
# Add the header file to a list.
|
||||
headerlist=$(canonicalize_ws "${headerlist} ${header}")
|
||||
|
||||
fi
|
||||
done < "${inputfile}"
|
||||
fi
|
||||
|
||||
if [ -n "${headerlist}" ]; then
|
||||
echovt "${cursp}found references to: ${headerlist}"
|
||||
else
|
||||
echovt "${cursp}no header references found."
|
||||
fi
|
||||
|
||||
# Before we go any further, we strip C-style comments from the file,
|
||||
# if requested.
|
||||
if [ -n "${strip_comments}" ]; then
|
||||
|
||||
# Make a copy of inputfile stripped of its C-style comments and
|
||||
# save it to intermfile. This substitution leaves behind a single
|
||||
# blank line, which is deleted.
|
||||
cat ${inputfile} \
|
||||
| perl -0777 -pe "s/\/\*.*?\*\///gs" \
|
||||
> "${intermfile}"
|
||||
else
|
||||
|
||||
# Otherwise, just copy inputfile to intermfile verbatim.
|
||||
cp ${inputfile} ${intermfile}
|
||||
fi
|
||||
|
||||
|
||||
# Iterate over each header file found in the previous loop.
|
||||
for header in ${headerlist}; do
|
||||
|
||||
# Find the path to the header.
|
||||
header_filepath=$(get_header_path ${header} "${dirpaths}")
|
||||
|
||||
# If the header has a slash, escape it so that sed doesn't get confused
|
||||
# (since we use '/' as our search-and-replace delimiter).
|
||||
header_esc=$(echo "${header}" | sed -e 's/\//\\\//g')
|
||||
|
||||
# If the header file was not found, get_header_path() returns an
|
||||
# empty string. This probably means that the header file is a
|
||||
# system header and thus we skip it since we don't want to inline
|
||||
# the contents of system headers anyway.
|
||||
if [ -z "${header_filepath}" ]; then
|
||||
|
||||
echovt "${cursp}could not locate file '${header}'; marking as skipped."
|
||||
|
||||
# Insert a comment after the #include so we know it was ignored.
|
||||
# Notice that we mimic the quotes or angle brackets around the
|
||||
# header name, whichever pair was used in the input.
|
||||
|
||||
cat ${intermfile} \
|
||||
| sed -e "s/^[[:space:]]*#include \([\"<]\)\(${header_esc}\)\([\">]\).*/#include \1\2\3 ${skipstr}/" \
|
||||
> "${intermfile}.tmp"
|
||||
|
||||
mv "${intermfile}.tmp" ${intermfile}
|
||||
|
||||
else
|
||||
|
||||
echovt "${cursp}located file '${header_filepath}'; recursing."
|
||||
|
||||
# Recursively produce an inlined/flattened intermediate file at
|
||||
# ${header_filepath}.
|
||||
subintermfile=$(replace_pass ${header_filepath} "${dirpaths}" "${cursp}${nestsp}")
|
||||
|
||||
echovt "${cursp}inserting '${subintermfile}'."
|
||||
|
||||
# Replace the #include directive for the current header file with the
|
||||
# contents of that header file, saving the result to a temporary file.
|
||||
# We also insert begin and end markers to allow for more readability.
|
||||
# NOTE: We use the 'i\...' and 'a\...' notation with '$', which causes
|
||||
# bash to interpret '\n' as a newline, as needed for the 'a\' and 'i\'
|
||||
# commands in POSIX (e.g. OS X) sed. (GNU sed allows a much more
|
||||
# natural usage that does not require the backslash or newline.)
|
||||
cat ${intermfile} \
|
||||
| sed -e "/^[[:space:]]*#include \"${header_esc}\"/ {" \
|
||||
-e 'i\'$'\n'"// begin ${header}"$'\n' \
|
||||
-e "r ${subintermfile}" \
|
||||
-e 'a\'$'\n'"// end ${header}"$'\n' \
|
||||
-e "d" \
|
||||
-e "}" \
|
||||
> "${intermfile}.tmp"
|
||||
|
||||
mv "${intermfile}.tmp" ${intermfile}
|
||||
|
||||
echovt "${cursp}removing intermediate file '${subintermfile}'."
|
||||
|
||||
# Remove the recursive call's intermediate file now that it has been
|
||||
# inserted into this level's intermediate.
|
||||
rm "${subintermfile}"
|
||||
fi
|
||||
done
|
||||
|
||||
# works, but leaves blank line:
|
||||
#cat "test.h" | sed -e "/^#include \"foo.h\"/r foo.h" -e "s///" > "test.new.h"
|
||||
# works:
|
||||
#cat "test.h" | sed -e '/^#include \"foo.h\"/ {' -e 'r foo.h' -e 'd' -e '}' > "test.new.h"
|
||||
# works:
|
||||
#cat "test.h" | sed -e '/^#include \"foo.h\"/r foo.h' -e '/^#include \"foo.h\"/d' > "test.new.h"
|
||||
#cat zorn/header.h | sed -e '/^#include \"header1.h\"/ {' -e 'i // begin insertion' -e 'r alice/header1.h' -e 'a // end insertion' -e 'd' -e '}'
|
||||
|
||||
echovt "${cursp}header file '${inputfile}' fully processed."
|
||||
echovt "${cursp}returning via '${intermfile}'."
|
||||
|
||||
echovo_n "."
|
||||
|
||||
# Return the intermediate filename so the caller knows the name of this
|
||||
# invocation's output file.
|
||||
echo "${intermfile}"
|
||||
}
|
||||
|
||||
#
|
||||
# -- main function -------------------------------------------------------------
|
||||
#
|
||||
|
||||
main()
|
||||
{
|
||||
# The name of the script, stripped of any preceeding path.
|
||||
script_name=${0##*/}
|
||||
|
||||
# The script name to use in informational output. Defaults to ${script_name}.
|
||||
output_name=${script_name}
|
||||
|
||||
# Whether or not we should strip C-style comments from the outout. (Default
|
||||
# is to not strip C-style comments.)
|
||||
strip_comments=""
|
||||
|
||||
# Whether or not we search the directories in dir_list recursively. (Default
|
||||
# is to not search recursively.)
|
||||
recursive_flag=""
|
||||
|
||||
# The list of directories to ignore
|
||||
ignore_list="old other temp test testsuite windows"
|
||||
|
||||
# The amount to nest each level of recursion in the output.
|
||||
nestsp=" "
|
||||
|
||||
# Process our command line options.
|
||||
while getopts ":o:rchv:" opt; do
|
||||
case $opt in
|
||||
o ) output_name=$OPTARG ;;
|
||||
r ) recursive_flag="1" ;;
|
||||
c ) strip_comments="1" ;;
|
||||
v ) verbose_flag=$OPTARG ;;
|
||||
h ) print_usage ;;
|
||||
\? ) print_usage
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
# Make sure that the verboseness level is valid.
|
||||
if [ "${verbose_flag}" != "0" ] &&
|
||||
[ "${verbose_flag}" != "1" ] &&
|
||||
[ "${verbose_flag}" != "2" ]; then
|
||||
echo "${output_name}: Invalid verboseness argument '${verbose_flag}'." 1>&2;
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Print usage if we don't have exactly two arguments.
|
||||
if [ $# != "3" ]; then
|
||||
|
||||
print_usage
|
||||
fi
|
||||
|
||||
# Acquire the two required arguments:
|
||||
# - the input header file,
|
||||
# - the output header file,
|
||||
# - the list of directories in which to search for the headers
|
||||
inputfile="$1"
|
||||
outputfile="$2"
|
||||
dir_list="$3"
|
||||
|
||||
# First, confirm that the directories in dir_list are valid.
|
||||
dir_list2=""
|
||||
for item in ${dir_list}; do
|
||||
|
||||
# Strip a trailing slash from the path, if it has one.
|
||||
item=${item%/}
|
||||
|
||||
echovt_n "checking ${item} "
|
||||
|
||||
if [ -d ${item} ]; then
|
||||
echovt_n2 " ...directory exists."
|
||||
dir_list2="${dir_list2} ${item}"
|
||||
else
|
||||
echovt_n2 " ...invalid directory; omitting."
|
||||
fi
|
||||
done
|
||||
dir_list2=$(canonicalize_ws "${dir_list2}")
|
||||
|
||||
# Overwrite the original dir_list with the updated copy that omits
|
||||
# invalid directories.
|
||||
dir_list="${dir_list2}"
|
||||
|
||||
echovt "check summary:"
|
||||
echovt " accessible directories:"
|
||||
echovt " ${dir_list}"
|
||||
|
||||
# Generate a list of directories (dirpaths) which will be searched whenever
|
||||
# a #include directive is encountered. The method by which dirpaths is
|
||||
# compiled will depend on whether the recursive flag was given.
|
||||
if [ -n "${recursive_flag}" ]; then
|
||||
|
||||
# If the recursive flag was given, we need to recursively scan each
|
||||
# directory in dir_list for directories with headers via the
|
||||
# function find_header_dirs().
|
||||
|
||||
dirpaths=""
|
||||
for item in ${dir_list}; do
|
||||
|
||||
item_dirpaths=$(find_header_dirs ${item})
|
||||
dirpaths="${dirpaths} ${item_dirpaths}"
|
||||
done
|
||||
dirpaths=$(canonicalize_ws "${dirpaths}")
|
||||
|
||||
else
|
||||
|
||||
# If the recursive flag was not given, we can just use dir_list
|
||||
# as-is, though we opt to filter out the directories that don't
|
||||
# contain .h files.
|
||||
|
||||
dirpaths=""
|
||||
for item in ${dir_list}; do
|
||||
|
||||
echovt_n "scanning ${item}"
|
||||
|
||||
# Acquire a list of the directory's contents.
|
||||
sub_items=$(ls ${item})
|
||||
|
||||
# If there is at least one header present, add the current directory to
|
||||
# the list header of directories.
|
||||
result=$(echo ${sub_items} | grep "\.h")
|
||||
if [ -n "${result}" ]; then
|
||||
dirpaths="${dirpaths} ${item}"
|
||||
echovt_n2 " ...found headers."
|
||||
else
|
||||
echovt_n2 " ...no headers found."
|
||||
fi
|
||||
done
|
||||
dirpaths=$(canonicalize_ws "${dirpaths}")
|
||||
fi
|
||||
|
||||
echovt "scan summary:"
|
||||
echovt " headers found in:"
|
||||
echovt " ${dirpaths}"
|
||||
|
||||
echovt "preparing to monolithify '${inputfile}'."
|
||||
|
||||
# Make a copy of the inputfile.
|
||||
#cp ${inputfile} ${outputfile}
|
||||
|
||||
echovt "new header will be saved to '${outputfile}'."
|
||||
|
||||
echovo_n "."
|
||||
|
||||
# Recursively substitute headers for occurrences of #include directives.
|
||||
intermfile=$(replace_pass ${inputfile} "${dirpaths}" "${nestsp}")
|
||||
|
||||
# Rename the intermediate file(path) to the output file(path).
|
||||
mv ${intermfile} ${outputfile}
|
||||
|
||||
echovt "substitution complete."
|
||||
echovt "monolithic header saved as '${outputfile}'."
|
||||
|
||||
echovo_n2 "."
|
||||
|
||||
# Exit peacefully.
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# The script's main entry point, passing all parameters given.
|
||||
main "$@"
|
||||
|
||||
@@ -56,7 +56,7 @@ print_usage()
|
||||
echo " tree. "
|
||||
echo " "
|
||||
echo " Usage:"
|
||||
echo " ${script_name} [options] root_dir templ.mk suff_list ign_list spec_list"
|
||||
echo " ${script_name} [options] root_dir templ.mk suff_list ign_list"
|
||||
echo " "
|
||||
echo " Arguments (mandatory):"
|
||||
echo " "
|
||||
@@ -73,12 +73,6 @@ print_usage()
|
||||
echo " ign_list File containing a newline-separated list of directory names"
|
||||
echo " to ignore when descending recursively into "
|
||||
echo " "
|
||||
echo " spec_list File containing a newline-separated list of directories"
|
||||
echo " considered to be special in some way; source files found"
|
||||
echo " in these directories will be accumulated into a different"
|
||||
echo " makefile sub-variables based on the name of the special"
|
||||
echo " directory names."
|
||||
echo " "
|
||||
echo " The following options are accepted:"
|
||||
echo " "
|
||||
echo " -d dry-run"
|
||||
@@ -380,14 +374,10 @@ read_mkfile_config()
|
||||
# Read the file listing the directories to ignore.
|
||||
ignore_dirs=$(cat "${ignore_file}")
|
||||
|
||||
# Read the file listing the special directories.
|
||||
special_dirs=$(cat "${special_file}")
|
||||
|
||||
# Change newlines into spaces. This is optional, but helps when
|
||||
# printing these values out (so they appear on one line).
|
||||
src_file_suffixes=$(echo ${src_file_suffixes} | sed "s/\n/ /g")
|
||||
ignore_dirs=$(echo ${ignore_dirs} | sed "s/\n/ /g")
|
||||
special_dirs=$(echo ${special_dirs} | sed "s/\n/ /g")
|
||||
|
||||
}
|
||||
|
||||
@@ -417,9 +407,8 @@ main()
|
||||
# The list of source file suffixes to add to the makefile variables.
|
||||
src_file_suffixes=''
|
||||
|
||||
# The lists of directories to ignore and that are special.
|
||||
# The lists of directories to ignore.
|
||||
ignore_dirs=''
|
||||
special_dirs=''
|
||||
|
||||
# The arguments to this function. They'll get assigned meaningful
|
||||
# values after getopts.
|
||||
@@ -427,7 +416,6 @@ main()
|
||||
root_dir=""
|
||||
suffix_file=""
|
||||
ignore_file=""
|
||||
special_file=""
|
||||
|
||||
# Flags set by getopts.
|
||||
dry_run_flag=""
|
||||
@@ -467,7 +455,7 @@ main()
|
||||
fi
|
||||
|
||||
# Check the number of arguments after command line option processing.
|
||||
if [ $# != "5" ]; then
|
||||
if [ $# != "4" ]; then
|
||||
print_usage
|
||||
fi
|
||||
|
||||
@@ -482,7 +470,6 @@ main()
|
||||
mkfile_frag_tmpl_path=$2
|
||||
suffix_file=$3
|
||||
ignore_file=$4
|
||||
special_file=$5
|
||||
|
||||
|
||||
# Read the makefile config files to be used in the makefile fragment
|
||||
|
||||
555
build/old/flatten-headers-pass.sh
Executable file
555
build/old/flatten-headers-pass.sh
Executable file
@@ -0,0 +1,555 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# BLIS
|
||||
# An object-based framework for developing high-performance BLAS-like
|
||||
# libraries.
|
||||
#
|
||||
# Copyright (C) 2014, The University of Texas at Austin
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# - Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# - Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# - Neither the name of The University of Texas at Austin nor the names
|
||||
# of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#
|
||||
|
||||
#
|
||||
# -- Helper functions ----------------------------------------------------------
|
||||
#
|
||||
|
||||
print_usage()
|
||||
{
|
||||
# Echo usage info.
|
||||
echo " "
|
||||
echo " ${script_name}"
|
||||
echo " "
|
||||
echo " Field G. Van Zee"
|
||||
echo " "
|
||||
echo " Generate a monolithic header by recursively replacing all #include"
|
||||
echo " directives in a selected file with the contents of the header files"
|
||||
echo " they reference."
|
||||
echo " "
|
||||
echo " Usage:"
|
||||
echo " "
|
||||
echo " ${script_name} header header_out dir_list"
|
||||
echo " "
|
||||
echo " Arguments:"
|
||||
echo " "
|
||||
echo " header The filepath to the top-level header, which is file that"
|
||||
echo " will #include all other header files. NOTE: It is okay if"
|
||||
echo " this file resides somewhere in root_dir, described below."
|
||||
echo " "
|
||||
echo " header_out The filepath of the file into which the script will output"
|
||||
echo " the monolithic header."
|
||||
echo " "
|
||||
echo " dir_list The list of directory paths in which to search for the"
|
||||
echo " headers that are #included by 'header'. By default, these"
|
||||
echo " directories are scanned for .h files, but sub-directories"
|
||||
echo " within the various directories are not inspected. If the"
|
||||
echo " -r option is given, these directories are recursively"
|
||||
echo " scanned. In either case, the subset of directories scanned"
|
||||
echo " that actually contains .h files is then searched whenever"
|
||||
echo " a #include directive is encountered in 'header' (or any"
|
||||
echo " file subsequently #included). If a referenced header file"
|
||||
echo " is not found, the #include directive is left untouched and"
|
||||
echo " translated directly into 'header_out'."
|
||||
echo " "
|
||||
echo " The following options are accepted:"
|
||||
echo " "
|
||||
echo " -r recursive"
|
||||
echo " Scan the directories listed in 'dir_list' recursively when"
|
||||
echo " searching for .h header files. By default, the directories"
|
||||
echo " are not searched recursively."
|
||||
echo " "
|
||||
echo " -c strip C-style comments"
|
||||
echo " Strip comments enclosed in /* */ delimiters from the"
|
||||
echo " output, including multi-line comments. (This only applies"
|
||||
echo " to #included headers; C-style comments in the top-level"
|
||||
echo " 'header' are never stripped.) By default, C-style comments"
|
||||
echo " are not stripped."
|
||||
echo " "
|
||||
echo " -o SCRIPT output script name"
|
||||
echo " Use SCRIPT as a prefix when outputting messages instead"
|
||||
echo " the script's actual name. Useful when the current script"
|
||||
echo " is going to be called from within another, higher-level"
|
||||
echo " driver script and seeing the current script's name might"
|
||||
echo " unnecessarily confuse the user."
|
||||
echo " "
|
||||
echo " -q quiet"
|
||||
echo " Suppress informational output. By default, the script is"
|
||||
echo " verbose."
|
||||
echo " "
|
||||
echo " -h help"
|
||||
echo " Output this information and exit."
|
||||
echo " "
|
||||
|
||||
# Exit with non-zero exit status
|
||||
exit 1
|
||||
}
|
||||
|
||||
canonicalize_ws()
|
||||
{
|
||||
local str="$1"
|
||||
|
||||
# Remove leading and trailing whitespace.
|
||||
str=$(echo -e "${str}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||
|
||||
# Remove duplicate spaces between words.
|
||||
str=$(echo -e "${str}" | tr -s " ")
|
||||
|
||||
# Update the input argument.
|
||||
echo "${str}"
|
||||
}
|
||||
|
||||
is_word_in_list()
|
||||
{
|
||||
word="$1"
|
||||
list="$2"
|
||||
rval=""
|
||||
|
||||
for item in ${list}; do
|
||||
|
||||
if [ "${item}" == "${word}" ]; then
|
||||
rval="${word}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${rval}"
|
||||
}
|
||||
|
||||
echoinfo()
|
||||
{
|
||||
if [ -z "${quiet_flag}" ]; then
|
||||
|
||||
# Echo the argument string to stderr instead of stdout.
|
||||
echo "${output_name}: $1" 1>&2;
|
||||
fi
|
||||
}
|
||||
|
||||
echoninfo()
|
||||
{
|
||||
if [ -z "${quiet_flag}" ]; then
|
||||
|
||||
# Echo the argument string to stderr instead of stdout.
|
||||
echo -n "${output_name}: $1" 1>&2;
|
||||
fi
|
||||
}
|
||||
|
||||
echon2info()
|
||||
{
|
||||
if [ -z "${quiet_flag}" ]; then
|
||||
|
||||
# Echo the argument string to stderr instead of stdout.
|
||||
echo "$1" 1>&2;
|
||||
fi
|
||||
}
|
||||
|
||||
find_header_dirs()
|
||||
{
|
||||
local cur_dirpath sub_items result cur_list item child_list
|
||||
|
||||
# Extract the argument: the current directory, and the list of
|
||||
# directories found so far that contain headers.
|
||||
cur_dirpath="$1"
|
||||
|
||||
echoninfo "scanning contents of ${cur_dirpath}"
|
||||
|
||||
# Acquire a list of the directory's contents.
|
||||
sub_items=$(ls ${cur_dirpath})
|
||||
|
||||
# If there is at least one header present, add the current directory to
|
||||
# the list header of directories. Otherwise, the current directory does
|
||||
# not contribute to the list returned to the caller.
|
||||
result=$(echo ${sub_items} | grep "\.h")
|
||||
|
||||
if [ -n "${result}" ]; then
|
||||
cur_list="${cur_dirpath}"
|
||||
echon2info " ...found headers"
|
||||
else
|
||||
cur_list=""
|
||||
echon2info ""
|
||||
fi
|
||||
|
||||
# Iterate over the list of directory contents.
|
||||
for item in ${sub_items}; do
|
||||
|
||||
# Check whether the current item is in the ignore_list. If so, we
|
||||
# ignore it.
|
||||
result=$(is_word_in_list "${item}" "${ignore_list}")
|
||||
if [ -n "${result}" ]; then
|
||||
echoinfo "ignoring directory '${item}'."
|
||||
continue
|
||||
fi
|
||||
|
||||
# If the current item is a directory, recursively accumulate header
|
||||
# directories for that sub-directory.
|
||||
if [ -d "${cur_dirpath}/${item}" ]; then
|
||||
|
||||
# Recursively find header directories within the sub-directory
|
||||
# ${item} and store the directory list to child_list.
|
||||
child_list=$(find_header_dirs "${cur_dirpath}/${item}")
|
||||
|
||||
# Accumulate the sub-directory's header list with the running list
|
||||
# of header directories
|
||||
cur_list="${cur_list} ${child_list}"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
# Return the list of header directories.
|
||||
echo "${cur_list}"
|
||||
}
|
||||
|
||||
get_header_path()
|
||||
{
|
||||
local filename dirpaths filepath
|
||||
|
||||
filename="$1"
|
||||
dirpaths="$2"
|
||||
filepath=""
|
||||
|
||||
# Search each directory path for the filename given.
|
||||
for dirpath in ${dirpaths}; do
|
||||
|
||||
if [ -f "${dirpath}/${filename}" ]; then
|
||||
|
||||
filepath="${dirpath}/${filename}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Return the filepath that was found. Note that if no filepath was found
|
||||
# in the loop above, the empty string gets returned.
|
||||
echo "${filepath}"
|
||||
}
|
||||
|
||||
replace_pass()
|
||||
{
|
||||
local filename dirpaths result header headerlist
|
||||
|
||||
filename="$1"
|
||||
dirpaths="$2"
|
||||
|
||||
# This string is inserted after #include directives after having
|
||||
# determined that they are not present in the directory tree and should
|
||||
# be ignored when assessing whether there are still #include directives
|
||||
# that need to be expanded. Note that it is formatted as a comment and
|
||||
# thus will be ignored when the monolithic header is eventually read C
|
||||
# preprocessor and/or compiler.
|
||||
skipstr="\/\/skipped"
|
||||
#skipstr="\/\*skipped\*\/"
|
||||
|
||||
# The way we (optionally) remove C-style comments results in a single
|
||||
# blank line in its place (regardless of how many lines the comment
|
||||
# spanned. When a comment is removed, it is replaced by this string
|
||||
# so that the line can be deleted with a subsequent sed command.
|
||||
commstr="DeLeTeDCsTyLeCoMmEnT"
|
||||
|
||||
headerlist=""
|
||||
|
||||
# Iterate through each line of the header file, accumulating the names of
|
||||
# header files referenced in #include directives.
|
||||
while read -r curline
|
||||
do
|
||||
|
||||
# Check whether the line begins with a #include directive, but ignore
|
||||
# the line if it contains the skip string.
|
||||
result=$(echo ${curline} | grep '^[[:space:]]*#include ' | grep -v "${skipstr}")
|
||||
|
||||
# If the #include directive was found...
|
||||
if [ -n "${result}" ]; then
|
||||
|
||||
# Isolate the header filename. We must take care to include all
|
||||
# characters that might appear between the "" or <>.
|
||||
header=$(echo ${curline} | sed -e "s/#include [\"<]\([a-zA-Z0-9\_\.\/\-]*\)[\">].*/\1/g")
|
||||
|
||||
# Add the header file to a list.
|
||||
headerlist=$(canonicalize_ws "${headerlist} ${header}")
|
||||
|
||||
fi
|
||||
done < "${filename}"
|
||||
|
||||
echoinfo " found references to: ${headerlist}"
|
||||
|
||||
# Initialize the return value to null.
|
||||
result=""
|
||||
|
||||
# Iterate over each header file found in the previous loop.
|
||||
for header in ${headerlist}; do
|
||||
|
||||
# Find the path to the header.
|
||||
header_filepath=$(get_header_path ${header} "${dirpaths}")
|
||||
|
||||
# If the header has a slash, escape it so that sed doesn't get confused
|
||||
# (since we use '/' as our search-and-replace delimiter).
|
||||
header_esc=$(echo "${header}" | sed -e 's/\//\\\//g')
|
||||
|
||||
# If the header file was not found, get_header_path() returns an
|
||||
# empty string. This probably means that the header file is a
|
||||
# system header and thus we skip it since we don't want to inline
|
||||
# the contents of system headers anyway.
|
||||
if [ -z "${header_filepath}" ]; then
|
||||
|
||||
echoinfo " could not locate file '${header}'; marking to skip."
|
||||
|
||||
# Insert a comment after the #include so we know to ignore it
|
||||
# later. Notice that we mimic the quotes or angle brackets
|
||||
# around the header name, whichever pair was used in the input.
|
||||
|
||||
cat ${filename} \
|
||||
| sed -e "s/^[[:space:]]*#include \([\"<]\)\(${header_esc}\)\([\">]\).*/#include \1\2\3 ${skipstr}/" \
|
||||
> "${filename}.tmp"
|
||||
|
||||
# Overwrite the original file with the updated copy.
|
||||
mv "${filename}.tmp" ${filename}
|
||||
|
||||
else
|
||||
|
||||
echoinfo " located file '${header_filepath}'; inserting."
|
||||
|
||||
# Strip C-style comments from the file, if requested.
|
||||
if [ -n "${strip_comments}" ]; then
|
||||
|
||||
header_filename=${header_filepath##*/}
|
||||
|
||||
# Make a temporary copy of ${header_filepath} stripped of its
|
||||
# C-style comments. This leaves behind a single blank line,
|
||||
# which is then deleted.
|
||||
cat ${header_filepath} \
|
||||
| perl -0777 -pe "s/\/\*.*?\*\//${commstr}/gs" \
|
||||
| sed -e "/${commstr}/d" \
|
||||
> "${header_filename}.tmp"
|
||||
|
||||
header_to_insert="${header_filename}.tmp"
|
||||
else
|
||||
header_to_insert="${header_filepath}"
|
||||
fi
|
||||
|
||||
# Replace the #include directive for the current header file with the
|
||||
# contents of that header file, saving the result to a temporary file.
|
||||
# We also insert begin and end markers to allow for more readability.
|
||||
cat ${filename} \
|
||||
| sed -e "/^[[:space:]]*#include \"${header_esc}\"/ {" \
|
||||
-e "i // begin ${header}" \
|
||||
-e "r ${header_to_insert}" \
|
||||
-e "a // end ${header}" \
|
||||
-e "d" \
|
||||
-e "}" \
|
||||
> "${filename}.tmp"
|
||||
|
||||
# Overwrite the original header file with the updated copy.
|
||||
mv "${filename}.tmp" ${filename}
|
||||
|
||||
# If C-style comments were stripped, remove the temporary file.
|
||||
if [ -n "${strip_comments}" ]; then
|
||||
rm "${header_filename}.tmp"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# works, but leaves blank line:
|
||||
#cat "test.h" | sed -e "/^#include \"foo.h\"/r foo.h" -e "s///" > "test.new.h"
|
||||
# works:
|
||||
#cat "test.h" | sed -e '/^#include \"foo.h\"/ {' -e 'r foo.h' -e 'd' -e '}' > "test.new.h"
|
||||
# works:
|
||||
#cat "test.h" | sed -e '/^#include \"foo.h\"/r foo.h' -e '/^#include \"foo.h\"/d' > "test.new.h"
|
||||
#cat zorn/header.h | sed -e '/^#include \"header1.h\"/ {' -e 'i // begin insertion' -e 'r alice/header1.h' -e 'a // end insertion' -e 'd' -e '}'
|
||||
|
||||
# Search the updated file for #include directives, but ignore any
|
||||
# hits that also contain the skip string (indicating that the header
|
||||
# file referenced by that #include could not be found).
|
||||
result=$(cat ${filename} | grep '^[[:space:]]*#include ' | grep -v "${skipstr}")
|
||||
|
||||
# Return the result so the caller knows if we need to proceed with
|
||||
# another pass.
|
||||
echo ${result}
|
||||
}
|
||||
|
||||
#
|
||||
# -- main function -------------------------------------------------------------
|
||||
#
|
||||
|
||||
main()
|
||||
{
|
||||
# The name of the script, stripped of any preceeding path.
|
||||
script_name=${0##*/}
|
||||
|
||||
# The script name to use in informational output. Defaults to ${script_name}.
|
||||
output_name=${script_name}
|
||||
|
||||
# Whether or not we should strip C-style comments from the outout. (Default
|
||||
# is to not strip C-style comments.)
|
||||
strip_comments=""
|
||||
|
||||
# Whether or not we search the directories in dir_list recursively. (Default
|
||||
# is to not search recursively.)
|
||||
recursive_flag=""
|
||||
|
||||
# Whether or not we should suppress informational output. (Default is to
|
||||
# output messages.)
|
||||
quiet_flag=""
|
||||
|
||||
# The list of directories to ignore
|
||||
ignore_list="old other temp test testsuite windows"
|
||||
|
||||
# Process our command line options.
|
||||
while getopts ":o:rcqh" opt; do
|
||||
case $opt in
|
||||
o ) output_name=$OPTARG ;;
|
||||
r ) recursive_flag="1" ;;
|
||||
c ) strip_comments="1" ;;
|
||||
q ) quiet_flag="1" ;;
|
||||
h ) print_usage ;;
|
||||
\? ) print_usage
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
# Print usage if we don't have exactly two arguments.
|
||||
if [ $# != "3" ]; then
|
||||
|
||||
print_usage
|
||||
fi
|
||||
|
||||
# Acquire the two required arguments:
|
||||
# - the input header file,
|
||||
# - the output header file,
|
||||
# - the list of directories in which to search for the headers
|
||||
inputfile="$1"
|
||||
outputfile="$2"
|
||||
dir_list="$3"
|
||||
|
||||
# First, confirm that the directories in dir_list are valid.
|
||||
dir_list2=""
|
||||
for item in ${dir_list}; do
|
||||
|
||||
# Strip a trailing slash from the path, if it has one.
|
||||
item=${item%/}
|
||||
|
||||
echoninfo "checking ${item} "
|
||||
|
||||
if [ -d ${item} ]; then
|
||||
echon2info " ...directory exists."
|
||||
dir_list2="${dir_list2} ${item}"
|
||||
else
|
||||
echon2info " ...invalid directory; omitting."
|
||||
fi
|
||||
done
|
||||
dir_list2=$(canonicalize_ws "${dir_list2}")
|
||||
|
||||
# Overwrite the original dir_list with the updated copy that omits
|
||||
# invalid directories.
|
||||
dir_list="${dir_list2}"
|
||||
|
||||
echoinfo "check summary:"
|
||||
echoinfo " accessible directories:"
|
||||
echoinfo " ${dir_list}"
|
||||
|
||||
# Generate a list of directories (dirpaths) which will be searched whenever
|
||||
# a #include directive is encountered. The method by which dirpaths is
|
||||
# compiled will depend on whether the recursive flag was given.
|
||||
if [ -n "${recursive_flag}" ]; then
|
||||
|
||||
# If the recursive flag was given, we need to recursively scan each
|
||||
# directory in dir_list for directories with headers via the
|
||||
# function find_header_dirs().
|
||||
|
||||
dirpaths=""
|
||||
for item in ${dir_list}; do
|
||||
|
||||
item_dirpaths=$(find_header_dirs ${item})
|
||||
dirpaths="${dirpaths} ${item_dirpaths}"
|
||||
done
|
||||
dirpaths=$(canonicalize_ws "${dirpaths}")
|
||||
|
||||
else
|
||||
|
||||
# If the recursive flag was not given, we can just use dir_list
|
||||
# as-is, though we opt to filter out the directories that don't
|
||||
# contain .h files.
|
||||
|
||||
dirpaths=""
|
||||
for item in ${dir_list}; do
|
||||
|
||||
echoninfo "scanning ${item}"
|
||||
|
||||
# Acquire a list of the directory's contents.
|
||||
sub_items=$(ls ${item})
|
||||
|
||||
# If there is at least one header present, add the current directory to
|
||||
# the list header of directories.
|
||||
result=$(echo ${sub_items} | grep "\.h")
|
||||
if [ -n "${result}" ]; then
|
||||
dirpaths="${dirpaths} ${item}"
|
||||
echon2info " ...found headers."
|
||||
else
|
||||
echon2info " ...no headers found."
|
||||
fi
|
||||
done
|
||||
dirpaths=$(canonicalize_ws "${dirpaths}")
|
||||
fi
|
||||
|
||||
echoinfo "scan summary:"
|
||||
echoinfo " headers found in:"
|
||||
echoinfo " ${dirpaths}"
|
||||
|
||||
echoinfo "preparing to monolithify '${inputfile}'."
|
||||
|
||||
# Make a copy of the inputfile.
|
||||
cp ${inputfile} ${outputfile}
|
||||
|
||||
echoinfo "new header will be saved to '${outputfile}'."
|
||||
|
||||
done_flag="0"
|
||||
while [ ${done_flag} == "0" ]; do
|
||||
|
||||
echoinfo "starting new pass."
|
||||
|
||||
# Perform a replacement pass. The return string is non-null if
|
||||
# additional passes are necessary and null otherwise.
|
||||
result=$(replace_pass ${outputfile} "${dirpaths}")
|
||||
|
||||
if [ -n "${result}" ]; then
|
||||
|
||||
echoinfo "pass finished; result: additional pass(es) needed."
|
||||
else
|
||||
echoinfo "pass finished; result: no further passes needed."
|
||||
fi
|
||||
#exit 1
|
||||
# If the return value was null, then we're done.
|
||||
if [ -z "${result}" ]; then
|
||||
done_flag="1"
|
||||
fi
|
||||
done
|
||||
|
||||
echoinfo "substitution complete."
|
||||
echoinfo "monolithic header saved as '${outputfile}'."
|
||||
|
||||
# Exit peacefully.
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# The script's main entry point, passing all parameters given.
|
||||
main "$@"
|
||||
|
||||
360
common.mk
360
common.mk
@@ -38,19 +38,110 @@ COMMON_MK_INCLUDED := yes
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- CFLAGS storage functions -------------------------------------------------
|
||||
#
|
||||
|
||||
# Define a function that stores the value of a variable to a different
|
||||
# variable containing a specified suffix (corresponding to a configuration).
|
||||
define store-var-for
|
||||
$(strip $(1)).$(strip $(2)) := $($(strip $(1)))
|
||||
endef
|
||||
|
||||
# Define a function that stores the value of all of the variables in a
|
||||
# make_defs.mk file to other variables with the configuration (the
|
||||
# argument $(1)) added as a suffix. This function is called once from
|
||||
# each make_defs.mk. Also, add the configuration to CONFIGS_INCL.
|
||||
define store-make-defs
|
||||
$(eval $(call store-var-for,CC, $(1)))
|
||||
$(eval $(call store-var-for,CC_VENDOR, $(1)))
|
||||
$(eval $(call store-var-for,CPPROCFLAGS,$(1)))
|
||||
$(eval $(call store-var-for,CMISCFLAGS, $(1)))
|
||||
$(eval $(call store-var-for,CPICFLAGS, $(1)))
|
||||
$(eval $(call store-var-for,CWARNFLAGS, $(1)))
|
||||
$(eval $(call store-var-for,CDBGFLAGS, $(1)))
|
||||
$(eval $(call store-var-for,COPTFLAGS, $(1)))
|
||||
$(eval $(call store-var-for,CKOPTFLAGS, $(1)))
|
||||
$(eval $(call store-var-for,CVECFLAGS, $(1)))
|
||||
CONFIGS_INCL += $(1)
|
||||
endef
|
||||
|
||||
# Define a function that retreives the value of a variable for a
|
||||
# given configuration.
|
||||
define load-var-for
|
||||
$($(strip $(1)).$(strip $(2)))
|
||||
endef
|
||||
|
||||
# Define some functions that return the appropriate CFLAGS for a given
|
||||
# configuration. This assumes that the make_defs.mk files have already been
|
||||
# included, which results in those values having been stored to
|
||||
# configuration-qualified variables.
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- CFLAGS query functions ---------------------------------------------------
|
||||
#
|
||||
|
||||
get-noopt-cflags-for = $(strip $(call load-var-for,CDBGFLAGS,$(1)) \
|
||||
$(call load-var-for,CWARNFLAGS,$(1)) \
|
||||
$(call load-var-for,CPICFLAGS,$(1)) \
|
||||
$(call load-var-for,CMISCFLAGS,$(1)) \
|
||||
$(call load-var-for,CPPROCFLAGS,$(1)) \
|
||||
$(CTHREADFLAGS) \
|
||||
$(INCLUDE_PATHS) $(VERS_DEF) \
|
||||
)
|
||||
|
||||
get-kernel-cflags-for = $(call load-var-for,CKOPTFLAGS,$(1)) \
|
||||
$(call load-var-for,CVECFLAGS,$(1)) \
|
||||
$(call get-noopt-cflags-for,$(1))
|
||||
|
||||
get-refkern-cflags-for = $(call get-kernel-cflags-for,$(1)) \
|
||||
-DBLIS_CNAME=$(1)
|
||||
|
||||
get-frame-cflags-for = $(call load-var-for,COPTFLAGS,$(1)) \
|
||||
$(call load-var-for,CVECFLAGS,$(1)) \
|
||||
$(call get-noopt-cflags-for,$(1))
|
||||
|
||||
get-config-cflags-for = $(call get-kernel-cflags-for,$(1))
|
||||
|
||||
get-noopt-text = "(CFLAGS for no optimization)"
|
||||
get-kernel-text-for = "('$(1)' CFLAGS for kernels)"
|
||||
get-refkern-text-for = "('$(1)' CFLAGS for ref. kernels)"
|
||||
get-frame-text-for = "('$(1)' CFLAGS for framework code)"
|
||||
get-config-text-for = "('$(1)' CFLAGS for config code)"
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Miscellaneous helper functions -------------------------------------------
|
||||
#
|
||||
|
||||
# Define functions that filters a list of filepaths $(1) that contain (or
|
||||
# omit) an arbitrary substring $(2).
|
||||
files-that-contain = $(strip $(foreach f, $(1), $(if $(findstring $(2),$(f)),$(f),)))
|
||||
files-that-dont-contain = $(strip $(foreach f, $(1), $(if $(findstring $(2),$(f)),,$(f))))
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Include makefile configuration file --------------------------------------
|
||||
#
|
||||
|
||||
ifeq ($(strip $(RELPATH)),)
|
||||
RELPATH := .
|
||||
endif
|
||||
#ifeq ($(strip $(RELPATH)),)
|
||||
#RELPATH := .
|
||||
#endif
|
||||
|
||||
# Define the name of the configuration file.
|
||||
CONFIG_MK_FILE := config.mk
|
||||
|
||||
# Include the configuration file.
|
||||
-include $(RELPATH)/$(CONFIG_MK_FILE)
|
||||
#-include $(RELPATH)/$(CONFIG_MK_FILE)
|
||||
ifneq ($(strip $(DIST_PATH)),)
|
||||
-include $(DIST_PATH)/$(CONFIG_MK_FILE)
|
||||
else
|
||||
-include ./$(CONFIG_MK_FILE)
|
||||
endif
|
||||
|
||||
# Detect whether we actually got the configuration file. If we didn't, then
|
||||
# it is likely that the user has not yet generated it (via configure).
|
||||
@@ -60,20 +151,53 @@ else
|
||||
CONFIG_MK_PRESENT := no
|
||||
endif
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Primary makefile variable definitions ------------------------------------
|
||||
#
|
||||
|
||||
# The base name of the BLIS library that we will build.
|
||||
BLIS_LIB_BASE_NAME := libblis
|
||||
|
||||
# All makefile fragments in the tree will have this name.
|
||||
FRAGMENT_MK := .fragment.mk
|
||||
|
||||
# Locations of important files.
|
||||
CONFIG_DIR := config
|
||||
FRAME_DIR := frame
|
||||
REFKERN_DIR := ref_kernels
|
||||
KERNELS_DIR := kernels
|
||||
BUILD_DIR := build
|
||||
OBJ_DIR := obj
|
||||
LIB_DIR := lib
|
||||
INCLUDE_DIR := include
|
||||
TESTSUITE_DIR := testsuite
|
||||
|
||||
# Now we have access to CONFIG_NAME, which tells us which sub-directory of the
|
||||
# config directory to use as our configuration. Also using CONFIG_NAME, we
|
||||
# construct the path to the general framework source tree.
|
||||
CONFIG_PATH := $(DIST_PATH)/$(CONFIG_DIR)/$(CONFIG_NAME)
|
||||
# Other kernel-related definitions.
|
||||
KERNEL_SUFS := c s S
|
||||
KERNELS_STR := kernels
|
||||
REF_SUF := ref
|
||||
|
||||
# If CONFIG_PATH is not an absolute path (does not begin with /) then prepend
|
||||
# RELPATH to it.
|
||||
ifeq ($(strip $(filter /%,$(CONFIG_PATH))),)
|
||||
CONFIG_PATH := $(RELPATH)/$(CONFIG_PATH)
|
||||
endif
|
||||
# The names of the testsuite binary executable and related default names
|
||||
# of its input/configuration files.
|
||||
TESTSUITE_NAME := test_$(BLIS_LIB_BASE_NAME)
|
||||
TESTSUITE_CONF_GEN := input.general
|
||||
TESTSUITE_CONF_OPS := input.operations
|
||||
TESTSUITE_OUT_FILE := output.testsuite
|
||||
|
||||
# CHANGELOG file.
|
||||
CHANGELOG := CHANGELOG
|
||||
|
||||
# Construct paths to the four primary directories of source code:
|
||||
# the config directory, general framework code, reference kernel code,
|
||||
# and optimized kernel code. NOTE: We declare these as recursively
|
||||
# expanded variables since DIST_PATH may be overridden later.
|
||||
CONFIG_PATH := $(DIST_PATH)/$(CONFIG_DIR)
|
||||
FRAME_PATH := $(DIST_PATH)/$(FRAME_DIR)
|
||||
REFKERN_PATH := $(DIST_PATH)/$(REFKERN_DIR)
|
||||
KERNELS_PATH := $(DIST_PATH)/$(KERNELS_DIR)
|
||||
|
||||
|
||||
#
|
||||
@@ -93,6 +217,13 @@ XARGS := xargs
|
||||
RANLIB := ranlib
|
||||
INSTALL := install -c
|
||||
|
||||
# Script for creating a monolithic header file.
|
||||
FLATTEN_H := build/flatten-headers.sh
|
||||
|
||||
# Default archiver flags.
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# Used to refresh CHANGELOG.
|
||||
GIT := git
|
||||
GIT_LOG := $(GIT) log --decorate
|
||||
@@ -113,9 +244,9 @@ ifeq ($(VENDOR_STRING),)
|
||||
$(error Unable to determine compiler vendor.)
|
||||
endif
|
||||
|
||||
CC_VENDOR := $(firstword $(shell echo '$(VENDOR_STRING)' | $(EGREP) -o 'icc|gcc|clang|emcc|pnacl|IBM'))
|
||||
CC_VENDOR := $(firstword $(shell echo '$(VENDOR_STRING)' | $(EGREP) -o 'icc|gcc|clang|IBM'))
|
||||
ifeq ($(CC_VENDOR),)
|
||||
$(error Unable to determine compiler vendor.)
|
||||
$(error Unable to determine compiler vendor. Have you run './configure' yet?)
|
||||
endif
|
||||
|
||||
endif
|
||||
@@ -130,23 +261,57 @@ endif
|
||||
# makefile definitions.
|
||||
MAKE_DEFS_FILE := make_defs.mk
|
||||
|
||||
# Construct the path to the makefile definitions file residing inside of
|
||||
# the configuration sub-directory.
|
||||
MAKE_DEFS_MK_PATH := $(CONFIG_PATH)/$(MAKE_DEFS_FILE)
|
||||
# Construct the paths to the makefile definitions files, each of which resides
|
||||
# in a separate configuration sub-directory. We include CONFIG_NAME in this
|
||||
# list since we might need
|
||||
ALL_CONFIGS := $(sort $(strip $(CONFIG_LIST) $(CONFIG_NAME)))
|
||||
CONFIG_PATHS := $(addprefix $(CONFIG_PATH)/, $(ALL_CONFIGS))
|
||||
MAKE_DEFS_MK_PATHS := $(addsuffix /$(MAKE_DEFS_FILE), $(CONFIG_PATHS))
|
||||
|
||||
# Include the makefile definitions file.
|
||||
-include $(MAKE_DEFS_MK_PATH)
|
||||
# Initialize the list of included (found) configurations to empty.
|
||||
CONFIGS_INCL :=
|
||||
|
||||
# Detect whether we actually got the make definitios file. If we didn't, then
|
||||
# it is likely that the configuration is invalid (or incomplete).
|
||||
ifeq ($(strip $(MAKE_DEFS_MK_INCLUDED)),yes)
|
||||
MAKE_DEFS_MK_PRESENT := yes
|
||||
# Include the makefile definitions files implied by the list of configurations.
|
||||
-include $(MAKE_DEFS_MK_PATHS)
|
||||
|
||||
# Detect whether we actually got all of the make definitions files. If
|
||||
# we didn't, then maybe a configuration is mislabeled or missing. The
|
||||
# check-env-make-defs target checks ALL_MAKE_DEFS_MK_PRESENT and outputs
|
||||
# an error message if it is set to 'no'.
|
||||
# NOTE: We combine the CONFIG_NAME and CONFIG_LIST for situations where
|
||||
# the CONFIG_NAME is absent from the CONFIG_LIST (e.g., 'intel64' is a
|
||||
# configuration family name with its own configuration directory and its
|
||||
# own make_defs.mk file, but not a sub-configuration itself). If
|
||||
# CONFIG_NAME is present in CONFIG_LIST, as with singleton configuration
|
||||
# families, then the sort() function will remove duplicates from both
|
||||
# strings being compared.
|
||||
CONFIGS_EXPECTED := $(CONFIG_LIST) $(CONFIG_NAME)
|
||||
ifeq ($(sort $(strip $(CONFIGS_INCL))), \
|
||||
$(sort $(strip $(CONFIGS_EXPECTED))))
|
||||
ALL_MAKE_DEFS_MK_PRESENT := yes
|
||||
else
|
||||
MAKE_DEFS_MK_PRESENT := no
|
||||
ALL_MAKE_DEFS_MK_PRESENT := no
|
||||
endif
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Default linker definitions -----------------------------------------------
|
||||
#
|
||||
|
||||
# Default linker, flags.
|
||||
LINKER := $(CC)
|
||||
LDFLAGS :=
|
||||
|
||||
# Never use libm with Intel compilers.
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS += -lm
|
||||
endif
|
||||
|
||||
SOFLAGS := -shared
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Configuration-agnostic flags ---------------------------------------------
|
||||
#
|
||||
@@ -193,13 +358,6 @@ LDFLAGS += -lpthread
|
||||
endif
|
||||
endif
|
||||
|
||||
# Aggregate all of the flags into multiple groups: one for standard compilation,
|
||||
# and one for each of the supported "special" compilation modes.
|
||||
|
||||
CFLAGS_NOOPT := $(CDBGFLAGS) $(CWARNFLAGS) $(CPICFLAGS) $(CTHREADFLAGS) $(CMISCFLAGS) $(CPPROCFLAGS)
|
||||
CFLAGS := $(COPTFLAGS) $(CVECFLAGS) $(CFLAGS_NOOPT)
|
||||
CFLAGS_KERNELS := $(CKOPTFLAGS) $(CVECFLAGS) $(CFLAGS_NOOPT)
|
||||
|
||||
|
||||
|
||||
#
|
||||
@@ -228,7 +386,143 @@ endif
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Include makefile fragments -----------------------------------------------
|
||||
#
|
||||
|
||||
# Initialize our list of directory paths to makefile fragments with the empty
|
||||
# list. This variable will accumulate all of the directory paths in which
|
||||
# makefile fragments reside.
|
||||
FRAGMENT_DIR_PATHS :=
|
||||
|
||||
# Initialize our makefile variables that source code files will be accumulated
|
||||
# into by the makefile fragments. This initialization is very important! These
|
||||
# variables will end up with weird contents if we don't initialize them to
|
||||
# empty prior to recursively including the makefile fragments.
|
||||
MK_CONFIG_SRC :=
|
||||
MK_FRAME_SRC :=
|
||||
MK_REFKERN_SRC :=
|
||||
MK_KERNELS_SRC :=
|
||||
|
||||
|
||||
# Construct paths to each of the sub-configurations specified in the
|
||||
# configuration list. If CONFIG_NAME is not in CONFIG_LIST, include it in
|
||||
# CONFIG_PATHS since we'll need access to its header files.
|
||||
ifeq ($(findstring $(CONFIG_NAME),$(CONFIG_LIST)),)
|
||||
CONFIG_PATHS := $(addprefix $(CONFIG_PATH)/, $(CONFIG_NAME) $(CONFIG_LIST))
|
||||
else
|
||||
CONFIG_PATHS := $(addprefix $(CONFIG_PATH)/, $(CONFIG_LIST))
|
||||
endif
|
||||
|
||||
# This variable is used by the include statements as they recursively include
|
||||
# one another. For the 'config' directory, we initialize it to that directory
|
||||
# in preparation to include the fragments in the configuration sub-directory.
|
||||
PARENT_PATH := $(DIST_PATH)/$(CONFIG_DIR)
|
||||
|
||||
# Recursively include the makefile fragments in each of the sub-configuration
|
||||
# directories.
|
||||
-include $(addsuffix /$(FRAGMENT_MK), $(CONFIG_PATHS))
|
||||
|
||||
|
||||
# Construct paths to each of the kernel sets required by the sub-configurations
|
||||
# in the configuration list.
|
||||
KERNEL_PATHS := $(addprefix $(KERNELS_PATH)/, $(KERNEL_LIST))
|
||||
|
||||
# This variable is used by the include statements as they recursively include
|
||||
# one another. For the 'kernels' directory, we initialize it to that directory
|
||||
# in preparation to include the fragments in the configuration sub-directory.
|
||||
PARENT_PATH := $(DIST_PATH)/$(KERNELS_DIR)
|
||||
|
||||
# Recursively include the makefile fragments in each of the kernels sub-
|
||||
# directories.
|
||||
-include $(addsuffix /$(FRAGMENT_MK), $(KERNEL_PATHS))
|
||||
|
||||
|
||||
# This variable is used by the include statements as they recursively include
|
||||
# one another. For the framework and reference kernel source trees (ie: the
|
||||
# 'frame' and 'ref_kernels' directories), we initialize it to the top-level
|
||||
# directory since that is its parent. Same for the kernels directory, since it
|
||||
# resides in the same top-level directory.
|
||||
PARENT_PATH := $(DIST_PATH)
|
||||
|
||||
# Recursively include all the makefile fragments in the directories for the
|
||||
# reference kernels and portable framework.
|
||||
-include $(addsuffix /$(FRAGMENT_MK), $(REFKERN_PATH))
|
||||
-include $(addsuffix /$(FRAGMENT_MK), $(FRAME_PATH))
|
||||
|
||||
|
||||
# Create a list of the makefile fragments.
|
||||
MAKEFILE_FRAGMENTS := $(addsuffix /$(FRAGMENT_MK), $(FRAGMENT_DIR_PATHS))
|
||||
|
||||
# Detect whether we actually got any makefile fragments. If we didn't, then it
|
||||
# is likely that the user has not yet generated them (via configure).
|
||||
ifeq ($(strip $(MAKEFILE_FRAGMENTS)),)
|
||||
MAKEFILE_FRAGMENTS_PRESENT := no
|
||||
else
|
||||
MAKEFILE_FRAGMENTS_PRESENT := yes
|
||||
endif
|
||||
#$(error fragment dir paths: $(FRAGMENT_DIR_PATHS))
|
||||
|
||||
|
||||
#
|
||||
# --- Compiler include path definitions ----------------------------------------
|
||||
#
|
||||
|
||||
# Expand the fragment paths that contain .h files to attain the set of header
|
||||
# files present in all fragment paths. Then strip all leading, internal, and
|
||||
# trailing whitespace from the list.
|
||||
MK_HEADER_FILES := $(strip $(foreach frag_path, . $(FRAGMENT_DIR_PATHS), \
|
||||
$(wildcard $(frag_path)/*.h)))
|
||||
|
||||
# Expand the fragment paths that contain .h files, and take the first
|
||||
# expansion. Then, strip the header filename to leave the path to each header
|
||||
# location. Notice this process even weeds out duplicates!
|
||||
MK_HEADER_DIR_PATHS := $(dir $(foreach frag_path, \
|
||||
$(DIST_PATH) $(FRAGMENT_DIR_PATHS), \
|
||||
$(firstword $(wildcard $(frag_path)/*.h))))
|
||||
|
||||
# Add -I to each header path so we can specify our include search paths to the
|
||||
# C compiler.
|
||||
INCLUDE_PATHS := $(strip $(patsubst %, -I%, $(MK_HEADER_DIR_PATHS)))
|
||||
|
||||
# Isolate the path to blis.h by filtering the file from the list of headers.
|
||||
BLIS_H := blis.h
|
||||
BLIS_H_SRC_PATH := $(filter %/$(BLIS_H), $(MK_HEADER_FILES))
|
||||
|
||||
# Construct the path to the intermediate flattened/monolithic blis.h file.
|
||||
BASE_INC_PATH := $(DIST_PATH)/$(INCLUDE_DIR)/$(CONFIG_NAME)
|
||||
BLIS_H_FLAT := $(BASE_INC_PATH)/$(BLIS_H)
|
||||
|
||||
# Obtain a list of header files #included inside of the bli_cntx_ref.c file.
|
||||
# Paths to these files will be needed when compiling with the monolithic
|
||||
# header.
|
||||
REF_KER_SRC := $(DIST_PATH)/$(REFKERN_DIR)/bli_cntx_ref.c
|
||||
REF_KER_HEADERS := $(shell grep "\#include" $(REF_KER_SRC) | sed -e "s/\#include [\"<]\([a-zA-Z0-9\_\.\/\-]*\)[\">].*/\1/g" | grep -v blis.h)
|
||||
|
||||
# Match each header found above with the path to that header, and then strip
|
||||
# leading, trailing, and internal whitespace.
|
||||
REF_KER_H_PATHS := $(strip $(foreach header, $(REF_KER_HEADERS), \
|
||||
$(dir $(filter %/$(header), \
|
||||
$(MK_HEADER_FILES)))))
|
||||
|
||||
# Add -I to each header path so we can specify our include search paths to the
|
||||
# C compiler. Then add frame/include since it's needed for bli_oapi_w[o]_cntx.h.
|
||||
REF_KER_I_PATHS := $(strip $(patsubst %, -I%, $(REF_KER_H_PATHS)))
|
||||
REF_KER_I_PATHS += -I$(DIST_PATH)/frame/include
|
||||
|
||||
# Finally, prefix the paths above with the base include path.
|
||||
INCLUDE_PATHS := -I$(BASE_INC_PATH) $(REF_KER_I_PATHS)
|
||||
|
||||
#
|
||||
# --- Special preprocessor macro definitions -----------------------------------
|
||||
#
|
||||
|
||||
# Define a C preprocessor macro to communicate the current version so that it
|
||||
# can be embedded into the library and queried later.
|
||||
VERS_DEF := -DBLIS_VERSION_STRING=\"$(VERSION)\"
|
||||
|
||||
|
||||
|
||||
# end of ifndef COMMON_MK_INCLUDED conditional block
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -32,12 +32,15 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
|
||||
// In the reference configuration, we let all of the defaults take
|
||||
// effect. Thus, no definitions are needed.
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
#endif
|
||||
// -- MEMORY ALLOCATION --------------------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -32,34 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := amd64
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
else
|
||||
$(error gcc or clang are required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -71,21 +64,19 @@ else
|
||||
COPTFLAGS := -O2 -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
CVECFLAGS := -mavx -mfma -march=bdver4 -mfpmath=sse
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2
|
||||
else
|
||||
$(error gcc or clang are required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
@@ -1,213 +0,0 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
|
||||
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_DEFAULT_MC_S 432
|
||||
#define BLIS_DEFAULT_KC_S 352
|
||||
#define BLIS_DEFAULT_NC_S 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_D 192
|
||||
#define BLIS_DEFAULT_KC_D 256
|
||||
#define BLIS_DEFAULT_NC_D 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_C 64
|
||||
#define BLIS_DEFAULT_KC_C 128
|
||||
#define BLIS_DEFAULT_NC_C 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_Z 64
|
||||
#define BLIS_DEFAULT_KC_Z 128
|
||||
#define BLIS_DEFAULT_NC_Z 4096
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
#define BLIS_DEFAULT_MR_S 4
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_D 4
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 2
|
||||
#define BLIS_DEFAULT_NR_C 2
|
||||
|
||||
#define BLIS_DEFAULT_MR_Z 2
|
||||
#define BLIS_DEFAULT_NR_Z 2
|
||||
|
||||
// NOTE: If the micro-kernel, which is typically unrolled to a factor
|
||||
// of f, handles leftover edge cases (ie: when k % f > 0) then these
|
||||
// register blocksizes in the k dimension can be defined to 1.
|
||||
|
||||
//#define BLIS_DEFAULT_KR_S 1
|
||||
//#define BLIS_DEFAULT_KR_D 1
|
||||
//#define BLIS_DEFAULT_KR_C 1
|
||||
//#define BLIS_DEFAULT_KR_Z 1
|
||||
|
||||
// -- Maximum cache blocksizes (for optimizing edge cases) --
|
||||
|
||||
// NOTE: These cache blocksize "extensions" have the same constraints as
|
||||
// the corresponding default blocksizes above. When these values are
|
||||
// larger than the default blocksizes, blocksizes used at edge cases are
|
||||
// enlarged if such an extension would encompass the remaining portion of
|
||||
// the matrix dimension.
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_S (BLIS_DEFAULT_MC_S + BLIS_DEFAULT_MC_S/4)
|
||||
//#define BLIS_MAXIMUM_KC_S (BLIS_DEFAULT_KC_S + BLIS_DEFAULT_KC_S/4)
|
||||
//#define BLIS_MAXIMUM_NC_S (BLIS_DEFAULT_NC_S + BLIS_DEFAULT_NC_S/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_D (BLIS_DEFAULT_MC_D + BLIS_DEFAULT_MC_D/4)
|
||||
//#define BLIS_MAXIMUM_KC_D (BLIS_DEFAULT_KC_D + BLIS_DEFAULT_KC_D/4)
|
||||
//#define BLIS_MAXIMUM_NC_D (BLIS_DEFAULT_NC_D + BLIS_DEFAULT_NC_D/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_C (BLIS_DEFAULT_MC_C + BLIS_DEFAULT_MC_C/4)
|
||||
//#define BLIS_MAXIMUM_KC_C (BLIS_DEFAULT_KC_C + BLIS_DEFAULT_KC_C/4)
|
||||
//#define BLIS_MAXIMUM_NC_C (BLIS_DEFAULT_NC_C + BLIS_DEFAULT_NC_C/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_Z (BLIS_DEFAULT_MC_Z + BLIS_DEFAULT_MC_Z/4)
|
||||
//#define BLIS_MAXIMUM_KC_Z (BLIS_DEFAULT_KC_Z + BLIS_DEFAULT_KC_Z/4)
|
||||
//#define BLIS_MAXIMUM_NC_Z (BLIS_DEFAULT_NC_Z + BLIS_DEFAULT_NC_Z/4)
|
||||
|
||||
// -- Packing register blocksize (for packed micro-panels) --
|
||||
|
||||
// NOTE: These register blocksize "extensions" determine whether the
|
||||
// leading dimensions used within the packed micro-panels are equal to
|
||||
// or greater than their corresponding register blocksizes above.
|
||||
|
||||
//#define BLIS_PACKDIM_MR_S (BLIS_DEFAULT_MR_S + ...)
|
||||
//#define BLIS_PACKDIM_NR_S (BLIS_DEFAULT_NR_S + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_D (BLIS_DEFAULT_MR_D + ...)
|
||||
//#define BLIS_PACKDIM_NR_D (BLIS_DEFAULT_NR_D + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_C (BLIS_DEFAULT_MR_C + ...)
|
||||
//#define BLIS_PACKDIM_NR_C (BLIS_DEFAULT_NR_C + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_Z (BLIS_DEFAULT_MR_Z + ...)
|
||||
//#define BLIS_PACKDIM_NR_Z (BLIS_DEFAULT_NR_Z + ...)
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_opt_4x4
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_4x4
|
||||
#define BLIS_CGEMM_UKERNEL bli_cgemm_opt_4x4
|
||||
#define BLIS_ZGEMM_UKERNEL bli_zgemm_opt_4x4
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/armv7a
|
||||
@@ -1,212 +0,0 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
|
||||
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_DEFAULT_MC_S 120 //1536 //336 //416 // 1280 //160 // 160 // 160 //2048 //336
|
||||
#define BLIS_DEFAULT_KC_S 640 //1536 //336 //704 //1280 //672 //528 // 856 //2048 //528
|
||||
#define BLIS_DEFAULT_NC_S 3072
|
||||
|
||||
#define BLIS_DEFAULT_MC_D 120 //1536 //160 //80 //176
|
||||
#define BLIS_DEFAULT_KC_D 240 //1536 //304 //336 //368
|
||||
#define BLIS_DEFAULT_NC_D 3072
|
||||
|
||||
#define BLIS_DEFAULT_MC_C 64
|
||||
#define BLIS_DEFAULT_KC_C 128
|
||||
#define BLIS_DEFAULT_NC_C 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_Z 64
|
||||
#define BLIS_DEFAULT_KC_Z 128
|
||||
#define BLIS_DEFAULT_NC_Z 4096
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
#define BLIS_DEFAULT_MR_S 8
|
||||
#define BLIS_DEFAULT_NR_S 12
|
||||
|
||||
#define BLIS_DEFAULT_MR_D 6
|
||||
#define BLIS_DEFAULT_NR_D 8
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_Z 8
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
|
||||
// NOTE: If the micro-kernel, which is typically unrolled to a factor
|
||||
// of f, handles leftover edge cases (ie: when k % f > 0) then these
|
||||
// register blocksizes in the k dimension can be defined to 1.
|
||||
|
||||
//#define BLIS_DEFAULT_KR_S 1
|
||||
//#define BLIS_DEFAULT_KR_D 1
|
||||
//#define BLIS_DEFAULT_KR_C 1
|
||||
//#define BLIS_DEFAULT_KR_Z 1
|
||||
|
||||
// -- Maximum cache blocksizes (for optimizing edge cases) --
|
||||
|
||||
// NOTE: These cache blocksize "extensions" have the same constraints as
|
||||
// the corresponding default blocksizes above. When these values are
|
||||
// larger than the default blocksizes, blocksizes used at edge cases are
|
||||
// enlarged if such an extension would encompass the remaining portion of
|
||||
// the matrix dimension.
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_S (BLIS_DEFAULT_MC_S + BLIS_DEFAULT_MC_S/4)
|
||||
//#define BLIS_MAXIMUM_KC_S (BLIS_DEFAULT_KC_S + BLIS_DEFAULT_KC_S/4)
|
||||
//#define BLIS_MAXIMUM_NC_S (BLIS_DEFAULT_NC_S + BLIS_DEFAULT_NC_S/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_D (BLIS_DEFAULT_MC_D + BLIS_DEFAULT_MC_D/4)
|
||||
//#define BLIS_MAXIMUM_KC_D (BLIS_DEFAULT_KC_D + BLIS_DEFAULT_KC_D/4)
|
||||
//#define BLIS_MAXIMUM_NC_D (BLIS_DEFAULT_NC_D + BLIS_DEFAULT_NC_D/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_C (BLIS_DEFAULT_MC_C + BLIS_DEFAULT_MC_C/4)
|
||||
//#define BLIS_MAXIMUM_KC_C (BLIS_DEFAULT_KC_C + BLIS_DEFAULT_KC_C/4)
|
||||
//#define BLIS_MAXIMUM_NC_C (BLIS_DEFAULT_NC_C + BLIS_DEFAULT_NC_C/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_Z (BLIS_DEFAULT_MC_Z + BLIS_DEFAULT_MC_Z/4)
|
||||
//#define BLIS_MAXIMUM_KC_Z (BLIS_DEFAULT_KC_Z + BLIS_DEFAULT_KC_Z/4)
|
||||
//#define BLIS_MAXIMUM_NC_Z (BLIS_DEFAULT_NC_Z + BLIS_DEFAULT_NC_Z/4)
|
||||
|
||||
// -- Packing register blocksize (for packed micro-panels) --
|
||||
|
||||
// NOTE: These register blocksize "extensions" determine whether the
|
||||
// leading dimensions used within the packed micro-panels are equal to
|
||||
// or greater than their corresponding register blocksizes above.
|
||||
|
||||
//#define BLIS_PACKDIM_MR_S (BLIS_DEFAULT_MR_S + ...)
|
||||
//#define BLIS_PACKDIM_NR_S (BLIS_DEFAULT_NR_S + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_D (BLIS_DEFAULT_MR_D + ...)
|
||||
//#define BLIS_PACKDIM_NR_D (BLIS_DEFAULT_NR_D + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_C (BLIS_DEFAULT_MR_C + ...)
|
||||
//#define BLIS_PACKDIM_NR_C (BLIS_DEFAULT_NR_C + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_Z (BLIS_DEFAULT_MR_Z + ...)
|
||||
//#define BLIS_PACKDIM_NR_Z (BLIS_DEFAULT_NR_Z + ...)
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_opt_8x12
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_6x8
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/armv8a/
|
||||
@@ -34,43 +34,44 @@
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_syr2k_basic_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* bt,
|
||||
obj_t* b,
|
||||
obj_t* at,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
void bli_cntx_init_bgq( cntx_t* cntx )
|
||||
{
|
||||
// The basic properties of syr2k are identical to that of her2k.
|
||||
bli_her2k_basic_check( alpha, a, bt, alpha, b, at, beta, c );
|
||||
}
|
||||
|
||||
void bli_syr2k_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
{
|
||||
err_t e_val;
|
||||
obj_t at, bt;
|
||||
|
||||
// Alias A and B to A^T and B^T so we can perform dimension checks.
|
||||
bli_obj_alias_with_trans( BLIS_TRANSPOSE, *a, at );
|
||||
bli_obj_alias_with_trans( BLIS_TRANSPOSE, *b, bt );
|
||||
|
||||
// Check basic properties of the operation.
|
||||
|
||||
bli_syr2k_basic_check( alpha, a, &bt, b, &at, beta, c );
|
||||
|
||||
// Check matrix squareness.
|
||||
|
||||
e_val = bli_check_square_object( c );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
// Check matrix structure.
|
||||
|
||||
e_val = bli_check_symmetric_object( c );
|
||||
bli_check_error_code( e_val );
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_bgq_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
2,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_bgq_int_8x8, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DCOMPLEX, bli_zgemm_bgq_int_4x4, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 0, 8, 0, 4 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 0, 8, 0, 4 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 0, 1024, 0, 768 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 0, 2048, 0, 1536 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 0, 10240, 0, 10240 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
87
config/bgq/bli_family_bgq.h
Normal file
87
config/bgq/bli_family_bgq.h
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
#undef restrict
|
||||
|
||||
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_DEFAULT_MR_S 8
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
#define BLIS_DEFAULT_MC_S 1024
|
||||
#define BLIS_DEFAULT_KC_S 2048
|
||||
#define BLIS_DEFAULT_NC_S 8192
|
||||
|
||||
// 1 MPI RANK CASE:
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_int_8x8
|
||||
#define BLIS_DEFAULT_MR_D 8
|
||||
#define BLIS_DEFAULT_NR_D 8
|
||||
#define BLIS_DEFAULT_MC_D 1024
|
||||
#define BLIS_DEFAULT_KC_D 2048
|
||||
#define BLIS_DEFAULT_NC_D 10240
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
#define BLIS_DEFAULT_MC_C 1024
|
||||
#define BLIS_DEFAULT_KC_C 2048
|
||||
#define BLIS_DEFAULT_NC_C 8192
|
||||
|
||||
#define BLIS_ZGEMM_UKERNEL bli_zgemm_int_8x8
|
||||
#define BLIS_DEFAULT_MR_Z 4
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
#define BLIS_DEFAULT_MC_Z 768
|
||||
#define BLIS_DEFAULT_KC_Z 1536
|
||||
#define BLIS_DEFAULT_NC_Z 10240
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
#define BLIS_DEFAULT_AF_D 8
|
||||
#define BLIS_DAXPYF_KERNEL bli_daxpyf_opt_var1
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
#define BLIS_DAXPYV_KERNEL bli_daxpyv_opt_var1
|
||||
#define BLIS_DDOTV_KERNEL bli_ddotv_opt_var1
|
||||
#endif
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
|
||||
|
||||
#undef restrict
|
||||
|
||||
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_DEFAULT_MC_S 1024
|
||||
#define BLIS_DEFAULT_KC_S 2048
|
||||
#define BLIS_DEFAULT_NC_S 8192
|
||||
|
||||
// 1 MPI RANK CASE:
|
||||
#define BLIS_DEFAULT_MC_D 1024
|
||||
#define BLIS_DEFAULT_KC_D 2048
|
||||
#define BLIS_DEFAULT_NC_D 10240
|
||||
|
||||
#define BLIS_DEFAULT_MC_C 1024
|
||||
#define BLIS_DEFAULT_KC_C 2048
|
||||
#define BLIS_DEFAULT_NC_C 8192
|
||||
|
||||
#define BLIS_DEFAULT_MC_Z 768
|
||||
#define BLIS_DEFAULT_KC_Z 1536
|
||||
#define BLIS_DEFAULT_NC_Z 10240
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
#define BLIS_DEFAULT_MR_S 8
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_D 8
|
||||
#define BLIS_DEFAULT_NR_D 8
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_Z 4
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
|
||||
// NOTE: If the micro-kernel, which is typically unrolled to a factor
|
||||
// of f, handles leftover edge cases (ie: when k % f > 0) then these
|
||||
// register blocksizes in the k dimension can be defined to 1.
|
||||
|
||||
//#define BLIS_DEFAULT_KR_S 1
|
||||
//#define BLIS_DEFAULT_KR_D 1
|
||||
//#define BLIS_DEFAULT_KR_C 1
|
||||
//#define BLIS_DEFAULT_KR_Z 1
|
||||
|
||||
// -- Maximum cache blocksizes (for optimizing edge cases) --
|
||||
|
||||
// NOTE: These cache blocksize "extensions" have the same constraints as
|
||||
// the corresponding default blocksizes above. When these values are
|
||||
// larger than the default blocksizes, blocksizes used at edge cases are
|
||||
// enlarged if such an extension would encompass the remaining portion of
|
||||
// the matrix dimension.
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_S (BLIS_DEFAULT_MC_S + BLIS_DEFAULT_MC_S/4)
|
||||
//#define BLIS_MAXIMUM_KC_S (BLIS_DEFAULT_KC_S + BLIS_DEFAULT_KC_S/4)
|
||||
//#define BLIS_MAXIMUM_NC_S (BLIS_DEFAULT_NC_S + BLIS_DEFAULT_NC_S/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_D (BLIS_DEFAULT_MC_D + BLIS_DEFAULT_MC_D/4)
|
||||
//#define BLIS_MAXIMUM_KC_D (BLIS_DEFAULT_KC_D + BLIS_DEFAULT_KC_D/4)
|
||||
//#define BLIS_MAXIMUM_NC_D (BLIS_DEFAULT_NC_D + BLIS_DEFAULT_NC_D/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_C (BLIS_DEFAULT_MC_C + BLIS_DEFAULT_MC_C/4)
|
||||
//#define BLIS_MAXIMUM_KC_C (BLIS_DEFAULT_KC_C + BLIS_DEFAULT_KC_C/4)
|
||||
//#define BLIS_MAXIMUM_NC_C (BLIS_DEFAULT_NC_C + BLIS_DEFAULT_NC_C/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_Z (BLIS_DEFAULT_MC_Z + BLIS_DEFAULT_MC_Z/4)
|
||||
//#define BLIS_MAXIMUM_KC_Z (BLIS_DEFAULT_KC_Z + BLIS_DEFAULT_KC_Z/4)
|
||||
//#define BLIS_MAXIMUM_NC_Z (BLIS_DEFAULT_NC_Z + BLIS_DEFAULT_NC_Z/4)
|
||||
|
||||
// -- Packing register blocksize (for packed micro-panels) --
|
||||
|
||||
// NOTE: These register blocksize "extensions" determine whether the
|
||||
// leading dimensions used within the packed micro-panels are equal to
|
||||
// or greater than their corresponding register blocksizes above.
|
||||
|
||||
//#define BLIS_PACKDIM_MR_S (BLIS_DEFAULT_MR_S + ...)
|
||||
//#define BLIS_PACKDIM_NR_S (BLIS_DEFAULT_NR_S + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_D (BLIS_DEFAULT_MR_D + ...)
|
||||
//#define BLIS_PACKDIM_NR_D (BLIS_DEFAULT_NR_D + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_C (BLIS_DEFAULT_MR_C + ...)
|
||||
//#define BLIS_PACKDIM_NR_C (BLIS_DEFAULT_NR_C + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_Z (BLIS_DEFAULT_MR_Z + ...)
|
||||
//#define BLIS_PACKDIM_NR_Z (BLIS_DEFAULT_NR_Z + ...)
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
// -- Default fusing factors for level-1f operations --
|
||||
|
||||
#define BLIS_DEFAULT_AF_D 8
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_int_8x8
|
||||
#define BLIS_ZGEMM_UKERNEL bli_zgemm_int_8x8
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
#define BLIS_DAXPYF_KERNEL bli_daxpyf_opt_var1
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
#define BLIS_DAXPYV_KERNEL bli_daxpyv_opt_var1
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
#define BLIS_DDOTV_KERNEL bli_ddotv_opt_var1
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/bgq
|
||||
@@ -32,40 +32,50 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := bgq
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := /bgsys/drivers/ppcfloor/comm/gcc.legacy/bin/mpixlc_r
|
||||
CC_VENDOR := IBM
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
CC_VENDOR := ibm
|
||||
endif
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L \
|
||||
-I/bgsys/drivers/ppcfloor -I/bgsys/drivers/ppcfloor/spi/include/kernel/cnk
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L -I/bgsys/drivers/ppcfloor -I/bgsys/drivers/ppcfloor/spi/include/kernel/cnk
|
||||
CMISCFLAGS := -qthreaded -qsmp=omp -qasm=gcc -qkeyword=asm # -qreport -qsource -qlistopt -qlist
|
||||
CPICFLAGS :=
|
||||
CDBGFLAGS :=
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -w
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_TYPE),noopt)
|
||||
COPTFLAGS := -O0
|
||||
else
|
||||
COPTFLAGS := -O3
|
||||
endif
|
||||
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
ifeq ($(CC_VENDOR),ibm)
|
||||
CVECFLAGS := -qarch=qp -qtune=qp -qsimd=auto -qhot=level=1 -qprefetch -qunroll=yes -qnoipa
|
||||
else
|
||||
$(error xlc is required for this configuration.)
|
||||
endif
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
# Override the default value for LDFLAGS.
|
||||
LDFLAGS := -L/bgsys/drivers/ppcfloor/spi/lib -lSPI -lSPI_cnk -qthreaded -qsmp=omp
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
|
||||
79
config/bulldozer/bli_cntx_init_bulldozer.c
Normal file
79
config/bulldozer/bli_cntx_init_bulldozer.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_bulldozer( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_bulldozer_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
4,
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_bulldozer_asm_8x8_fma4, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_bulldozer_asm_4x6_fma4, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_SCOMPLEX, bli_cgemm_bulldozer_asm_8x4_fma4, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DCOMPLEX, bli_zgemm_bulldozer_asm_4x4_fma4, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 8, 4, 8, 4 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 8, 6, 4, 4 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 128, 1080, 96, 64 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 384, 120, 256, 192 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 4096, 8400, 4096, 4096 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,42 +32,14 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_asm_8x8_fma4
|
||||
#define BLIS_DEFAULT_MC_S 128
|
||||
#define BLIS_DEFAULT_KC_S 384
|
||||
@@ -95,61 +67,9 @@
|
||||
#define BLIS_DEFAULT_NC_Z 4096
|
||||
#define BLIS_DEFAULT_MR_Z 4
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/x86_64/bulldozer/
|
||||
@@ -32,34 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := bulldozer
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
else
|
||||
$(error gcc or clang are required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -71,21 +64,19 @@ else
|
||||
COPTFLAGS := -O2 -malign-double -funroll-all-loops
|
||||
endif
|
||||
|
||||
CVECFLAGS := -mavx -mfma4 -march=bdver1 -mfpmath=sse
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -mfpmath=sse -mavx -mfma4 -march=bdver1
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
CVECFLAGS := -mfpmath=sse -mavx -mfma4 -march=bdver1
|
||||
else
|
||||
$(error gcc or clang are required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/x86_64/piledriver
|
||||
@@ -1,212 +0,0 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
|
||||
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_DEFAULT_MC_S 336
|
||||
#define BLIS_DEFAULT_KC_S 528
|
||||
#define BLIS_DEFAULT_NC_S 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_D 176
|
||||
#define BLIS_DEFAULT_KC_D 368
|
||||
#define BLIS_DEFAULT_NC_D 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_C 64
|
||||
#define BLIS_DEFAULT_KC_C 128
|
||||
#define BLIS_DEFAULT_NC_C 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_Z 64
|
||||
#define BLIS_DEFAULT_KC_Z 128
|
||||
#define BLIS_DEFAULT_NC_Z 4096
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
#define BLIS_DEFAULT_MR_S 4
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_D 4
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_Z 8
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
|
||||
// NOTE: If the micro-kernel, which is typically unrolled to a factor
|
||||
// of f, handles leftover edge cases (ie: when k % f > 0) then these
|
||||
// register blocksizes in the k dimension can be defined to 1.
|
||||
|
||||
//#define BLIS_DEFAULT_KR_S 1
|
||||
//#define BLIS_DEFAULT_KR_D 1
|
||||
//#define BLIS_DEFAULT_KR_C 1
|
||||
//#define BLIS_DEFAULT_KR_Z 1
|
||||
|
||||
// -- Maximum cache blocksizes (for optimizing edge cases) --
|
||||
|
||||
// NOTE: These cache blocksize "extensions" have the same constraints as
|
||||
// the corresponding default blocksizes above. When these values are
|
||||
// larger than the default blocksizes, blocksizes used at edge cases are
|
||||
// enlarged if such an extension would encompass the remaining portion of
|
||||
// the matrix dimension.
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_S (BLIS_DEFAULT_MC_S + BLIS_DEFAULT_MC_S/4)
|
||||
//#define BLIS_MAXIMUM_KC_S (BLIS_DEFAULT_KC_S + BLIS_DEFAULT_KC_S/4)
|
||||
//#define BLIS_MAXIMUM_NC_S (BLIS_DEFAULT_NC_S + BLIS_DEFAULT_NC_S/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_D (BLIS_DEFAULT_MC_D + BLIS_DEFAULT_MC_D/4)
|
||||
//#define BLIS_MAXIMUM_KC_D (BLIS_DEFAULT_KC_D + BLIS_DEFAULT_KC_D/4)
|
||||
//#define BLIS_MAXIMUM_NC_D (BLIS_DEFAULT_NC_D + BLIS_DEFAULT_NC_D/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_C (BLIS_DEFAULT_MC_C + BLIS_DEFAULT_MC_C/4)
|
||||
//#define BLIS_MAXIMUM_KC_C (BLIS_DEFAULT_KC_C + BLIS_DEFAULT_KC_C/4)
|
||||
//#define BLIS_MAXIMUM_NC_C (BLIS_DEFAULT_NC_C + BLIS_DEFAULT_NC_C/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_Z (BLIS_DEFAULT_MC_Z + BLIS_DEFAULT_MC_Z/4)
|
||||
//#define BLIS_MAXIMUM_KC_Z (BLIS_DEFAULT_KC_Z + BLIS_DEFAULT_KC_Z/4)
|
||||
//#define BLIS_MAXIMUM_NC_Z (BLIS_DEFAULT_NC_Z + BLIS_DEFAULT_NC_Z/4)
|
||||
|
||||
// -- Packing register blocksize (for packed micro-panels) --
|
||||
|
||||
// NOTE: These register blocksize "extensions" determine whether the
|
||||
// leading dimensions used within the packed micro-panels are equal to
|
||||
// or greater than their corresponding register blocksizes above.
|
||||
|
||||
//#define BLIS_PACKDIM_MR_S (BLIS_DEFAULT_MR_S + ...)
|
||||
//#define BLIS_PACKDIM_NR_S (BLIS_DEFAULT_NR_S + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_D (BLIS_DEFAULT_MR_D + ...)
|
||||
//#define BLIS_PACKDIM_NR_D (BLIS_DEFAULT_NR_D + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_C (BLIS_DEFAULT_MR_C + ...)
|
||||
//#define BLIS_PACKDIM_NR_C (BLIS_DEFAULT_NR_C + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_Z (BLIS_DEFAULT_MR_Z + ...)
|
||||
//#define BLIS_PACKDIM_NR_Z (BLIS_DEFAULT_NR_Z + ...)
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_opt_4x4
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_4x4
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/arm
|
||||
@@ -1,212 +0,0 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
|
||||
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_DEFAULT_MC_S 432
|
||||
#define BLIS_DEFAULT_KC_S 352
|
||||
#define BLIS_DEFAULT_NC_S 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_D 176
|
||||
#define BLIS_DEFAULT_KC_D 368
|
||||
#define BLIS_DEFAULT_NC_D 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_C 64
|
||||
#define BLIS_DEFAULT_KC_C 128
|
||||
#define BLIS_DEFAULT_NC_C 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_Z 64
|
||||
#define BLIS_DEFAULT_KC_Z 128
|
||||
#define BLIS_DEFAULT_NC_Z 4096
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
#define BLIS_DEFAULT_MR_S 4
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_D 4
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_Z 8
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
|
||||
// NOTE: If the micro-kernel, which is typically unrolled to a factor
|
||||
// of f, handles leftover edge cases (ie: when k % f > 0) then these
|
||||
// register blocksizes in the k dimension can be defined to 1.
|
||||
|
||||
//#define BLIS_DEFAULT_KR_S 1
|
||||
//#define BLIS_DEFAULT_KR_D 1
|
||||
//#define BLIS_DEFAULT_KR_C 1
|
||||
//#define BLIS_DEFAULT_KR_Z 1
|
||||
|
||||
// -- Maximum cache blocksizes (for optimizing edge cases) --
|
||||
|
||||
// NOTE: These cache blocksize "extensions" have the same constraints as
|
||||
// the corresponding default blocksizes above. When these values are
|
||||
// larger than the default blocksizes, blocksizes used at edge cases are
|
||||
// enlarged if such an extension would encompass the remaining portion of
|
||||
// the matrix dimension.
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_S (BLIS_DEFAULT_MC_S + BLIS_DEFAULT_MC_S/4)
|
||||
//#define BLIS_MAXIMUM_KC_S (BLIS_DEFAULT_KC_S + BLIS_DEFAULT_KC_S/4)
|
||||
//#define BLIS_MAXIMUM_NC_S (BLIS_DEFAULT_NC_S + BLIS_DEFAULT_NC_S/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_D (BLIS_DEFAULT_MC_D + BLIS_DEFAULT_MC_D/4)
|
||||
//#define BLIS_MAXIMUM_KC_D (BLIS_DEFAULT_KC_D + BLIS_DEFAULT_KC_D/4)
|
||||
//#define BLIS_MAXIMUM_NC_D (BLIS_DEFAULT_NC_D + BLIS_DEFAULT_NC_D/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_C (BLIS_DEFAULT_MC_C + BLIS_DEFAULT_MC_C/4)
|
||||
//#define BLIS_MAXIMUM_KC_C (BLIS_DEFAULT_KC_C + BLIS_DEFAULT_KC_C/4)
|
||||
//#define BLIS_MAXIMUM_NC_C (BLIS_DEFAULT_NC_C + BLIS_DEFAULT_NC_C/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_Z (BLIS_DEFAULT_MC_Z + BLIS_DEFAULT_MC_Z/4)
|
||||
//#define BLIS_MAXIMUM_KC_Z (BLIS_DEFAULT_KC_Z + BLIS_DEFAULT_KC_Z/4)
|
||||
//#define BLIS_MAXIMUM_NC_Z (BLIS_DEFAULT_NC_Z + BLIS_DEFAULT_NC_Z/4)
|
||||
|
||||
// -- Packing register blocksize (for packed micro-panels) --
|
||||
|
||||
// NOTE: These register blocksize "extensions" determine whether the
|
||||
// leading dimensions used within the packed micro-panels are equal to
|
||||
// or greater than their corresponding register blocksizes above.
|
||||
|
||||
//#define BLIS_PACKDIM_MR_S (BLIS_DEFAULT_MR_S + ...)
|
||||
//#define BLIS_PACKDIM_NR_S (BLIS_DEFAULT_NR_S + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_D (BLIS_DEFAULT_MR_D + ...)
|
||||
//#define BLIS_PACKDIM_NR_D (BLIS_DEFAULT_NR_D + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_C (BLIS_DEFAULT_MR_C + ...)
|
||||
//#define BLIS_PACKDIM_NR_C (BLIS_DEFAULT_NR_C + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_Z (BLIS_DEFAULT_MR_Z + ...)
|
||||
//#define BLIS_PACKDIM_NR_Z (BLIS_DEFAULT_NR_Z + ...)
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_opt_4x4
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_4x4
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/arm
|
||||
77
config/cortexa15/bli_cntx_init_cortexa15.c
Normal file
77
config/cortexa15/bli_cntx_init_cortexa15.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_cortexa15( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_cortexa15_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
2,
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_arm_int_4x4, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_arm_int_4x4, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 4, 4, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 4, 4, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 336, 176, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 528, 368, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 4096, 4096, 0, 0 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,42 +32,46 @@
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
void bli_syrk_basic_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* at,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
{
|
||||
|
||||
// The basic properties of syrk are identical to that of herk.
|
||||
bli_herk_basic_check( alpha, a, at, beta, c );
|
||||
}
|
||||
// -- MEMORY ALLOCATION --------------------------------------------------------
|
||||
|
||||
void bli_syrk_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
{
|
||||
err_t e_val;
|
||||
obj_t at;
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
// Alias A to A^T so we can perform dimension checks.
|
||||
bli_obj_alias_with_trans( BLIS_TRANSPOSE, *a, at );
|
||||
|
||||
// Check basic properties of the operation.
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
bli_syrk_basic_check( alpha, a, &at, beta, c );
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_opt_4x4
|
||||
#define BLIS_DEFAULT_MR_S 4
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
#define BLIS_DEFAULT_MC_S 336
|
||||
#define BLIS_DEFAULT_KC_S 528
|
||||
#define BLIS_DEFAULT_NC_S 4096
|
||||
|
||||
// Check matrix squareness.
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_4x4
|
||||
#define BLIS_DEFAULT_MR_D 4
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
#define BLIS_DEFAULT_MC_D 176
|
||||
#define BLIS_DEFAULT_KC_D 368
|
||||
#define BLIS_DEFAULT_NC_D 4096
|
||||
|
||||
e_val = bli_check_square_object( c );
|
||||
bli_check_error_code( e_val );
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
#define BLIS_DEFAULT_MC_C 64
|
||||
#define BLIS_DEFAULT_KC_C 128
|
||||
#define BLIS_DEFAULT_NC_C 4096
|
||||
|
||||
// Check matrix structure.
|
||||
#define BLIS_DEFAULT_MR_Z 8
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
#define BLIS_DEFAULT_MC_Z 64
|
||||
#define BLIS_DEFAULT_KC_Z 128
|
||||
#define BLIS_DEFAULT_NC_Z 4096
|
||||
#endif
|
||||
|
||||
e_val = bli_check_symmetric_object( c );
|
||||
bli_check_error_code( e_val );
|
||||
}
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -32,30 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := cortexa15
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
ifneq ($(CC_VENDOR),gcc)
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99 -mfloat-abi=hard -mfpu=neon
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -67,21 +64,15 @@ else
|
||||
COPTFLAGS := -O2
|
||||
endif
|
||||
|
||||
CVECFLAGS := -march=armv7-a
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -march=armv7-a
|
||||
else
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
77
config/cortexa57/bli_cntx_init_cortexa57.c
Normal file
77
config/cortexa57/bli_cntx_init_cortexa57.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_cortexa57( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_cortexa57_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
2,
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_cortexa57_asm_8x12, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_cortexa57_asm_6x8, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 8, 6, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 12, 8, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 120, 120, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 640, 240, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 3072, 3072, 0, 0 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
76
config/cortexa57/bli_family_cortexa57.h
Normal file
76
config/cortexa57/bli_family_cortexa57.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
// -- MEMORY ALLOCATION --------------------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_opt_8x12
|
||||
#define BLIS_DEFAULT_MR_S 8
|
||||
#define BLIS_DEFAULT_NR_S 12
|
||||
#define BLIS_DEFAULT_MC_S 120 //1536 //336 //416 // 1280 //160 // 160 // 160 //2048 //336
|
||||
#define BLIS_DEFAULT_KC_S 640 //1536 //336 //704 //1280 //672 //528 // 856 //2048 //528
|
||||
#define BLIS_DEFAULT_NC_S 3072
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_6x8
|
||||
#define BLIS_DEFAULT_MR_D 6
|
||||
#define BLIS_DEFAULT_NR_D 8
|
||||
#define BLIS_DEFAULT_MC_D 120 //1536 //160 //80 //176
|
||||
#define BLIS_DEFAULT_KC_D 240 //1536 //304 //336 //368
|
||||
#define BLIS_DEFAULT_NC_D 3072
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
#define BLIS_DEFAULT_MC_C 64
|
||||
#define BLIS_DEFAULT_KC_C 128
|
||||
#define BLIS_DEFAULT_NC_C 4096
|
||||
|
||||
#define BLIS_DEFAULT_MR_Z 8
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
#define BLIS_DEFAULT_MC_Z 64
|
||||
#define BLIS_DEFAULT_KC_Z 128
|
||||
#define BLIS_DEFAULT_NC_Z 4096
|
||||
#endif
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -32,30 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := cortexa57
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
ifneq ($(CC_VENDOR),gcc)
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_GNU_SOURCE
|
||||
CMISCFLAGS := -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -67,21 +64,15 @@ else
|
||||
COPTFLAGS := -O3 -ftree-vectorize -mtune=cortex-a57.cortex-a53
|
||||
endif
|
||||
|
||||
CVECFLAGS := -march=armv8-a+fp+simd -mcpu=cortex-a57.cortex-a53
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -march=armv8-a+fp+simd -mcpu=cortex-a57.cortex-a53
|
||||
else
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
@@ -34,38 +34,44 @@
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_trmm_prune_unref_mparts_m( obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* c )
|
||||
void bli_cntx_init_cortexa9( cntx_t* cntx )
|
||||
{
|
||||
// Prune any unreferenced part from the subpartition of A (that would
|
||||
// be encountered from partitioning in the m dimension) and adjust the
|
||||
// subpartition of C accordingly.
|
||||
bli_prune_unref_mparts( a, BLIS_M, c, BLIS_M );
|
||||
}
|
||||
|
||||
void bli_trmm_prune_unref_mparts_n( obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* c )
|
||||
{
|
||||
// Prune any unreferenced part from the subpartition of B (that would
|
||||
// be encountered from partitioning in the n dimension) and adjust the
|
||||
// subpartition of C accordingly.
|
||||
bli_prune_unref_mparts( b, BLIS_N, c, BLIS_N );
|
||||
}
|
||||
|
||||
void bli_trmm_prune_unref_mparts_k( obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* c )
|
||||
{
|
||||
// Prune any unreferenced part from the subpartition of A (that would
|
||||
// be encountered from partitioning in the k dimension) and adjust the
|
||||
// subpartition of B accordingly.
|
||||
bli_prune_unref_mparts( a, BLIS_N, b, BLIS_M );
|
||||
|
||||
// Prune any unreferenced part from the subpartition of B (that would
|
||||
// be encountered from partitioning in the k dimension) and adjust the
|
||||
// subpartition of A accordingly.
|
||||
bli_prune_unref_mparts( b, BLIS_M, a, BLIS_N );
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_cortexa9_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
2,
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_arm_int_4x4, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_arm_int_4x4, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 4, 4, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 4, 4, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 432, 176, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 352, 368, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 4096, 4096, 0, 0 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,29 +32,46 @@
|
||||
|
||||
*/
|
||||
|
||||
void bli_her2k_basic_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* bh,
|
||||
obj_t* alpha_conj,
|
||||
obj_t* b,
|
||||
obj_t* ah,
|
||||
obj_t* beta,
|
||||
obj_t* c );
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
// -- MEMORY ALLOCATION --------------------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
void bli_her2k_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* bh,
|
||||
obj_t* beta,
|
||||
obj_t* c );
|
||||
|
||||
#if 0
|
||||
void bli_her2k_int_check( obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* bh,
|
||||
obj_t* alpha_conj,
|
||||
obj_t* b,
|
||||
obj_t* ah,
|
||||
obj_t* beta,
|
||||
obj_t* c,
|
||||
her2k_t* cntl );
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_opt_4x4
|
||||
#define BLIS_DEFAULT_MR_S 4
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
#define BLIS_DEFAULT_MC_S 432
|
||||
#define BLIS_DEFAULT_KC_S 352
|
||||
#define BLIS_DEFAULT_NC_S 4096
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_4x4
|
||||
#define BLIS_DEFAULT_MR_D 4
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
#define BLIS_DEFAULT_MC_D 176
|
||||
#define BLIS_DEFAULT_KC_D 368
|
||||
#define BLIS_DEFAULT_NC_D 4096
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
#define BLIS_DEFAULT_MC_C 64
|
||||
#define BLIS_DEFAULT_KC_C 128
|
||||
#define BLIS_DEFAULT_NC_C 4096
|
||||
|
||||
#define BLIS_DEFAULT_MR_Z 8
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
#define BLIS_DEFAULT_MC_Z 64
|
||||
#define BLIS_DEFAULT_KC_Z 128
|
||||
#define BLIS_DEFAULT_NC_Z 4096
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -32,30 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := cortexa9
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
ifneq ($(CC_VENDOR),gcc)
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99 -mfloat-abi=hard -mfpu=neon
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -67,21 +64,15 @@ else
|
||||
COPTFLAGS := -O2
|
||||
endif
|
||||
|
||||
CVECFLAGS := -march=armv7-a
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
ifneq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -march=armv7-a
|
||||
else
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/x86_64/penryn
|
||||
79
config/excavator/bli_cntx_init_excavator.c
Normal file
79
config/excavator/bli_cntx_init_excavator.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_excavator( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_piledriver_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
4,
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_piledriver_asm_16x3, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_piledriver_asm_8x3, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_SCOMPLEX, bli_cgemm_piledriver_asm_4x2, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DCOMPLEX, bli_zgemm_piledriver_asm_2x2, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 16, 8, 4, 2 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 3, 3, 2, 2 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 528, 264, 264, 100 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 256, 256, 256, 320 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 8400, 8400, 8400, 8400 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,136 +32,47 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
// -- MEMORY ALLOCATION --------------------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_asm_16x3
|
||||
#define BLIS_DEFAULT_MR_S 16
|
||||
#define BLIS_DEFAULT_NR_S 3
|
||||
#define BLIS_DEFAULT_MC_S 528
|
||||
#define BLIS_DEFAULT_KC_S 256
|
||||
#define BLIS_DEFAULT_NC_S 8400
|
||||
#define BLIS_DEFAULT_MR_S 16
|
||||
#define BLIS_DEFAULT_NR_S 3
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_asm_8x3
|
||||
#define BLIS_DEFAULT_MR_D 8
|
||||
#define BLIS_DEFAULT_NR_D 3
|
||||
#define BLIS_DEFAULT_MC_D 264
|
||||
#define BLIS_DEFAULT_KC_D 256
|
||||
#define BLIS_DEFAULT_NC_D 8400
|
||||
#define BLIS_DEFAULT_MR_D 8
|
||||
#define BLIS_DEFAULT_NR_D 3
|
||||
|
||||
#define BLIS_CGEMM_UKERNEL bli_cgemm_asm_4x2
|
||||
#define BLIS_DEFAULT_MR_C 4
|
||||
#define BLIS_DEFAULT_NR_C 2
|
||||
#define BLIS_DEFAULT_MC_C 264
|
||||
#define BLIS_DEFAULT_KC_C 256
|
||||
#define BLIS_DEFAULT_NC_C 8400
|
||||
#define BLIS_DEFAULT_MR_C 4
|
||||
#define BLIS_DEFAULT_NR_C 2
|
||||
|
||||
#define BLIS_ZGEMM_UKERNEL bli_zgemm_asm_2x2
|
||||
#define BLIS_DEFAULT_MR_Z 2
|
||||
#define BLIS_DEFAULT_NR_Z 2
|
||||
#define BLIS_DEFAULT_MC_Z 100
|
||||
#define BLIS_DEFAULT_KC_Z 320
|
||||
#define BLIS_DEFAULT_NC_Z 8400
|
||||
#define BLIS_DEFAULT_MR_Z 2
|
||||
#define BLIS_DEFAULT_NR_Z 2
|
||||
|
||||
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
|
||||
|
||||
// -- Micro-panel alignment --
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
82
config/excavator/make_defs.mk
Normal file
82
config/excavator/make_defs.mk
Normal file
@@ -0,0 +1,82 @@
|
||||
#
|
||||
#
|
||||
# BLIS
|
||||
# An object-based framework for developing high-performance BLAS-like
|
||||
# libraries.
|
||||
#
|
||||
# Copyright (C) 2014, The University of Texas at Austin
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# - Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# - Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# - Neither the name of The University of Texas at Austin nor the names
|
||||
# of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := excavator
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_TYPE),noopt)
|
||||
COPTFLAGS := -O0
|
||||
else
|
||||
COPTFLAGS := -O2 -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver4
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver4
|
||||
else
|
||||
$(error gcc or clang are required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
43
config/generic/bli_cntx_init_generic.c
Normal file
43
config/generic/bli_cntx_init_generic.c
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_generic( cntx_t* cntx )
|
||||
{
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_generic_ref( cntx );
|
||||
|
||||
}
|
||||
|
||||
@@ -32,10 +32,11 @@
|
||||
|
||||
*/
|
||||
|
||||
dir_t bli_trsm_direct
|
||||
(
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* c
|
||||
);
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
84
config/generic/make_defs.mk
Normal file
84
config/generic/make_defs.mk
Normal file
@@ -0,0 +1,84 @@
|
||||
#
|
||||
#
|
||||
# BLIS
|
||||
# An object-based framework for developing high-performance BLAS-like
|
||||
# libraries.
|
||||
#
|
||||
# Copyright (C) 2014, The University of Texas at Austin
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# - Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# - Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# - Neither the name of The University of Texas at Austin nor the names
|
||||
# of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := generic
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
|
||||
CPPROCFLAGS :=
|
||||
CMISCFLAGS := -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_TYPE),noopt)
|
||||
COPTFLAGS := -O0
|
||||
else
|
||||
COPTFLAGS := -O3
|
||||
endif
|
||||
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS :=
|
||||
else
|
||||
ifeq ($(CC_VENDOR),icc)
|
||||
CVECFLAGS :=
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
CVECFLAGS :=
|
||||
else
|
||||
$(error gcc, icc, or clang is required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
79
config/haswell/bli_cntx_init_haswell.c
Normal file
79
config/haswell/bli_cntx_init_haswell.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_haswell( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_haswell_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
4,
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_haswell_asm_6x16, TRUE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_haswell_asm_6x8, TRUE,
|
||||
BLIS_GEMM_UKR, BLIS_SCOMPLEX, bli_cgemm_haswell_asm_3x8, TRUE,
|
||||
BLIS_GEMM_UKR, BLIS_DCOMPLEX, bli_zgemm_haswell_asm_3x4, TRUE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 6, 6, 3, 3 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 16, 8, 8, 4 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 144, 72, 144, 72 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 256, 256, 256, 256 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 4080, 4080, 4080, 4080 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,23 +32,14 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS AND DEFINITIONS ---------------------------
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
// -- sgemm micro-kernel --
|
||||
|
||||
#if 0
|
||||
@@ -159,68 +150,8 @@
|
||||
#define BLIS_DEFAULT_NR_Z 3
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/x86_64/haswell
|
||||
@@ -32,28 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := haswell
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99 -m64
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -81,18 +80,7 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
|
||||
*/
|
||||
|
||||
dir_t bli_trmm_direct
|
||||
(
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* c
|
||||
);
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
86
config/intel64/make_defs.mk
Normal file
86
config/intel64/make_defs.mk
Normal file
@@ -0,0 +1,86 @@
|
||||
#
|
||||
#
|
||||
# BLIS
|
||||
# An object-based framework for developing high-performance BLAS-like
|
||||
# libraries.
|
||||
#
|
||||
# Copyright (C) 2014, The University of Texas at Austin
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# - Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# - Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# - Neither the name of The University of Texas at Austin nor the names
|
||||
# of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := intel64
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99 -m64
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_TYPE),noopt)
|
||||
COPTFLAGS := -O0
|
||||
else
|
||||
COPTFLAGS := -O3
|
||||
endif
|
||||
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -mssse3 -mfpmath=sse -march=core2
|
||||
else
|
||||
ifeq ($(CC_VENDOR),icc)
|
||||
CVECFLAGS := -xSSSE3
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
CVECFLAGS := -mssse3 -mfpmath=sse -march=core2
|
||||
else
|
||||
$(error gcc, icc, or clang is required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
78
config/knc/bli_cntx_init_knc.c
Normal file
78
config/knc/bli_cntx_init_knc.c
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_knc( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_knc_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
1,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_knc_asm_30x8, TRUE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 0, 30, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 0, 8, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 0, 120, 0, 0,
|
||||
0, 160, 0, 0 );
|
||||
bli_blksz_init ( &blkszs[ BLIS_KC ], 0, 240, 0, 0,
|
||||
0, 300, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 0, 14400, 0, 0 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
91
config/knc/bli_family_knc.h
Normal file
91
config/knc/bli_family_knc.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
// -- THREADING PARAMTERS ------------------------------------------------------
|
||||
|
||||
#define BLIS_TREE_BARRIER
|
||||
#define BLIS_TREE_BARRIER_ARITY 4
|
||||
|
||||
|
||||
// -- MEMORY ALLOCATION --------------------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 64
|
||||
|
||||
#define BLIS_SIMD_SIZE 64
|
||||
#define BLIS_SIMD_NUM_REGISTERS 32
|
||||
|
||||
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_asm_30x16
|
||||
#define BLIS_DEFAULT_MR_S 30
|
||||
#define BLIS_DEFAULT_NR_S 16
|
||||
#define BLIS_DEFAULT_MC_S 240
|
||||
#define BLIS_DEFAULT_KC_S 240
|
||||
#define BLIS_DEFAULT_NC_S 14400
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL_PREFERS_CONTIG_ROWS
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_asm_30x8
|
||||
#define BLIS_DEFAULT_MR_D 30
|
||||
#define BLIS_DEFAULT_NR_D 8
|
||||
#define BLIS_DEFAULT_MC_D 120
|
||||
#define BLIS_DEFAULT_KC_D 240
|
||||
#define BLIS_DEFAULT_NC_D 14400
|
||||
|
||||
|
||||
#define BLIS_MAXIMUM_MC_S (BLIS_DEFAULT_MC_S + BLIS_DEFAULT_MC_S/4)
|
||||
#define BLIS_MAXIMUM_KC_S (BLIS_DEFAULT_KC_S + BLIS_DEFAULT_KC_S/4)
|
||||
#define BLIS_MAXIMUM_NC_S (BLIS_DEFAULT_NC_S + 0)
|
||||
|
||||
#define BLIS_MAXIMUM_MC_D (BLIS_DEFAULT_MC_D + BLIS_DEFAULT_MC_D/4)
|
||||
#define BLIS_MAXIMUM_KC_D (BLIS_DEFAULT_KC_D + BLIS_DEFAULT_KC_D/4)
|
||||
#define BLIS_MAXIMUM_NC_D (BLIS_DEFAULT_NC_D + 0)
|
||||
|
||||
#define BLIS_PACKDIM_MR_S (BLIS_DEFAULT_MR_S + 2)
|
||||
//#define BLIS_PACKDIM_NR_S (BLIS_DEFAULT_NR_S + ...)
|
||||
|
||||
#define BLIS_PACKDIM_MR_D (BLIS_DEFAULT_MR_D + 2)
|
||||
//#define BLIS_PACKDIM_NR_D (BLIS_DEFAULT_NR_D + ...)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -32,30 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := knc
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := icc
|
||||
CC_VENDOR := icc
|
||||
endif
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
$(error icc is required for this configuration.)
|
||||
endif
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -mmic -fasm-blocks -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -67,23 +64,23 @@ else
|
||||
COPTFLAGS := -O3
|
||||
endif
|
||||
|
||||
CVECFLAGS :=
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifeq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -mmic
|
||||
CVECFLAGS :=
|
||||
else
|
||||
LDFLAGS := -mmic -lm
|
||||
$(error icc is required for this configuration.)
|
||||
endif
|
||||
|
||||
# Override the default value for LDFLAGS.
|
||||
LDFLAGS := -mmic
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
# Never use libm with Intel compilers.
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS += -lm
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
@@ -34,74 +34,54 @@
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_trmm3_basic_check( side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
void bli_cntx_init_knl( cntx_t* cntx )
|
||||
{
|
||||
err_t e_val;
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Check object datatypes.
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_knl_ref( cntx );
|
||||
|
||||
e_val = bli_check_noninteger_object( alpha );
|
||||
bli_check_error_code( e_val );
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
e_val = bli_check_floating_object( a );
|
||||
bli_check_error_code( e_val );
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
1,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_knl_asm_24x8, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
e_val = bli_check_floating_object( b );
|
||||
bli_check_error_code( e_val );
|
||||
// Update the context with optimized packm kernels.
|
||||
bli_cntx_set_packm_kers
|
||||
(
|
||||
2,
|
||||
BLIS_PACKM_8XK_KER, BLIS_DOUBLE, bli_dpackm_knl_asm_8xk,
|
||||
BLIS_PACKM_24XK_KER, BLIS_DOUBLE, bli_dpackm_knl_asm_24xk,
|
||||
cntx
|
||||
);
|
||||
|
||||
e_val = bli_check_floating_object( c );
|
||||
bli_check_error_code( e_val );
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 0, 24, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 0, 8, 0, 0 );
|
||||
bli_blksz_init ( &blkszs[ BLIS_MC ], 0, 120, 0, 0,
|
||||
0, 160, 0, 0 );
|
||||
bli_blksz_init ( &blkszs[ BLIS_KC ], 0, 336, 0, 0,
|
||||
0, 420, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 0, 14400, 0, 0 );
|
||||
|
||||
// Check object dimensions.
|
||||
|
||||
e_val = bli_check_scalar_object( alpha );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
e_val = bli_check_scalar_object( beta );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
e_val = bli_check_matrix_object( a );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
e_val = bli_check_matrix_object( b );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
e_val = bli_check_matrix_object( c );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
if ( bli_is_left( side ) )
|
||||
{
|
||||
e_val = bli_check_level3_dims( a, b, c );
|
||||
bli_check_error_code( e_val );
|
||||
}
|
||||
else // if ( bli_is_right( side ) )
|
||||
{
|
||||
e_val = bli_check_level3_dims( b, a, c );
|
||||
bli_check_error_code( e_val );
|
||||
}
|
||||
}
|
||||
|
||||
void bli_trmm3_check( side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
{
|
||||
err_t e_val;
|
||||
|
||||
// Check basic properties of the operation.
|
||||
|
||||
bli_trmm3_basic_check( side, alpha, a, b, beta, c );
|
||||
|
||||
// Check matrix structure.
|
||||
|
||||
e_val = bli_check_triangular_object( a );
|
||||
bli_check_error_code( e_val );
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,8 +32,20 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
// -- THREADING PARAMETERS -----------------------------------------------------
|
||||
|
||||
#define BLIS_DEFAULT_M_THREAD_RATIO 4
|
||||
#define BLIS_DEFAULT_N_THREAD_RATIO 1
|
||||
|
||||
#define BLIS_DEFAULT_MR_THREAD_MAX 1
|
||||
#define BLIS_DEFAULT_NR_THREAD_MAX 1
|
||||
|
||||
|
||||
// -- MEMORY ALLOCATION --------------------------------------------------------
|
||||
|
||||
//#define BLIS_TREE_BARRIER
|
||||
//#define BLIS_TREE_BARRIER_ARITY 4
|
||||
@@ -62,21 +74,10 @@
|
||||
//#define BLIS_MALLOC_INTL hbw_malloc
|
||||
//#define BLIS_FREE_INTL hbw_free
|
||||
|
||||
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
// -- Cache and register blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL_PREFERS_CONTIG_ROWS
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_opt_30x16_knc
|
||||
#define BLIS_DEFAULT_MC_S 240
|
||||
@@ -118,60 +119,19 @@
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL_PREFERS_CONTIG_ROWS
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_24x8
|
||||
#define BLIS_DEFAULT_MC_D 120
|
||||
#define BLIS_DEFAULT_KC_D 336
|
||||
#define BLIS_DEFAULT_NC_D 14400
|
||||
#define BLIS_DEFAULT_MR_D 24
|
||||
#define BLIS_DEFAULT_NR_D 8
|
||||
#define BLIS_PACKDIM_MR_D 24
|
||||
#define BLIS_PACKDIM_NR_D 8
|
||||
#define BLIS_DEFAULT_MC_D 120
|
||||
#define BLIS_DEFAULT_KC_D 336
|
||||
#define BLIS_DEFAULT_NC_D 14400
|
||||
|
||||
#define BLIS_DPACKM_8XK_KERNEL bli_dpackm_8xk_opt
|
||||
#define BLIS_DPACKM_24XK_KERNEL bli_dpackm_24xk_opt
|
||||
|
||||
#endif
|
||||
|
||||
#define BLIS_DEFAULT_M_THREAD_RATIO 4
|
||||
#define BLIS_DEFAULT_N_THREAD_RATIO 1
|
||||
|
||||
#define BLIS_DEFAULT_MR_THREAD_MAX 1
|
||||
#define BLIS_DEFAULT_NR_THREAD_MAX 1
|
||||
|
||||
/*
|
||||
#define BLIS_DEFAULT_MC_C 120
|
||||
#define BLIS_DEFAULT_KC_C 240
|
||||
#define BLIS_DEFAULT_NC_C 9600
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
#define BLIS_PACKDIM_MR_C 8
|
||||
#define BLIS_PACKDIM_NR_C 4
|
||||
|
||||
#define BLIS_DEFAULT_MC_Z 120
|
||||
#define BLIS_DEFAULT_KC_Z 240
|
||||
#define BLIS_DEFAULT_NC_Z 9600
|
||||
#define BLIS_DEFAULT_MR_Z 8
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
#define BLIS_PACKDIM_MR_Z 8
|
||||
#define BLIS_PACKDIM_NR_Z 4
|
||||
*/
|
||||
|
||||
// NOTE: If the micro-kernel, which is typically unrolled to a factor
|
||||
// of f, handles leftover edge cases (ie: when k % f > 0) then these
|
||||
// register blocksizes in the k dimension can be defined to 1.
|
||||
|
||||
//#define BLIS_DEFAULT_KR_S 1
|
||||
//#define BLIS_DEFAULT_KR_D 1
|
||||
//#define BLIS_DEFAULT_KR_C 1
|
||||
//#define BLIS_DEFAULT_KR_Z 1
|
||||
|
||||
// -- Maximum cache blocksizes (for optimizing edge cases) --
|
||||
|
||||
// NOTE: These cache blocksize "extensions" have the same constraints as
|
||||
// the corresponding default blocksizes above. When these values are
|
||||
// larger than the default blocksizes, blocksizes used at edge cases are
|
||||
// enlarged if such an extension would encompass the remaining portion of
|
||||
// the matrix dimension.
|
||||
|
||||
#define BLIS_MAXIMUM_MC_S (BLIS_DEFAULT_MC_S + BLIS_DEFAULT_MC_S/4)
|
||||
#define BLIS_MAXIMUM_KC_S (BLIS_DEFAULT_KC_S + BLIS_DEFAULT_KC_S/4)
|
||||
#define BLIS_MAXIMUM_NC_S (BLIS_DEFAULT_NC_S + 0)
|
||||
@@ -180,14 +140,8 @@
|
||||
#define BLIS_MAXIMUM_KC_D (BLIS_DEFAULT_KC_D + BLIS_DEFAULT_KC_D/4)
|
||||
#define BLIS_MAXIMUM_NC_D (BLIS_DEFAULT_NC_D + 0)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_C (BLIS_DEFAULT_MC_C + BLIS_DEFAULT_MC_C/4)
|
||||
//#define BLIS_MAXIMUM_KC_C (BLIS_DEFAULT_KC_C + BLIS_DEFAULT_KC_C/4)
|
||||
//#define BLIS_MAXIMUM_NC_C (BLIS_DEFAULT_NC_C + BLIS_DEFAULT_NC_C/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_Z (BLIS_DEFAULT_MC_Z + BLIS_DEFAULT_MC_Z/4)
|
||||
//#define BLIS_MAXIMUM_KC_Z (BLIS_DEFAULT_KC_Z + BLIS_DEFAULT_KC_Z/4)
|
||||
//#define BLIS_MAXIMUM_NC_Z (BLIS_DEFAULT_NC_Z + BLIS_DEFAULT_NC_Z/4)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/x86_64/knl
|
||||
@@ -32,28 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := knl
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99 -m64
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -85,32 +84,27 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# The assembler on OS X won't recognize AVX512 without help
|
||||
# The assembler on OS X won't recognize AVX512 without help.
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
ifeq ($(OS_NAME),Darwin)
|
||||
CVECFLAGS += -Wa,-march=knl
|
||||
endif
|
||||
endif
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
|
||||
ifneq ($(DEBUG_TYPE),sde)
|
||||
LDFLAGS := -lmemkind
|
||||
else
|
||||
# Override the default value for LDFLAGS.
|
||||
LDFLAGS :=
|
||||
|
||||
# Never use libmemkind with Intel SDE.
|
||||
ifneq ($(DEBUG_TYPE),sde)
|
||||
LDFLAGS += -lmemkind
|
||||
endif
|
||||
|
||||
# Never use libm with Intel compilers.
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS += -lm
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/loongson3a
|
||||
@@ -1,223 +0,0 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
|
||||
|
||||
#define BLIS_TREE_BARRIER
|
||||
#define BLIS_TREE_BARRIER_ARITY 4
|
||||
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 64
|
||||
|
||||
#define BLIS_SIMD_SIZE 64
|
||||
#define BLIS_SIMD_NUM_REGISTERS 32
|
||||
|
||||
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_DEFAULT_MC_S 240
|
||||
#define BLIS_DEFAULT_KC_S 240
|
||||
#define BLIS_DEFAULT_NC_S 14400
|
||||
|
||||
#define BLIS_DEFAULT_MC_D 120
|
||||
#define BLIS_DEFAULT_KC_D 240
|
||||
#define BLIS_DEFAULT_NC_D 14400
|
||||
|
||||
/*
|
||||
#define BLIS_DEFAULT_MC_C 120
|
||||
#define BLIS_DEFAULT_KC_C 240
|
||||
#define BLIS_DEFAULT_NC_C 9600
|
||||
|
||||
#define BLIS_DEFAULT_MC_Z 120
|
||||
#define BLIS_DEFAULT_KC_Z 240
|
||||
#define BLIS_DEFAULT_NC_Z 9600
|
||||
*/
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
#define BLIS_DEFAULT_MR_S 30
|
||||
#define BLIS_DEFAULT_NR_S 16
|
||||
|
||||
#define BLIS_DEFAULT_MR_D 30
|
||||
#define BLIS_DEFAULT_NR_D 8
|
||||
|
||||
//#define BLIS_DEFAULT_MR_C 8
|
||||
//#define BLIS_DEFAULT_NR_C 4
|
||||
|
||||
//#define BLIS_DEFAULT_MR_Z 8
|
||||
//#define BLIS_DEFAULT_NR_Z 4
|
||||
|
||||
// NOTE: If the micro-kernel, which is typically unrolled to a factor
|
||||
// of f, handles leftover edge cases (ie: when k % f > 0) then these
|
||||
// register blocksizes in the k dimension can be defined to 1.
|
||||
|
||||
//#define BLIS_DEFAULT_KR_S 1
|
||||
//#define BLIS_DEFAULT_KR_D 1
|
||||
//#define BLIS_DEFAULT_KR_C 1
|
||||
//#define BLIS_DEFAULT_KR_Z 1
|
||||
|
||||
// -- Maximum cache blocksizes (for optimizing edge cases) --
|
||||
|
||||
// NOTE: These cache blocksize "extensions" have the same constraints as
|
||||
// the corresponding default blocksizes above. When these values are
|
||||
// larger than the default blocksizes, blocksizes used at edge cases are
|
||||
// enlarged if such an extension would encompass the remaining portion of
|
||||
// the matrix dimension.
|
||||
|
||||
#define BLIS_MAXIMUM_MC_S (BLIS_DEFAULT_MC_S + BLIS_DEFAULT_MC_S/4)
|
||||
#define BLIS_MAXIMUM_KC_S (BLIS_DEFAULT_KC_S + BLIS_DEFAULT_KC_S/4)
|
||||
#define BLIS_MAXIMUM_NC_S (BLIS_DEFAULT_NC_S + 0)
|
||||
|
||||
#define BLIS_MAXIMUM_MC_D (BLIS_DEFAULT_MC_D + BLIS_DEFAULT_MC_D/4)
|
||||
#define BLIS_MAXIMUM_KC_D (BLIS_DEFAULT_KC_D + BLIS_DEFAULT_KC_D/4)
|
||||
#define BLIS_MAXIMUM_NC_D (BLIS_DEFAULT_NC_D + 0)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_C (BLIS_DEFAULT_MC_C + BLIS_DEFAULT_MC_C/4)
|
||||
//#define BLIS_MAXIMUM_KC_C (BLIS_DEFAULT_KC_C + BLIS_DEFAULT_KC_C/4)
|
||||
//#define BLIS_MAXIMUM_NC_C (BLIS_DEFAULT_NC_C + BLIS_DEFAULT_NC_C/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_Z (BLIS_DEFAULT_MC_Z + BLIS_DEFAULT_MC_Z/4)
|
||||
//#define BLIS_MAXIMUM_KC_Z (BLIS_DEFAULT_KC_Z + BLIS_DEFAULT_KC_Z/4)
|
||||
//#define BLIS_MAXIMUM_NC_Z (BLIS_DEFAULT_NC_Z + BLIS_DEFAULT_NC_Z/4)
|
||||
|
||||
// -- Packing register blocksize (for packed micro-panels) --
|
||||
|
||||
// NOTE: These register blocksize "extensions" determine whether the
|
||||
// leading dimensions used within the packed micro-panels are equal to
|
||||
// or greater than their corresponding register blocksizes above.
|
||||
|
||||
#define BLIS_PACKDIM_MR_S (BLIS_DEFAULT_MR_S + 2)
|
||||
//#define BLIS_PACKDIM_NR_S (BLIS_DEFAULT_NR_S + ...)
|
||||
|
||||
#define BLIS_PACKDIM_MR_D (BLIS_DEFAULT_MR_D + 2)
|
||||
//#define BLIS_PACKDIM_NR_D (BLIS_DEFAULT_NR_D + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_C (BLIS_DEFAULT_MR_C + ...)
|
||||
//#define BLIS_PACKDIM_NR_C (BLIS_DEFAULT_NR_C + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_Z (BLIS_DEFAULT_MR_Z + ...)
|
||||
//#define BLIS_PACKDIM_NR_Z (BLIS_DEFAULT_NR_Z + ...)
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL_PREFERS_CONTIG_ROWS
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_asm_30x16
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_asm_30x8
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/mic
|
||||
78
config/old/armv7a/bli_cntx_init_armv7a.c
Normal file
78
config/old/armv7a/bli_cntx_init_armv7a.c
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_armv7a( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_armv7a_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_armv7a_asm_4x4, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_armv7a_asm_4x4, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_SCOMPLEX, bli_cgemm_armv7a_asm_2x2, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DCOMPLEX, bli_zgemm_armv7a_asm_2x2, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 4, 4, 2, 2 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 4, 4, 2, 2 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 432, 192, 64, 64 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 352, 256, 128, 128 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 4096, 4096, 4096, 4096 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
80
config/old/armv7a/bli_family_armv7a.h
Normal file
80
config/old/armv7a/bli_family_armv7a.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_FAMILY_H
|
||||
#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
// -- ARCHITECTURE-SPECIFIC PROTOTYPES -----------------------------------------
|
||||
|
||||
// Define the current architecture's name.
|
||||
#define archname armv7a
|
||||
|
||||
// Include the context initialization function API template.
|
||||
#include "bli_cntx_init_arch.h"
|
||||
|
||||
|
||||
#if 0
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_opt_4x4
|
||||
#define BLIS_DEFAULT_MR_S 4
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
#define BLIS_DEFAULT_MC_S 432
|
||||
#define BLIS_DEFAULT_KC_S 352
|
||||
#define BLIS_DEFAULT_NC_S 4096
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_4x4
|
||||
#define BLIS_DEFAULT_MR_D 4
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
#define BLIS_DEFAULT_MC_D 192
|
||||
#define BLIS_DEFAULT_KC_D 256
|
||||
#define BLIS_DEFAULT_NC_D 4096
|
||||
|
||||
#define BLIS_CGEMM_UKERNEL bli_cgemm_opt_4x4
|
||||
#define BLIS_DEFAULT_MR_C 2
|
||||
#define BLIS_DEFAULT_NR_C 2
|
||||
#define BLIS_DEFAULT_MC_C 64
|
||||
#define BLIS_DEFAULT_KC_C 128
|
||||
#define BLIS_DEFAULT_NC_C 4096
|
||||
|
||||
#define BLIS_ZGEMM_UKERNEL bli_zgemm_opt_4x4
|
||||
#define BLIS_DEFAULT_MR_Z 2
|
||||
#define BLIS_DEFAULT_NR_Z 2
|
||||
#define BLIS_DEFAULT_MC_Z 64
|
||||
#define BLIS_DEFAULT_KC_Z 128
|
||||
#define BLIS_DEFAULT_NC_Z 4096
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,30 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := armv7a
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
ifneq ($(CC_VENDOR),gcc)
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99 -mfloat-abi=hard
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -67,21 +64,15 @@ else
|
||||
COPTFLAGS := -O3
|
||||
endif
|
||||
|
||||
CVECFLAGS := -mfpu=vfpv3 -marm -march=armv7-a
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -mfpu=vfpv3 -marm -march=armv7-a
|
||||
else
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
@@ -51,7 +51,7 @@ CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CDBGFLAGS := #-g4
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
COPTFLAGS := -O2
|
||||
CKOPTFLAGS := -O3
|
||||
CVECFLAGS :=
|
||||
@@ -32,30 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := loongson3a
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
ifneq ($(CC_VENDOR),gcc)
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L -mabi=64
|
||||
CMISCFLAGS := -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -67,21 +64,15 @@ else
|
||||
COPTFLAGS := -O3 -mtune=loongson3a
|
||||
endif
|
||||
|
||||
CVECFLAGS := -march=loongson3a
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -march=loongson3a
|
||||
else
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
@@ -32,9 +32,10 @@
|
||||
|
||||
*/
|
||||
|
||||
dir_t bli_herk_direct
|
||||
(
|
||||
obj_t* a,
|
||||
obj_t* ah,
|
||||
obj_t* c
|
||||
);
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#
|
||||
#!/bin/bash
|
||||
#
|
||||
# BLIS
|
||||
# An object-based framework for developing high-performance BLAS-like
|
||||
@@ -32,17 +32,16 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := newarch
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
@@ -53,7 +52,7 @@ endif
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -65,32 +64,23 @@ else
|
||||
COPTFLAGS := -O2
|
||||
endif
|
||||
|
||||
CVECFLAGS :=
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS :=
|
||||
else
|
||||
ifeq ($(CC_VENDOR),icc)
|
||||
CVECFLAGS :=
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
CVECFLAGS :=
|
||||
else
|
||||
$(error gcc, icc, or clang is required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
@@ -51,7 +51,7 @@ CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=gnu11 -I$(NACL_SDK_ROOT)/include
|
||||
CPICFLAGS :=
|
||||
CDBGFLAGS := -g
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
COPTFLAGS := -O3
|
||||
CKOPTFLAGS := $(COPTFLAGS) -ffast-math
|
||||
CVECFLAGS :=
|
||||
81
config/penryn/bli_cntx_init_penryn.c
Normal file
81
config/penryn/bli_cntx_init_penryn.c
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_penryn( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_penryn_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
4,
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_penryn_asm_8x4, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_penryn_asm_4x4, FALSE,
|
||||
//BLIS_GEMM_UKR, BLIS_SCOMPLEX, bli_cgemm_penryn_asm_8x4, FALSE,
|
||||
//BLIS_GEMM_UKR, BLIS_DCOMPLEX, bli_zgemm_penryn_asm_4x4, FALSE,
|
||||
BLIS_GEMMTRSM_L_UKR, BLIS_DOUBLE, bli_dgemmtrsm_l_penryn_asm_4x4, FALSE,
|
||||
BLIS_GEMMTRSM_U_UKR, BLIS_DOUBLE, bli_dgemmtrsm_u_penryn_asm_4x4, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 8, 4, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 4, 4, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 768, 384, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 384, 384, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 4096, 4096, 0, 0 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,140 +32,52 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
// -- MEMORY ALLOCATION --------------------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_asm_8x4
|
||||
#define BLIS_DEFAULT_MR_S 8
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
#define BLIS_DEFAULT_MC_S 768
|
||||
#define BLIS_DEFAULT_KC_S 384
|
||||
#define BLIS_DEFAULT_NC_S 4096
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_asm_4x4
|
||||
#define BLIS_DEFAULT_MR_D 4
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
#define BLIS_DEFAULT_MC_D 384
|
||||
#define BLIS_DEFAULT_KC_D 384
|
||||
#define BLIS_DEFAULT_NC_D 4096
|
||||
|
||||
//#define BLIS_DEFAULT_MC_C 384
|
||||
//#define BLIS_DEFAULT_KC_C 384
|
||||
//#define BLIS_DEFAULT_NC_C 4096
|
||||
|
||||
//#define BLIS_DEFAULT_MC_Z 192
|
||||
//#define BLIS_DEFAULT_KC_Z 384
|
||||
//#define BLIS_DEFAULT_NC_Z 4096
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
#define BLIS_DEFAULT_MR_S 8
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_D 4
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 4
|
||||
#define BLIS_DEFAULT_NR_C 2
|
||||
|
||||
#define BLIS_DEFAULT_MR_Z 2
|
||||
#define BLIS_DEFAULT_NR_Z 2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_asm_8x4
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_asm_4x4
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
#define BLIS_DGEMMTRSM_L_UKERNEL bli_dgemmtrsm_l_asm_4x4
|
||||
#define BLIS_DGEMMTRSM_U_UKERNEL bli_dgemmtrsm_u_asm_4x4
|
||||
|
||||
|
||||
#define BLIS_DGEMMTRSM_L_UKERNEL bli_dgemmtrsm_l_asm_4x4
|
||||
#define BLIS_DGEMMTRSM_U_UKERNEL bli_dgemmtrsm_u_asm_4x4
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
#define BLIS_DAXPY2V_KERNEL bli_daxpy2v_int_var1
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
#define BLIS_DDOTAXPYV_KERNEL bli_ddotaxpyv_int_var1
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
#define BLIS_DAXPYF_KERNEL bli_daxpyf_int_var1
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
#define BLIS_DDOTXF_KERNEL bli_ddotxf_int_var1
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
#define BLIS_DDOTXAXPYF_KERNEL bli_ddotxaxpyf_int_var1
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
#define BLIS_DAXPYV_KERNEL bli_daxpyv_opt_var1
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
#define BLIS_DDOTV_KERNEL bli_ddotv_opt_var1
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -32,28 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := penryn
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99
|
||||
CMISCFLAGS := -std=c99 -m64
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -68,31 +67,20 @@ endif
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -msse3 -march=corei7 -mfpmath=sse
|
||||
CVECFLAGS := -mssse3 -mfpmath=sse -march=core2
|
||||
else
|
||||
ifeq ($(CC_VENDOR),icc)
|
||||
CVECFLAGS := -xSSE4.2
|
||||
CVECFLAGS := -xSSSE3
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
CVECFLAGS := -msse3 -mfpmath=sse -march=corei7
|
||||
CVECFLAGS := -mssse3 -mfpmath=sse -march=core2
|
||||
else
|
||||
$(error gcc, icc, or clang is required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
79
config/piledriver/bli_cntx_init_piledriver.c
Normal file
79
config/piledriver/bli_cntx_init_piledriver.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_piledriver( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_piledriver_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
4,
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_piledriver_asm_16x3, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_piledriver_asm_8x3, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_SCOMPLEX, bli_cgemm_piledriver_asm_4x2, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DCOMPLEX, bli_zgemm_piledriver_asm_2x2, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 16, 8, 4, 2 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 3, 3, 2, 2 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 2016, 1008, 512, 400 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 128, 128, 256, 160 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 8400, 8400, 8400, 8400 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,44 +32,31 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
// -- MEMORY ALLOCATION --------------------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_asm_16x3
|
||||
#define BLIS_DEFAULT_MC_S 2016
|
||||
#define BLIS_DEFAULT_KC_S 128
|
||||
#define BLIS_DEFAULT_NC_S 8400
|
||||
#define BLIS_DEFAULT_MR_S 16
|
||||
#define BLIS_DEFAULT_NR_S 3
|
||||
//#define BLIS_UPANEL_B_ALIGN_SIZE_S 4096
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_asm_8x3
|
||||
//#define BLIS_DEFAULT_MC_D 768
|
||||
//#define BLIS_DEFAULT_KC_D 168
|
||||
#define BLIS_DEFAULT_MC_D 1008
|
||||
#define BLIS_DEFAULT_KC_D 128
|
||||
#define BLIS_DEFAULT_NC_D 8400
|
||||
#define BLIS_DEFAULT_MR_D 8
|
||||
#define BLIS_DEFAULT_NR_D 3
|
||||
//#define BLIS_UPANEL_B_ALIGN_SIZE_D 4096
|
||||
|
||||
#define BLIS_CGEMM_UKERNEL bli_cgemm_asm_4x2
|
||||
#define BLIS_DEFAULT_MC_C 512
|
||||
@@ -84,88 +71,8 @@
|
||||
#define BLIS_DEFAULT_NC_Z 8400
|
||||
#define BLIS_DEFAULT_MR_Z 2
|
||||
#define BLIS_DEFAULT_NR_Z 2
|
||||
|
||||
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
|
||||
|
||||
// -- Micro-panel alignment --
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/x86_64/piledriver
|
||||
@@ -32,34 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := piledriver
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
else
|
||||
$(error gcc or clang are required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -71,21 +64,19 @@ else
|
||||
COPTFLAGS := -O2 -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
CVECFLAGS := -mavx -mfma -march=bdver2 -mfpmath=sse
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2
|
||||
else
|
||||
$(error gcc or clang are required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/nacl/pnacl
|
||||
@@ -34,38 +34,43 @@
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_symm_basic_check( side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
void bli_cntx_init_power7( cntx_t* cntx )
|
||||
{
|
||||
// The basic properties of symm are identical to that of hemm.
|
||||
bli_hemm_basic_check( side, alpha, a, b, beta, c );
|
||||
}
|
||||
|
||||
void bli_symm_check( side_t side,
|
||||
obj_t* alpha,
|
||||
obj_t* a,
|
||||
obj_t* b,
|
||||
obj_t* beta,
|
||||
obj_t* c )
|
||||
{
|
||||
err_t e_val;
|
||||
|
||||
// Check basic properties of the operation.
|
||||
|
||||
bli_symm_basic_check( side, alpha, a, b, beta, c );
|
||||
|
||||
// Check matrix squareness.
|
||||
|
||||
e_val = bli_check_square_object( a );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
// Check matrix structure.
|
||||
|
||||
e_val = bli_check_symmetric_object( a );
|
||||
bli_check_error_code( e_val );
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_power7_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
1,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_power7_int_8x4, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 0, 8, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 0, 4, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 0, 64, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 0, 256, 0, 0 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 0, 4096, 0, 0 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,18 +32,21 @@
|
||||
|
||||
*/
|
||||
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
#undef GENTPROT3
|
||||
#define GENTPROT3( ctype_a, ctype_x, ctype_y, cha, chx, chy, varname ) \
|
||||
\
|
||||
void PASTEMAC(chx,varname) \
|
||||
( \
|
||||
conj_t conjx, \
|
||||
dim_t n, \
|
||||
ctype_a* alpha, \
|
||||
ctype_x* x, inc_t incx, \
|
||||
ctype_y* y, inc_t incy \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT3_BASIC( axpyv_ref )
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_8x4
|
||||
#define BLIS_DEFAULT_MR_D 8
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
#define BLIS_DEFAULT_MC_D 64
|
||||
#define BLIS_DEFAULT_KC_D 256
|
||||
#define BLIS_DEFAULT_NC_D 4096
|
||||
#endif
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -1,212 +0,0 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
|
||||
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_DEFAULT_MC_S 128
|
||||
#define BLIS_DEFAULT_KC_S 256
|
||||
#define BLIS_DEFAULT_NC_S 8192
|
||||
|
||||
#define BLIS_DEFAULT_MC_D 64
|
||||
#define BLIS_DEFAULT_KC_D 256
|
||||
#define BLIS_DEFAULT_NC_D 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_C 64
|
||||
#define BLIS_DEFAULT_KC_C 256
|
||||
#define BLIS_DEFAULT_NC_C 4096
|
||||
|
||||
#define BLIS_DEFAULT_MC_Z 32
|
||||
#define BLIS_DEFAULT_KC_Z 256
|
||||
#define BLIS_DEFAULT_NC_Z 2048
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
#define BLIS_DEFAULT_MR_S 8
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_D 8
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_Z 8
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
|
||||
// NOTE: If the micro-kernel, which is typically unrolled to a factor
|
||||
// of f, handles leftover edge cases (ie: when k % f > 0) then these
|
||||
// register blocksizes in the k dimension can be defined to 1.
|
||||
|
||||
//#define BLIS_DEFAULT_KR_S 1
|
||||
//#define BLIS_DEFAULT_KR_D 1
|
||||
//#define BLIS_DEFAULT_KR_C 1
|
||||
//#define BLIS_DEFAULT_KR_Z 1
|
||||
|
||||
// -- Maximum cache blocksizes (for optimizing edge cases) --
|
||||
|
||||
// NOTE: These cache blocksize "extensions" have the same constraints as
|
||||
// the corresponding default blocksizes above. When these values are
|
||||
// larger than the default blocksizes, blocksizes used at edge cases are
|
||||
// enlarged if such an extension would encompass the remaining portion of
|
||||
// the matrix dimension.
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_S (BLIS_DEFAULT_MC_S + BLIS_DEFAULT_MC_S/4)
|
||||
//#define BLIS_MAXIMUM_KC_S (BLIS_DEFAULT_KC_S + BLIS_DEFAULT_KC_S/4)
|
||||
//#define BLIS_MAXIMUM_NC_S (BLIS_DEFAULT_NC_S + BLIS_DEFAULT_NC_S/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_D (BLIS_DEFAULT_MC_D + BLIS_DEFAULT_MC_D/4)
|
||||
//#define BLIS_MAXIMUM_KC_D (BLIS_DEFAULT_KC_D + BLIS_DEFAULT_KC_D/4)
|
||||
//#define BLIS_MAXIMUM_NC_D (BLIS_DEFAULT_NC_D + BLIS_DEFAULT_NC_D/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_C (BLIS_DEFAULT_MC_C + BLIS_DEFAULT_MC_C/4)
|
||||
//#define BLIS_MAXIMUM_KC_C (BLIS_DEFAULT_KC_C + BLIS_DEFAULT_KC_C/4)
|
||||
//#define BLIS_MAXIMUM_NC_C (BLIS_DEFAULT_NC_C + BLIS_DEFAULT_NC_C/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_Z (BLIS_DEFAULT_MC_Z + BLIS_DEFAULT_MC_Z/4)
|
||||
//#define BLIS_MAXIMUM_KC_Z (BLIS_DEFAULT_KC_Z + BLIS_DEFAULT_KC_Z/4)
|
||||
//#define BLIS_MAXIMUM_NC_Z (BLIS_DEFAULT_NC_Z + BLIS_DEFAULT_NC_Z/4)
|
||||
|
||||
// -- Packing register blocksize (for packed micro-panels) --
|
||||
|
||||
// NOTE: These register blocksize "extensions" determine whether the
|
||||
// leading dimensions used within the packed micro-panels are equal to
|
||||
// or greater than their corresponding register blocksizes above.
|
||||
|
||||
//#define BLIS_PACKDIM_MR_S (BLIS_DEFAULT_MR_S + ...)
|
||||
//#define BLIS_PACKDIM_NR_S (BLIS_DEFAULT_NR_S + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_D (BLIS_DEFAULT_MR_D + ...)
|
||||
//#define BLIS_PACKDIM_NR_D (BLIS_DEFAULT_NR_D + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_C (BLIS_DEFAULT_MR_C + ...)
|
||||
//#define BLIS_PACKDIM_NR_C (BLIS_DEFAULT_NR_C + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_Z (BLIS_DEFAULT_MR_Z + ...)
|
||||
//#define BLIS_PACKDIM_NR_Z (BLIS_DEFAULT_NR_Z + ...)
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 KERNEL DEFINITIONS -----------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
#include "bli_gemm_opt_8x4.h"
|
||||
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_8x4
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/power7
|
||||
@@ -32,30 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := power7
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
ifneq ($(CC_VENDOR),gcc)
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99 -m64 -mcpu=power7
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -67,21 +64,15 @@ else
|
||||
COPTFLAGS := -O3 -mtune=power7
|
||||
endif
|
||||
|
||||
CVECFLAGS := -mvsx
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -mvsx
|
||||
else
|
||||
$(error gcc is required for this configuration.)
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
|
||||
79
config/sandybridge/bli_cntx_init_sandybridge.c
Normal file
79
config/sandybridge/bli_cntx_init_sandybridge.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_sandybridge( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_sandybridge_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
4,
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_sandybridge_asm_8x8, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_sandybridge_asm_8x4, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_SCOMPLEX, bli_cgemm_sandybridge_asm_8x4, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DCOMPLEX, bli_zgemm_sandybridge_asm_4x4, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 8, 8, 8, 4 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 8, 4, 4, 4 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 128, 96, 96, 64 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 384, 256, 256, 192 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 4096, 4096, 4096, 4096 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,23 +32,13 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
#if 0
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS AND DEFINITIONS ---------------------------
|
||||
|
||||
//
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
//
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_asm_8x8
|
||||
#define BLIS_DEFAULT_MC_S 128
|
||||
#define BLIS_DEFAULT_KC_S 384
|
||||
@@ -76,69 +66,9 @@
|
||||
#define BLIS_DEFAULT_NC_Z 4096
|
||||
#define BLIS_DEFAULT_MR_Z 4
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
// -- unpackm --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
// -- copyv --
|
||||
|
||||
// -- dotv --
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
// -- invertv --
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
// -- scalv --
|
||||
|
||||
// -- setv --
|
||||
|
||||
// -- subv --
|
||||
|
||||
// -- swapv --
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../kernels/x86_64/sandybridge
|
||||
@@ -32,28 +32,27 @@
|
||||
#
|
||||
#
|
||||
|
||||
# Only include this block of code once.
|
||||
ifndef MAKE_DEFS_MK_INCLUDED
|
||||
MAKE_DEFS_MK_INCLUDED := yes
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := sandybridge
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Development tools definitions --------------------------------------------
|
||||
#
|
||||
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99 -m64
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
@@ -81,18 +80,7 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# --- Determine the archiver and related flags ---
|
||||
AR := ar
|
||||
ARFLAGS := cr
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
# --- Determine the linker and related flags ---
|
||||
LINKER := $(CC)
|
||||
SOFLAGS := -shared
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
LDFLAGS := -lm
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
|
||||
endif
|
||||
|
||||
79
config/steamroller/bli_cntx_init_steamroller.c
Normal file
79
config/steamroller/bli_cntx_init_steamroller.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_steamroller( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_piledriver_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
4,
|
||||
BLIS_GEMM_UKR, BLIS_FLOAT, bli_sgemm_piledriver_asm_16x3, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DOUBLE, bli_dgemm_piledriver_asm_8x3, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_SCOMPLEX, bli_cgemm_piledriver_asm_4x2, FALSE,
|
||||
BLIS_GEMM_UKR, BLIS_DCOMPLEX, bli_zgemm_piledriver_asm_2x2, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 16, 8, 4, 2 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 3, 3, 2, 2 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 2016, 1008, 512, 400 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 128, 128, 256, 160 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 8400, 8400, 8400, 8400 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
45
config/steamroller/bli_family_steamroller.h
Normal file
45
config/steamroller/bli_family_steamroller.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
|
||||
// -- MEMORY ALLOCATION --------------------------------------------------------
|
||||
|
||||
#define BLIS_SIMD_ALIGN_SIZE 16
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
82
config/steamroller/make_defs.mk
Normal file
82
config/steamroller/make_defs.mk
Normal file
@@ -0,0 +1,82 @@
|
||||
#
|
||||
#
|
||||
# BLIS
|
||||
# An object-based framework for developing high-performance BLAS-like
|
||||
# libraries.
|
||||
#
|
||||
# Copyright (C) 2014, The University of Texas at Austin
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# - Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# - Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# - Neither the name of The University of Texas at Austin nor the names
|
||||
# of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
# Declare the name of the current configuration and add it to the
|
||||
# running list of configurations included by common.mk.
|
||||
THIS_CONFIG := steamroller
|
||||
#CONFIGS_INCL += $(THIS_CONFIG)
|
||||
|
||||
#
|
||||
# --- Determine the C compiler and related flags ---
|
||||
#
|
||||
|
||||
ifeq ($(CC),)
|
||||
CC := gcc
|
||||
CC_VENDOR := gcc
|
||||
endif
|
||||
|
||||
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
|
||||
# NOTE: This is needed to enable posix_memalign().
|
||||
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
|
||||
CMISCFLAGS := -std=c99
|
||||
CPICFLAGS := -fPIC
|
||||
CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors
|
||||
|
||||
ifneq ($(DEBUG_TYPE),off)
|
||||
CDBGFLAGS := -g
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_TYPE),noopt)
|
||||
COPTFLAGS := -O0
|
||||
else
|
||||
COPTFLAGS := -O2 -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
CKOPTFLAGS := $(COPTFLAGS)
|
||||
|
||||
ifeq ($(CC_VENDOR),gcc)
|
||||
CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2
|
||||
else
|
||||
ifeq ($(CC_VENDOR),clang)
|
||||
CVECFLAGS := -mfpmath=sse -mavx -mfma -march=bdver2
|
||||
else
|
||||
$(error gcc or clang are required for this configuration.)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Store all of the variables here to new variables containing the
|
||||
# configuration name.
|
||||
$(eval $(call store-make-defs,$(THIS_CONFIG)))
|
||||
|
||||
99
config/template/bli_cntx_init_template.c
Normal file
99
config/template/bli_cntx_init_template.c
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
void bli_cntx_init_template( cntx_t* cntx )
|
||||
{
|
||||
blksz_t blkszs[ BLIS_NUM_BLKSZS ];
|
||||
|
||||
// Set default kernel blocksizes and functions.
|
||||
bli_cntx_init_template_ref( cntx );
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// Update the context with optimized native gemm micro-kernels and
|
||||
// their storage preferences.
|
||||
bli_cntx_set_l3_nat_ukrs
|
||||
(
|
||||
5,
|
||||
BLIS_GEMM_UKR, BLIS_DCOMPLEX, bli_zgemm_template_noopt, FALSE,
|
||||
BLIS_GEMMTRSM_L_UKR, BLIS_DCOMPLEX, bli_zgemmtrsm_l_template_noopt, FALSE,
|
||||
BLIS_GEMMTRSM_U_UKR, BLIS_DCOMPLEX, bli_zgemmtrsm_u_template_noopt, FALSE,
|
||||
BLIS_TRSM_L_UKR, BLIS_DCOMPLEX, bli_ztrsm_l_template_noopt, FALSE,
|
||||
BLIS_TRSM_U_UKR, BLIS_DCOMPLEX, bli_ztrsm_u_template_noopt, FALSE,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Update the context with optimized level-1f kernels.
|
||||
bli_cntx_set_l1f_kers
|
||||
(
|
||||
BLIS_AXPY2V_KER, BLIS_DCOMPLEX, bli_zaxpy2v_template_noopt,
|
||||
BLIS_DOTAXPYV_KER, BLIS_DCOMPLEX, bli_zdotaxpyv_template_noopt,
|
||||
BLIS_AXPYF_KER, BLIS_DCOMPLEX, bli_zaxpyf_template_noopt,
|
||||
BLIS_DOTXF_KER, BLIS_DCOMPLEX, bli_zdotxf_template_noopt,
|
||||
BLIS_DOTXAXPYF_KER, BLIS_DCOMPLEX, bli_zdotxaxpyf_template_noopt,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Update the context with optimized level-1v kernels.
|
||||
bli_cntx_set_l1v_kers
|
||||
(
|
||||
BLIS_AXPYV_KER, BLIS_DCOMPLEX, bli_zaxpyv_template_noopt,
|
||||
BLIS_DOTV_KER, BLIS_DCOMPLEX, bli_zdotv_template_noopt,
|
||||
cntx
|
||||
);
|
||||
|
||||
// Initialize level-3 blocksize objects with architecture-specific values.
|
||||
// s d c z
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MR ], 0, 0, 0, 4 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NR ], 0, 0, 0, 4 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_MC ], 0, 0, 0, 128 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_KC ], 0, 0, 0, 256 );
|
||||
bli_blksz_init_easy( &blkszs[ BLIS_NC ], 0, 0, 0, 4096 );
|
||||
|
||||
// Update the context with the current architecture's register and cache
|
||||
// blocksizes (and multiples) for native execution.
|
||||
bli_cntx_set_blkszs
|
||||
(
|
||||
BLIS_NAT, 5,
|
||||
BLIS_NC, &blkszs[ BLIS_NC ], BLIS_NR,
|
||||
BLIS_KC, &blkszs[ BLIS_KC ], BLIS_KR,
|
||||
BLIS_MC, &blkszs[ BLIS_MC ], BLIS_MR,
|
||||
BLIS_NR, &blkszs[ BLIS_NR ], BLIS_NR,
|
||||
BLIS_MR, &blkszs[ BLIS_MR ], BLIS_MR,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,15 +32,11 @@
|
||||
|
||||
*/
|
||||
|
||||
#include "blis.h"
|
||||
//#ifndef BLIS_FAMILY_H
|
||||
//#define BLIS_FAMILY_H
|
||||
|
||||
dir_t bli_herk_direct
|
||||
(
|
||||
obj_t* a,
|
||||
obj_t* ah,
|
||||
obj_t* c
|
||||
)
|
||||
{
|
||||
return BLIS_FWD;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
@@ -1,377 +0,0 @@
|
||||
/*
|
||||
|
||||
BLIS
|
||||
An object-based framework for developing high-performance BLAS-like
|
||||
libraries.
|
||||
|
||||
Copyright (C) 2014, The University of Texas at Austin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of The University of Texas at Austin nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BLIS_KERNEL_H
|
||||
#define BLIS_KERNEL_H
|
||||
|
||||
|
||||
// -- LEVEL-3 MICRO-KERNEL CONSTANTS -------------------------------------------
|
||||
|
||||
// -- Cache blocksizes --
|
||||
|
||||
// Constraints:
|
||||
//
|
||||
// (1) MC must be a multiple of:
|
||||
// (a) MR (for zero-padding purposes)
|
||||
// (b) NR (for zero-padding purposes when MR and NR are "swapped")
|
||||
// (2) NC must be a multiple of
|
||||
// (a) NR (for zero-padding purposes)
|
||||
// (b) MR (for zero-padding purposes when MR and NR are "swapped")
|
||||
|
||||
#define BLIS_DEFAULT_MC_S 128
|
||||
#define BLIS_DEFAULT_KC_S 256
|
||||
#define BLIS_DEFAULT_NC_S 2048
|
||||
|
||||
#define BLIS_DEFAULT_MC_D 128
|
||||
#define BLIS_DEFAULT_KC_D 256
|
||||
#define BLIS_DEFAULT_NC_D 2048
|
||||
|
||||
#define BLIS_DEFAULT_MC_C 128
|
||||
#define BLIS_DEFAULT_KC_C 256
|
||||
#define BLIS_DEFAULT_NC_C 2048
|
||||
|
||||
#define BLIS_DEFAULT_MC_Z 128
|
||||
#define BLIS_DEFAULT_KC_Z 256
|
||||
#define BLIS_DEFAULT_NC_Z 2048
|
||||
|
||||
// -- Register blocksizes --
|
||||
|
||||
#define BLIS_DEFAULT_MR_S 8
|
||||
#define BLIS_DEFAULT_NR_S 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_D 8
|
||||
#define BLIS_DEFAULT_NR_D 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_C 8
|
||||
#define BLIS_DEFAULT_NR_C 4
|
||||
|
||||
#define BLIS_DEFAULT_MR_Z 8
|
||||
#define BLIS_DEFAULT_NR_Z 4
|
||||
|
||||
// NOTE: If the micro-kernel, which is typically unrolled to a factor
|
||||
// of f, handles leftover edge cases (ie: when k % f > 0) then these
|
||||
// register blocksizes in the k dimension can be defined to 1.
|
||||
|
||||
//#define BLIS_DEFAULT_KR_S 1
|
||||
//#define BLIS_DEFAULT_KR_D 1
|
||||
//#define BLIS_DEFAULT_KR_C 1
|
||||
//#define BLIS_DEFAULT_KR_Z 1
|
||||
|
||||
// -- Maximum cache blocksizes (for optimizing edge cases) --
|
||||
|
||||
// NOTE: These cache blocksize "extensions" have the same constraints as
|
||||
// the corresponding default blocksizes above. When these values are
|
||||
// larger than the default blocksizes, blocksizes used at edge cases are
|
||||
// enlarged if such an extension would encompass the remaining portion of
|
||||
// the matrix dimension.
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_S (BLIS_DEFAULT_MC_S + BLIS_DEFAULT_MC_S/4)
|
||||
//#define BLIS_MAXIMUM_KC_S (BLIS_DEFAULT_KC_S + BLIS_DEFAULT_KC_S/4)
|
||||
//#define BLIS_MAXIMUM_NC_S (BLIS_DEFAULT_NC_S + BLIS_DEFAULT_NC_S/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_D (BLIS_DEFAULT_MC_D + BLIS_DEFAULT_MC_D/4)
|
||||
//#define BLIS_MAXIMUM_KC_D (BLIS_DEFAULT_KC_D + BLIS_DEFAULT_KC_D/4)
|
||||
//#define BLIS_MAXIMUM_NC_D (BLIS_DEFAULT_NC_D + BLIS_DEFAULT_NC_D/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_C (BLIS_DEFAULT_MC_C + BLIS_DEFAULT_MC_C/4)
|
||||
//#define BLIS_MAXIMUM_KC_C (BLIS_DEFAULT_KC_C + BLIS_DEFAULT_KC_C/4)
|
||||
//#define BLIS_MAXIMUM_NC_C (BLIS_DEFAULT_NC_C + BLIS_DEFAULT_NC_C/4)
|
||||
|
||||
//#define BLIS_MAXIMUM_MC_Z (BLIS_DEFAULT_MC_Z + BLIS_DEFAULT_MC_Z/4)
|
||||
//#define BLIS_MAXIMUM_KC_Z (BLIS_DEFAULT_KC_Z + BLIS_DEFAULT_KC_Z/4)
|
||||
//#define BLIS_MAXIMUM_NC_Z (BLIS_DEFAULT_NC_Z + BLIS_DEFAULT_NC_Z/4)
|
||||
|
||||
// -- Packing register blocksize (for packed micro-panels) --
|
||||
|
||||
// NOTE: These register blocksize "extensions" determine whether the
|
||||
// leading dimensions used within the packed micro-panels are equal to
|
||||
// or greater than their corresponding register blocksizes above.
|
||||
|
||||
//#define BLIS_PACKDIM_MR_S (BLIS_DEFAULT_MR_S + ...)
|
||||
//#define BLIS_PACKDIM_NR_S (BLIS_DEFAULT_NR_S + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_D (BLIS_DEFAULT_MR_D + ...)
|
||||
//#define BLIS_PACKDIM_NR_D (BLIS_DEFAULT_NR_D + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_C (BLIS_DEFAULT_MR_C + ...)
|
||||
//#define BLIS_PACKDIM_NR_C (BLIS_DEFAULT_NR_C + ...)
|
||||
|
||||
//#define BLIS_PACKDIM_MR_Z (BLIS_DEFAULT_MR_Z + ...)
|
||||
//#define BLIS_PACKDIM_NR_Z (BLIS_DEFAULT_NR_Z + ...)
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-3 MICRO-KERNELS ---------------------------------------------------
|
||||
|
||||
// -- gemm --
|
||||
|
||||
#define BLIS_SGEMM_UKERNEL bli_sgemm_opt_mxn
|
||||
#define BLIS_DGEMM_UKERNEL bli_dgemm_opt_mxn
|
||||
#define BLIS_CGEMM_UKERNEL bli_cgemm_opt_mxn
|
||||
#define BLIS_ZGEMM_UKERNEL bli_zgemm_opt_mxn
|
||||
|
||||
// -- trsm-related --
|
||||
|
||||
#define BLIS_SGEMMTRSM_L_UKERNEL bli_sgemmtrsm_l_opt_mxn
|
||||
#define BLIS_DGEMMTRSM_L_UKERNEL bli_dgemmtrsm_l_opt_mxn
|
||||
#define BLIS_CGEMMTRSM_L_UKERNEL bli_cgemmtrsm_l_opt_mxn
|
||||
#define BLIS_ZGEMMTRSM_L_UKERNEL bli_zgemmtrsm_l_opt_mxn
|
||||
|
||||
#define BLIS_SGEMMTRSM_U_UKERNEL bli_sgemmtrsm_u_opt_mxn
|
||||
#define BLIS_DGEMMTRSM_U_UKERNEL bli_dgemmtrsm_u_opt_mxn
|
||||
#define BLIS_CGEMMTRSM_U_UKERNEL bli_cgemmtrsm_u_opt_mxn
|
||||
#define BLIS_ZGEMMTRSM_U_UKERNEL bli_zgemmtrsm_u_opt_mxn
|
||||
|
||||
#define BLIS_STRSM_L_UKERNEL bli_strsm_l_opt_mxn
|
||||
#define BLIS_DTRSM_L_UKERNEL bli_dtrsm_l_opt_mxn
|
||||
#define BLIS_CTRSM_L_UKERNEL bli_ctrsm_l_opt_mxn
|
||||
#define BLIS_ZTRSM_L_UKERNEL bli_ztrsm_l_opt_mxn
|
||||
|
||||
#define BLIS_STRSM_U_UKERNEL bli_strsm_u_opt_mxn
|
||||
#define BLIS_DTRSM_U_UKERNEL bli_dtrsm_u_opt_mxn
|
||||
#define BLIS_CTRSM_U_UKERNEL bli_ctrsm_u_opt_mxn
|
||||
#define BLIS_ZTRSM_U_UKERNEL bli_ztrsm_u_opt_mxn
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-2 KERNEL CONSTANTS -------------------------------------------------
|
||||
|
||||
// NOTE: These values determine high-level cache blocking for level-2
|
||||
// operations ONLY. So, if gemv is performed with a 2000x2000 matrix A and
|
||||
// MC = NC = 1000, then a total of four unblocked (or unblocked fused)
|
||||
// gemv subproblems are called. The blocked algorithms are only useful in
|
||||
// that they provide the opportunity for packing vectors. (Matrices can also
|
||||
// be packed here, but this tends to be much too expensive in practice to
|
||||
// actually employ.)
|
||||
|
||||
//#define BLIS_DEFAULT_M2_S 1000
|
||||
//#define BLIS_DEFAULT_N2_S 1000
|
||||
|
||||
//#define BLIS_DEFAULT_M2_D 1000
|
||||
//#define BLIS_DEFAULT_N2_D 1000
|
||||
|
||||
//#define BLIS_DEFAULT_M2_C 1000
|
||||
//#define BLIS_DEFAULT_N2_C 1000
|
||||
|
||||
//#define BLIS_DEFAULT_M2_Z 1000
|
||||
//#define BLIS_DEFAULT_N2_Z 1000
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL CONSTANTS ------------------------------------------------
|
||||
|
||||
// -- Default fusing factors for level-1f operations --
|
||||
|
||||
//#define BLIS_DEFAULT_1F_S 8
|
||||
//#define BLIS_DEFAULT_1F_D 4
|
||||
//#define BLIS_DEFAULT_1F_C 4
|
||||
//#define BLIS_DEFAULT_1F_Z 2
|
||||
|
||||
//#define BLIS_DEFAULT_AF_S BLIS_DEFAULT_1F_S
|
||||
//#define BLIS_DEFAULT_AF_D BLIS_DEFAULT_1F_D
|
||||
//#define BLIS_DEFAULT_AF_C BLIS_DEFAULT_1F_C
|
||||
//#define BLIS_DEFAULT_AF_Z BLIS_DEFAULT_1F_Z
|
||||
|
||||
//#define BLIS_DEFAULT_DF_S BLIS_DEFAULT_1F_S
|
||||
//#define BLIS_DEFAULT_DF_D BLIS_DEFAULT_1F_D
|
||||
//#define BLIS_DEFAULT_DF_C BLIS_DEFAULT_1F_C
|
||||
//#define BLIS_DEFAULT_DF_Z BLIS_DEFAULT_1F_Z
|
||||
|
||||
//#define BLIS_DEFAULT_XF_S BLIS_DEFAULT_1F_S
|
||||
//#define BLIS_DEFAULT_XF_D BLIS_DEFAULT_1F_D
|
||||
//#define BLIS_DEFAULT_XF_C BLIS_DEFAULT_1F_C
|
||||
//#define BLIS_DEFAULT_XF_Z BLIS_DEFAULT_1F_Z
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1F KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- axpy2v --
|
||||
|
||||
#define BLIS_SAXPY2V_KERNEL bli_saxpy2v_opt_var1
|
||||
#define BLIS_DAXPY2V_KERNEL bli_daxpy2v_opt_var1
|
||||
#define BLIS_CAXPY2V_KERNEL bli_caxpy2v_opt_var1
|
||||
#define BLIS_ZAXPY2V_KERNEL bli_zaxpy2v_opt_var1
|
||||
|
||||
// -- dotaxpyv --
|
||||
|
||||
#define BLIS_SDOTAXPYV_KERNEL bli_sdotaxpyv_opt_var1
|
||||
#define BLIS_DDOTAXPYV_KERNEL bli_ddotaxpyv_opt_var1
|
||||
#define BLIS_CDOTAXPYV_KERNEL bli_cdotaxpyv_opt_var1
|
||||
#define BLIS_ZDOTAXPYV_KERNEL bli_zdotaxpyv_opt_var1
|
||||
|
||||
// -- axpyf --
|
||||
|
||||
#define BLIS_SAXPYF_KERNEL bli_saxpyf_opt_var1
|
||||
#define BLIS_DAXPYF_KERNEL bli_daxpyf_opt_var1
|
||||
#define BLIS_CAXPYF_KERNEL bli_caxpyf_opt_var1
|
||||
#define BLIS_ZAXPYF_KERNEL bli_zaxpyf_opt_var1
|
||||
|
||||
// -- dotxf --
|
||||
|
||||
#define BLIS_SDOTXF_KERNEL bli_sdotxf_opt_var1
|
||||
#define BLIS_DDOTXF_KERNEL bli_ddotxf_opt_var1
|
||||
#define BLIS_CDOTXF_KERNEL bli_cdotxf_opt_var1
|
||||
#define BLIS_ZDOTXF_KERNEL bli_zdotxf_opt_var1
|
||||
|
||||
|
||||
// -- dotxaxpyf --
|
||||
|
||||
#define BLIS_SDOTXAXPYF_KERNEL bli_sdotxaxpyf_opt_var1
|
||||
#define BLIS_DDOTXAXPYF_KERNEL bli_ddotxaxpyf_opt_var1
|
||||
#define BLIS_CDOTXAXPYF_KERNEL bli_cdotxaxpyf_opt_var1
|
||||
#define BLIS_ZDOTXAXPYF_KERNEL bli_zdotxaxpyf_opt_var1
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1M KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- packm --
|
||||
|
||||
//#define BLIS_SPACKM_2XK_KERNEL bli_spackm_ref_2xk
|
||||
//#define BLIS_DPACKM_2XK_KERNEL bli_dpackm_ref_2xk
|
||||
//#define BLIS_CPACKM_2XK_KERNEL bli_cpackm_ref_2xk
|
||||
//#define BLIS_ZPACKM_2XK_KERNEL bli_zpackm_ref_2xk
|
||||
|
||||
//#define BLIS_SPACKM_4XK_KERNEL bli_spackm_ref_4xk
|
||||
//#define BLIS_DPACKM_4XK_KERNEL bli_dpackm_ref_4xk
|
||||
//#define BLIS_CPACKM_4XK_KERNEL bli_cpackm_ref_4xk
|
||||
//#define BLIS_ZPACKM_4XK_KERNEL bli_zpackm_ref_4xk
|
||||
|
||||
//#define BLIS_SPACKM_6XK_KERNEL bli_spackm_ref_6xk
|
||||
//#define BLIS_DPACKM_6XK_KERNEL bli_dpackm_ref_6xk
|
||||
//#define BLIS_CPACKM_6XK_KERNEL bli_cpackm_ref_6xk
|
||||
//#define BLIS_ZPACKM_6XK_KERNEL bli_zpackm_ref_6xk
|
||||
|
||||
//#define BLIS_SPACKM_8XK_KERNEL bli_spackm_ref_8xk
|
||||
//#define BLIS_DPACKM_8XK_KERNEL bli_dpackm_ref_8xk
|
||||
//#define BLIS_CPACKM_8XK_KERNEL bli_cpackm_ref_8xk
|
||||
//#define BLIS_ZPACKM_8XK_KERNEL bli_zpackm_ref_8xk
|
||||
|
||||
// ...
|
||||
|
||||
// (Commented definitions for 10, 12, 14, and 16 not shown).
|
||||
|
||||
|
||||
|
||||
|
||||
// -- LEVEL-1V KERNEL DEFINITIONS ----------------------------------------------
|
||||
|
||||
// -- addv --
|
||||
|
||||
//#define BLIS_SADDV_KERNEL bli_saddv_unb_var1
|
||||
//#define BLIS_DADDV_KERNEL bli_daddv_unb_var1
|
||||
//#define BLIS_CADDV_KERNEL bli_caddv_unb_var1
|
||||
//#define BLIS_ZADDV_KERNEL bli_zaddv_unb_var1
|
||||
|
||||
// -- axpyv --
|
||||
|
||||
#define BLIS_SAXPYV_KERNEL bli_saxpyv_opt_var1
|
||||
#define BLIS_DAXPYV_KERNEL bli_daxpyv_opt_var1
|
||||
#define BLIS_CAXPYV_KERNEL bli_caxpyv_opt_var1
|
||||
#define BLIS_ZAXPYV_KERNEL bli_zaxpyv_opt_var1
|
||||
|
||||
// -- copyv --
|
||||
|
||||
//#define BLIS_SCOPYV_KERNEL bli_scopyv_unb_var1
|
||||
//#define BLIS_DCOPYV_KERNEL bli_dcopyv_unb_var1
|
||||
//#define BLIS_CCOPYV_KERNEL bli_ccopyv_unb_var1
|
||||
//#define BLIS_ZCOPYV_KERNEL bli_zcopyv_unb_var1
|
||||
|
||||
// -- dotv --
|
||||
|
||||
#define BLIS_SDOTV_KERNEL bli_sdotv_opt_var1
|
||||
#define BLIS_DDOTV_KERNEL bli_ddotv_opt_var1
|
||||
#define BLIS_CDOTV_KERNEL bli_cdotv_opt_var1
|
||||
#define BLIS_ZDOTV_KERNEL bli_zdotv_opt_var1
|
||||
|
||||
// -- dotxv --
|
||||
|
||||
//#define BLIS_SDOTXV_KERNEL bli_sdotxv_unb_var1
|
||||
//#define BLIS_DDOTXV_KERNEL bli_ddotxv_unb_var1
|
||||
//#define BLIS_CDOTXV_KERNEL bli_cdotxv_unb_var1
|
||||
//#define BLIS_ZDOTXV_KERNEL bli_zdotxv_unb_var1
|
||||
|
||||
// -- invertv --
|
||||
|
||||
//#define BLIS_SINVERTV_KERNEL bli_sinvertv_unb_var1
|
||||
//#define BLIS_DINVERTV_KERNEL bli_dinvertv_unb_var1
|
||||
//#define BLIS_CINVERTV_KERNEL bli_cinvertv_unb_var1
|
||||
//#define BLIS_ZINVERTV_KERNEL bli_zinvertv_unb_var1
|
||||
|
||||
// -- scal2v --
|
||||
|
||||
//#define BLIS_SSCAL2V_KERNEL bli_sscal2v_unb_var1
|
||||
//#define BLIS_DSCAL2V_KERNEL bli_dscal2v_unb_var1
|
||||
//#define BLIS_CSCAL2V_KERNEL bli_cscal2v_unb_var1
|
||||
//#define BLIS_ZSCAL2V_KERNEL bli_zscal2v_unb_var1
|
||||
|
||||
// -- scalv --
|
||||
|
||||
//#define BLIS_SSCALV_KERNEL bli_sscalv_unb_var1
|
||||
//#define BLIS_DSCALV_KERNEL bli_dscalv_unb_var1
|
||||
//#define BLIS_CSCALV_KERNEL bli_cscalv_unb_var1
|
||||
//#define BLIS_ZSCALV_KERNEL bli_zscalv_unb_var1
|
||||
|
||||
// -- setv --
|
||||
|
||||
//#define BLIS_SSETV_KERNEL bli_ssetv_unb_var1
|
||||
//#define BLIS_DSETV_KERNEL bli_dsetv_unb_var1
|
||||
//#define BLIS_CSETV_KERNEL bli_csetv_unb_var1
|
||||
//#define BLIS_ZSETV_KERNEL bli_zsetv_unb_var1
|
||||
|
||||
// -- subv --
|
||||
|
||||
//#define BLIS_SSUBV_KERNEL bli_ssubv_unb_var1
|
||||
//#define BLIS_DSUBV_KERNEL bli_dsubv_unb_var1
|
||||
//#define BLIS_CSUBV_KERNEL bli_csubv_unb_var1
|
||||
//#define BLIS_ZSUBV_KERNEL bli_zsubv_unb_var1
|
||||
|
||||
// -- swapv --
|
||||
|
||||
//#define BLIS_SSWAPV_KERNEL bli_sswapv_unb_var1
|
||||
//#define BLIS_DSWAPV_KERNEL bli_dswapv_unb_var1
|
||||
//#define BLIS_CSWAPV_KERNEL bli_cswapv_unb_var1
|
||||
//#define BLIS_ZSWAPV_KERNEL bli_zswapv_unb_var1
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,87 +35,14 @@
|
||||
#include "blis.h"
|
||||
|
||||
|
||||
|
||||
void bli_saxpyv_opt_var1
|
||||
void bli_zaxpyv_template_noopt
|
||||
(
|
||||
conj_t conjx,
|
||||
dim_t n,
|
||||
float* alpha,
|
||||
float* x, inc_t incx,
|
||||
float* y, inc_t incy,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
/* Just call the reference implementation. */
|
||||
BLIS_SAXPYV_KERNEL_REF
|
||||
(
|
||||
conjx,
|
||||
n,
|
||||
alpha,
|
||||
x, incx,
|
||||
y, incy,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void bli_daxpyv_opt_var1
|
||||
(
|
||||
conj_t conjx,
|
||||
dim_t n,
|
||||
double* alpha,
|
||||
double* x, inc_t incx,
|
||||
double* y, inc_t incy,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
/* Just call the reference implementation. */
|
||||
BLIS_DAXPYV_KERNEL_REF
|
||||
(
|
||||
conjx,
|
||||
n,
|
||||
alpha,
|
||||
x, incx,
|
||||
y, incy,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void bli_caxpyv_opt_var1
|
||||
(
|
||||
conj_t conjx,
|
||||
dim_t n,
|
||||
scomplex* alpha,
|
||||
scomplex* x, inc_t incx,
|
||||
scomplex* y, inc_t incy,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
/* Just call the reference implementation. */
|
||||
BLIS_CAXPYV_KERNEL_REF
|
||||
(
|
||||
conjx,
|
||||
n,
|
||||
alpha,
|
||||
x, incx,
|
||||
y, incy,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void bli_zaxpyv_opt_var1
|
||||
(
|
||||
conj_t conjx,
|
||||
dim_t n,
|
||||
dcomplex* alpha,
|
||||
dcomplex* x, inc_t incx,
|
||||
dcomplex* y, inc_t incy,
|
||||
cntx_t* cntx
|
||||
conj_t conjx,
|
||||
dim_t n,
|
||||
dcomplex* restrict alpha,
|
||||
dcomplex* restrict x, inc_t incx,
|
||||
dcomplex* restrict y, inc_t incy,
|
||||
cntx_t* restrict cntx
|
||||
)
|
||||
{
|
||||
/*
|
||||
@@ -156,8 +83,7 @@ void bli_zaxpyv_opt_var1
|
||||
If the vectors are aligned, or unaligned by the same offset, then optimized
|
||||
code can be used for the bulk of the computation. This template shows how
|
||||
the front-edge case can be handled so that the remaining computation is
|
||||
aligned. (This template guarantees alignment to be BLIS_SIMD_ALIGN_SIZE,
|
||||
which is defined in bli_config.h.)
|
||||
aligned. (This template guarantees alignment to be BLIS_SIMD_ALIGN_SIZE.)
|
||||
|
||||
Additional things to consider:
|
||||
|
||||
@@ -221,7 +147,9 @@ void bli_zaxpyv_opt_var1
|
||||
// Call the reference implementation if needed.
|
||||
if ( use_ref == TRUE )
|
||||
{
|
||||
BLIS_ZAXPYV_KERNEL_REF
|
||||
zaxpyv_ft f = bli_zaxpyv_template_ref;
|
||||
|
||||
f
|
||||
(
|
||||
conjx,
|
||||
n,
|
||||
@@ -35,94 +35,15 @@
|
||||
#include "blis.h"
|
||||
|
||||
|
||||
|
||||
void bli_sdotv_opt_var1
|
||||
void bli_zdotv_template_noopt
|
||||
(
|
||||
conj_t conjx,
|
||||
conj_t conjy,
|
||||
dim_t n,
|
||||
float* x, inc_t incx,
|
||||
float* y, inc_t incy,
|
||||
float* rho,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
/* Just call the reference implementation. */
|
||||
BLIS_SDOTV_KERNEL_REF
|
||||
(
|
||||
conjx,
|
||||
conjy,
|
||||
n,
|
||||
x, incx,
|
||||
y, incy,
|
||||
rho,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void bli_ddotv_opt_var1
|
||||
(
|
||||
conj_t conjx,
|
||||
conj_t conjy,
|
||||
dim_t n,
|
||||
double* x, inc_t incx,
|
||||
double* y, inc_t incy,
|
||||
double* rho,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
/* Just call the reference implementation. */
|
||||
BLIS_DDOTV_KERNEL_REF
|
||||
(
|
||||
conjx,
|
||||
conjy,
|
||||
n,
|
||||
x, incx,
|
||||
y, incy,
|
||||
rho,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void bli_cdotv_opt_var1
|
||||
(
|
||||
conj_t conjx,
|
||||
conj_t conjy,
|
||||
dim_t n,
|
||||
scomplex* x, inc_t incx,
|
||||
scomplex* y, inc_t incy,
|
||||
scomplex* rho,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
/* Just call the reference implementation. */
|
||||
BLIS_CDOTV_KERNEL_REF
|
||||
(
|
||||
conjx,
|
||||
conjy,
|
||||
n,
|
||||
x, incx,
|
||||
y, incy,
|
||||
rho,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void bli_zdotv_opt_var1
|
||||
(
|
||||
conj_t conjx,
|
||||
conj_t conjy,
|
||||
dim_t n,
|
||||
dcomplex* x, inc_t incx,
|
||||
dcomplex* y, inc_t incy,
|
||||
dcomplex* rho,
|
||||
cntx_t* cntx
|
||||
conj_t conjx,
|
||||
conj_t conjy,
|
||||
dim_t n,
|
||||
dcomplex* restrict x, inc_t incx,
|
||||
dcomplex* restrict y, inc_t incy,
|
||||
dcomplex* restrict rho,
|
||||
cntx_t* restrict cntx
|
||||
)
|
||||
{
|
||||
/*
|
||||
@@ -164,8 +85,7 @@ void bli_zdotv_opt_var1
|
||||
If the vectors are aligned, or unaligned by the same offset, then optimized
|
||||
code can be used for the bulk of the computation. This template shows how
|
||||
the front-edge case can be handled so that the remaining computation is
|
||||
aligned. (This template guarantees alignment to be BLIS_SIMD_ALIGN_SIZE,
|
||||
which is defined in bli_config.h.)
|
||||
aligned. (This template guarantees alignment to be BLIS_SIMD_ALIGN_SIZE.)
|
||||
|
||||
Additional things to consider:
|
||||
|
||||
@@ -238,7 +158,9 @@ void bli_zdotv_opt_var1
|
||||
// Call the reference implementation if needed.
|
||||
if ( use_ref == TRUE )
|
||||
{
|
||||
BLIS_ZDOTV_KERNEL_REF
|
||||
zdotv_ft f = bli_zdotv_template_ref;
|
||||
|
||||
f
|
||||
(
|
||||
conjx,
|
||||
conjy,
|
||||
@@ -35,108 +35,17 @@
|
||||
#include "blis.h"
|
||||
|
||||
|
||||
|
||||
void bli_saxpy2v_opt_var1
|
||||
void bli_zaxpy2v_template_noopt
|
||||
(
|
||||
conj_t conjx,
|
||||
conj_t conjy,
|
||||
dim_t n,
|
||||
float* alpha1,
|
||||
float* alpha2,
|
||||
float* x, inc_t incx,
|
||||
float* y, inc_t incy,
|
||||
float* z, inc_t incz,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
/* Just call the reference implementation. */
|
||||
BLIS_SAXPY2V_KERNEL_REF
|
||||
(
|
||||
conjx,
|
||||
conjy,
|
||||
n,
|
||||
alpha1,
|
||||
alpha2,
|
||||
x, incx,
|
||||
y, incy,
|
||||
z, incz,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void bli_daxpy2v_opt_var1
|
||||
(
|
||||
conj_t conjx,
|
||||
conj_t conjy,
|
||||
dim_t n,
|
||||
double* alpha1,
|
||||
double* alpha2,
|
||||
double* x, inc_t incx,
|
||||
double* y, inc_t incy,
|
||||
double* z, inc_t incz,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
/* Just call the reference implementation. */
|
||||
BLIS_DAXPY2V_KERNEL_REF
|
||||
(
|
||||
conjx,
|
||||
conjy,
|
||||
n,
|
||||
alpha1,
|
||||
alpha2,
|
||||
x, incx,
|
||||
y, incy,
|
||||
z, incz,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void bli_caxpy2v_opt_var1
|
||||
(
|
||||
conj_t conjx,
|
||||
conj_t conjy,
|
||||
dim_t n,
|
||||
scomplex* alpha1,
|
||||
scomplex* alpha2,
|
||||
scomplex* x, inc_t incx,
|
||||
scomplex* y, inc_t incy,
|
||||
scomplex* z, inc_t incz,
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
/* Just call the reference implementation. */
|
||||
BLIS_CAXPY2V_KERNEL_REF
|
||||
(
|
||||
conjx,
|
||||
conjy,
|
||||
n,
|
||||
alpha1,
|
||||
alpha2,
|
||||
x, incx,
|
||||
y, incy,
|
||||
z, incz,
|
||||
cntx
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void bli_zaxpy2v_opt_var1
|
||||
(
|
||||
conj_t conjx,
|
||||
conj_t conjy,
|
||||
dim_t n,
|
||||
dcomplex* alpha1,
|
||||
dcomplex* alpha2,
|
||||
dcomplex* x, inc_t incx,
|
||||
dcomplex* y, inc_t incy,
|
||||
dcomplex* z, inc_t incz,
|
||||
cntx_t* cntx
|
||||
conj_t conjx,
|
||||
conj_t conjy,
|
||||
dim_t n,
|
||||
dcomplex* restrict alpha1,
|
||||
dcomplex* restrict alpha2,
|
||||
dcomplex* restrict x, inc_t incx,
|
||||
dcomplex* restrict y, inc_t incy,
|
||||
dcomplex* restrict z, inc_t incz,
|
||||
cntx_t* restrict cntx
|
||||
)
|
||||
{
|
||||
/*
|
||||
@@ -184,7 +93,7 @@ void bli_zaxpy2v_opt_var1
|
||||
code can be used for the bulk of the computation. This template shows how
|
||||
the front-edge case can be handled so that the remaining computation is
|
||||
aligned. (This template guarantees alignment in the main loops to be
|
||||
BLIS_SIMD_ALIGN_SIZE, which is defined in bli_config.h.)
|
||||
BLIS_SIMD_ALIGN_SIZE.)
|
||||
|
||||
Here are a few additional things to consider:
|
||||
|
||||
@@ -249,7 +158,9 @@ void bli_zaxpy2v_opt_var1
|
||||
// Call the reference implementation if needed.
|
||||
if ( use_ref == TRUE )
|
||||
{
|
||||
BLIS_ZAXPY2V_KERNEL_REF
|
||||
zaxpy2v_ft f = bli_zaxpy2v_template_ref;
|
||||
|
||||
f
|
||||
(
|
||||
conjx,
|
||||
conjy,
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user