diff --git a/.gitignore b/.gitignore index 4dc9073f6..7663655a3 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,10 @@ config.mk bli_config.h +# -- monolithic headers -- + +include/*/*.h + # -- makefile fragments -- .fragment.mk diff --git a/.travis.yml b/.travis.yml index 51cd5ea76..1ee796100 100644 --- a/.travis.yml +++ b/.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 diff --git a/Makefile b/Makefile index 6a1bab97f..c25b886f7 100644 --- a/Makefile +++ b/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 diff --git a/build/auto-detect/auto-detect.sh b/build/auto-detect/auto-detect.sh index 5185fd8af..0065d6b82 100755 --- a/build/auto-detect/auto-detect.sh +++ b/build/auto-detect/auto-detect.sh @@ -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 # diff --git a/build/auto-detect/cpuid_x86.c b/build/auto-detect/cpuid_x86.c index 07ca004f0..c3affa6eb 100644 --- a/build/auto-detect/cpuid_x86.c +++ b/build/auto-detect/cpuid_x86.c @@ -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; } diff --git a/build/bli_config.h.in b/build/bli_config.h.in index 269998283..c4c59db56 100644 --- a/build/bli_config.h.in +++ b/build/bli_config.h.in @@ -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 diff --git a/build/config.mk.in b/build/config.mk.in index ef2ccfc70..fe4880ced 100644 --- a/build/config.mk.in +++ b/build/config.mk.in @@ -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@ diff --git a/build/flatten-headers.sh b/build/flatten-headers.sh new file mode 100755 index 000000000..aa30b47c4 --- /dev/null +++ b/build/flatten-headers.sh @@ -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 "$@" + diff --git a/build/gen-make-frags/gen-make-frag.sh b/build/gen-make-frags/gen-make-frag.sh index 19fdc5bd0..4e51c6439 100755 --- a/build/gen-make-frags/gen-make-frag.sh +++ b/build/gen-make-frags/gen-make-frag.sh @@ -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 diff --git a/build/old/flatten-headers-pass.sh b/build/old/flatten-headers-pass.sh new file mode 100755 index 000000000..6c554b3e5 --- /dev/null +++ b/build/old/flatten-headers-pass.sh @@ -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 "$@" + diff --git a/common.mk b/common.mk index 08731d9aa..2ac15a926 100644 --- a/common.mk +++ b/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 - diff --git a/config/reference/bli_kernel.h b/config/amd64/bli_family_amd64.h similarity index 90% rename from config/reference/bli_kernel.h rename to config/amd64/bli_family_amd64.h index 9dd872017..d19f6bd39 100644 --- a/config/reference/bli_kernel.h +++ b/config/amd64/bli_family_amd64.h @@ -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 diff --git a/config/carrizo/make_defs.mk b/config/amd64/make_defs.mk similarity index 78% rename from config/carrizo/make_defs.mk rename to config/amd64/make_defs.mk index 94808d466..2e82513f5 100644 --- a/config/carrizo/make_defs.mk +++ b/config/amd64/make_defs.mk @@ -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 diff --git a/config/armv7a/bli_kernel.h b/config/armv7a/bli_kernel.h deleted file mode 100644 index 4de513abb..000000000 --- a/config/armv7a/bli_kernel.h +++ /dev/null @@ -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 - diff --git a/config/armv7a/kernels b/config/armv7a/kernels deleted file mode 120000 index c40c02857..000000000 --- a/config/armv7a/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/armv7a \ No newline at end of file diff --git a/config/armv8a/bli_kernel.h b/config/armv8a/bli_kernel.h deleted file mode 100644 index b9ae3aec1..000000000 --- a/config/armv8a/bli_kernel.h +++ /dev/null @@ -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 - diff --git a/config/armv8a/kernels b/config/armv8a/kernels deleted file mode 120000 index f760061ce..000000000 --- a/config/armv8a/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/armv8a/ \ No newline at end of file diff --git a/frame/3/old/bli_syr2k_check.c b/config/bgq/bli_cntx_init_bgq.c similarity index 55% rename from frame/3/old/bli_syr2k_check.c rename to config/bgq/bli_cntx_init_bgq.c index 499844c23..6b3595f92 100644 --- a/frame/3/old/bli_syr2k_check.c +++ b/config/bgq/bli_cntx_init_bgq.c @@ -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 + ); } diff --git a/config/bgq/bli_family_bgq.h b/config/bgq/bli_family_bgq.h new file mode 100644 index 000000000..8c5a2a048 --- /dev/null +++ b/config/bgq/bli_family_bgq.h @@ -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 + diff --git a/config/bgq/bli_kernel.h b/config/bgq/bli_kernel.h deleted file mode 100644 index fd8446c34..000000000 --- a/config/bgq/bli_kernel.h +++ /dev/null @@ -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 - diff --git a/config/bgq/kernels b/config/bgq/kernels deleted file mode 120000 index 452238036..000000000 --- a/config/bgq/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/bgq \ No newline at end of file diff --git a/config/bgq/make_defs.mk b/config/bgq/make_defs.mk index 07f6792db..faa264665 100644 --- a/config/bgq/make_defs.mk +++ b/config/bgq/make_defs.mk @@ -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 diff --git a/config/bulldozer/bli_cntx_init_bulldozer.c b/config/bulldozer/bli_cntx_init_bulldozer.c new file mode 100644 index 000000000..44d760f40 --- /dev/null +++ b/config/bulldozer/bli_cntx_init_bulldozer.c @@ -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 + ); +} + diff --git a/config/bulldozer/bli_kernel.h b/config/bulldozer/bli_family_bulldozer.h similarity index 69% rename from config/bulldozer/bli_kernel.h rename to config/bulldozer/bli_family_bulldozer.h index b750b6da2..562750c3e 100644 --- a/config/bulldozer/bli_kernel.h +++ b/config/bulldozer/bli_family_bulldozer.h @@ -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 + diff --git a/config/bulldozer/kernels b/config/bulldozer/kernels deleted file mode 120000 index 9ed7ea19a..000000000 --- a/config/bulldozer/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/x86_64/bulldozer/ \ No newline at end of file diff --git a/config/bulldozer/make_defs.mk b/config/bulldozer/make_defs.mk index df472c292..a309b9577 100644 --- a/config/bulldozer/make_defs.mk +++ b/config/bulldozer/make_defs.mk @@ -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 diff --git a/config/carrizo/kernels b/config/carrizo/kernels deleted file mode 120000 index a3f3e222d..000000000 --- a/config/carrizo/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/x86_64/piledriver \ No newline at end of file diff --git a/config/cortex-a15/bli_kernel.h b/config/cortex-a15/bli_kernel.h deleted file mode 100644 index 298e516c7..000000000 --- a/config/cortex-a15/bli_kernel.h +++ /dev/null @@ -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 - diff --git a/config/cortex-a15/kernels b/config/cortex-a15/kernels deleted file mode 120000 index 8528d8234..000000000 --- a/config/cortex-a15/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/arm \ No newline at end of file diff --git a/config/cortex-a9/bli_kernel.h b/config/cortex-a9/bli_kernel.h deleted file mode 100644 index 1ec9f5646..000000000 --- a/config/cortex-a9/bli_kernel.h +++ /dev/null @@ -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 - diff --git a/config/cortex-a9/kernels b/config/cortex-a9/kernels deleted file mode 120000 index 8528d8234..000000000 --- a/config/cortex-a9/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/arm \ No newline at end of file diff --git a/config/cortexa15/bli_cntx_init_cortexa15.c b/config/cortexa15/bli_cntx_init_cortexa15.c new file mode 100644 index 000000000..a3ac46272 --- /dev/null +++ b/config/cortexa15/bli_cntx_init_cortexa15.c @@ -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 + ); +} + diff --git a/frame/3/old/bli_syrk_check.c b/config/cortexa15/bli_family_cortexa15.h similarity index 57% rename from frame/3/old/bli_syrk_check.c rename to config/cortexa15/bli_family_cortexa15.h index 909dba50b..44e0b947c 100644 --- a/frame/3/old/bli_syrk_check.c +++ b/config/cortexa15/bli_family_cortexa15.h @@ -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 diff --git a/config/cortex-a9/make_defs.mk b/config/cortexa15/make_defs.mk similarity index 79% rename from config/cortex-a9/make_defs.mk rename to config/cortexa15/make_defs.mk index c4c47467e..239b7d93a 100644 --- a/config/cortex-a9/make_defs.mk +++ b/config/cortexa15/make_defs.mk @@ -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 diff --git a/config/cortexa57/bli_cntx_init_cortexa57.c b/config/cortexa57/bli_cntx_init_cortexa57.c new file mode 100644 index 000000000..3a36969c4 --- /dev/null +++ b/config/cortexa57/bli_cntx_init_cortexa57.c @@ -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 + ); +} + diff --git a/config/cortexa57/bli_family_cortexa57.h b/config/cortexa57/bli_family_cortexa57.h new file mode 100644 index 000000000..042421c3b --- /dev/null +++ b/config/cortexa57/bli_family_cortexa57.h @@ -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 + diff --git a/config/armv8a/make_defs.mk b/config/cortexa57/make_defs.mk similarity index 79% rename from config/armv8a/make_defs.mk rename to config/cortexa57/make_defs.mk index 56dd3074e..1809991b0 100644 --- a/config/armv8a/make_defs.mk +++ b/config/cortexa57/make_defs.mk @@ -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 diff --git a/frame/3/old/bli_trmm_prune.c b/config/cortexa9/bli_cntx_init_cortexa9.c similarity index 54% rename from frame/3/old/bli_trmm_prune.c rename to config/cortexa9/bli_cntx_init_cortexa9.c index 04c0f621d..8a94a1dcb 100644 --- a/frame/3/old/bli_trmm_prune.c +++ b/config/cortexa9/bli_cntx_init_cortexa9.c @@ -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 + ); } diff --git a/frame/3/old/bli_her2k_check.h b/config/cortexa9/bli_family_cortexa9.h similarity index 57% rename from frame/3/old/bli_her2k_check.h rename to config/cortexa9/bli_family_cortexa9.h index 66047f8b9..114fdee85 100644 --- a/frame/3/old/bli_her2k_check.h +++ b/config/cortexa9/bli_family_cortexa9.h @@ -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 + diff --git a/config/cortex-a15/make_defs.mk b/config/cortexa9/make_defs.mk similarity index 80% rename from config/cortex-a15/make_defs.mk rename to config/cortexa9/make_defs.mk index c4c47467e..ddd70c349 100644 --- a/config/cortex-a15/make_defs.mk +++ b/config/cortexa9/make_defs.mk @@ -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 diff --git a/config/dunnington/kernels b/config/dunnington/kernels deleted file mode 120000 index 0ce5cd870..000000000 --- a/config/dunnington/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/x86_64/penryn \ No newline at end of file diff --git a/config/excavator/bli_cntx_init_excavator.c b/config/excavator/bli_cntx_init_excavator.c new file mode 100644 index 000000000..065154d27 --- /dev/null +++ b/config/excavator/bli_cntx_init_excavator.c @@ -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 + ); +} + diff --git a/config/carrizo/bli_kernel.h b/config/excavator/bli_family_excavator.h similarity index 68% rename from config/carrizo/bli_kernel.h rename to config/excavator/bli_family_excavator.h index 41175e734..dcf1d82d9 100644 --- a/config/carrizo/bli_kernel.h +++ b/config/excavator/bli_family_excavator.h @@ -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 + diff --git a/config/excavator/make_defs.mk b/config/excavator/make_defs.mk new file mode 100644 index 000000000..6cb1ca580 --- /dev/null +++ b/config/excavator/make_defs.mk @@ -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))) + diff --git a/config/generic/bli_cntx_init_generic.c b/config/generic/bli_cntx_init_generic.c new file mode 100644 index 000000000..877d8085a --- /dev/null +++ b/config/generic/bli_cntx_init_generic.c @@ -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 ); + +} + diff --git a/frame/3/old/bli_trsm_direct.h b/config/generic/bli_family_generic.h similarity index 95% rename from frame/3/old/bli_trsm_direct.h rename to config/generic/bli_family_generic.h index d7e7c206b..3894c4dc3 100644 --- a/frame/3/old/bli_trsm_direct.h +++ b/config/generic/bli_family_generic.h @@ -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 diff --git a/config/generic/make_defs.mk b/config/generic/make_defs.mk new file mode 100644 index 000000000..5139d154b --- /dev/null +++ b/config/generic/make_defs.mk @@ -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))) + diff --git a/config/haswell/bli_cntx_init_haswell.c b/config/haswell/bli_cntx_init_haswell.c new file mode 100644 index 000000000..b791130b3 --- /dev/null +++ b/config/haswell/bli_cntx_init_haswell.c @@ -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 + ); +} + diff --git a/config/haswell/bli_kernel.h b/config/haswell/bli_family_haswell.h similarity index 81% rename from config/haswell/bli_kernel.h rename to config/haswell/bli_family_haswell.h index ce18dc266..546971595 100644 --- a/config/haswell/bli_kernel.h +++ b/config/haswell/bli_family_haswell.h @@ -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 + diff --git a/config/haswell/kernels b/config/haswell/kernels deleted file mode 120000 index 53e3cdac8..000000000 --- a/config/haswell/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/x86_64/haswell \ No newline at end of file diff --git a/config/haswell/make_defs.mk b/config/haswell/make_defs.mk index 4a4e6e494..433dcebd8 100644 --- a/config/haswell/make_defs.mk +++ b/config/haswell/make_defs.mk @@ -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 diff --git a/frame/3/old/bli_trmm_direct.h b/config/intel64/bli_family_intel64.h similarity index 95% rename from frame/3/old/bli_trmm_direct.h rename to config/intel64/bli_family_intel64.h index 905ba8fc9..0cc9e94b7 100644 --- a/frame/3/old/bli_trmm_direct.h +++ b/config/intel64/bli_family_intel64.h @@ -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 diff --git a/config/intel64/make_defs.mk b/config/intel64/make_defs.mk new file mode 100644 index 000000000..22369bb6c --- /dev/null +++ b/config/intel64/make_defs.mk @@ -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))) + diff --git a/config/knc/bli_cntx_init_knc.c b/config/knc/bli_cntx_init_knc.c new file mode 100644 index 000000000..6778f3fd7 --- /dev/null +++ b/config/knc/bli_cntx_init_knc.c @@ -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 + ); +} + diff --git a/config/knc/bli_family_knc.h b/config/knc/bli_family_knc.h new file mode 100644 index 000000000..ee1f6398d --- /dev/null +++ b/config/knc/bli_family_knc.h @@ -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 + diff --git a/config/mic/make_defs.mk b/config/knc/make_defs.mk similarity index 81% rename from config/mic/make_defs.mk rename to config/knc/make_defs.mk index e82811357..99d329c58 100644 --- a/config/mic/make_defs.mk +++ b/config/knc/make_defs.mk @@ -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))) + diff --git a/frame/3/old/bli_trmm3_check.c b/config/knl/bli_cntx_init_knl.c similarity index 50% rename from frame/3/old/bli_trmm3_check.c rename to config/knl/bli_cntx_init_knl.c index 2d52f80c3..a8c5b8cb0 100644 --- a/frame/3/old/bli_trmm3_check.c +++ b/config/knl/bli_cntx_init_knl.c @@ -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 + ); } diff --git a/config/knl/bli_kernel.h b/config/knl/bli_family_knl.h similarity index 66% rename from config/knl/bli_kernel.h rename to config/knl/bli_family_knl.h index 46b1cb4f4..9b9b1b4a1 100644 --- a/config/knl/bli_kernel.h +++ b/config/knl/bli_family_knl.h @@ -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 + diff --git a/config/knl/kernels b/config/knl/kernels deleted file mode 120000 index 30d5070c3..000000000 --- a/config/knl/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/x86_64/knl \ No newline at end of file diff --git a/config/knl/make_defs.mk b/config/knl/make_defs.mk index a3db40981..7b5006e3e 100644 --- a/config/knl/make_defs.mk +++ b/config/knl/make_defs.mk @@ -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))) + diff --git a/config/loongson3a/kernels b/config/loongson3a/kernels deleted file mode 120000 index b5c52d8bf..000000000 --- a/config/loongson3a/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/loongson3a \ No newline at end of file diff --git a/config/mic/bli_kernel.h b/config/mic/bli_kernel.h deleted file mode 100644 index 5402b899f..000000000 --- a/config/mic/bli_kernel.h +++ /dev/null @@ -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 - diff --git a/config/mic/kernels b/config/mic/kernels deleted file mode 120000 index 74e41c2bf..000000000 --- a/config/mic/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/mic \ No newline at end of file diff --git a/config/old/armv7a/bli_cntx_init_armv7a.c b/config/old/armv7a/bli_cntx_init_armv7a.c new file mode 100644 index 000000000..75424f142 --- /dev/null +++ b/config/old/armv7a/bli_cntx_init_armv7a.c @@ -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 + ); +} + diff --git a/config/old/armv7a/bli_family_armv7a.h b/config/old/armv7a/bli_family_armv7a.h new file mode 100644 index 000000000..cb7e68faa --- /dev/null +++ b/config/old/armv7a/bli_family_armv7a.h @@ -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 + diff --git a/config/armv7a/make_defs.mk b/config/old/armv7a/make_defs.mk similarity index 81% rename from config/armv7a/make_defs.mk rename to config/old/armv7a/make_defs.mk index 8539e1d29..fd0d8980f 100644 --- a/config/armv7a/make_defs.mk +++ b/config/old/armv7a/make_defs.mk @@ -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 diff --git a/config/emscripten/bli_kernel.h b/config/old/emscripten/bli_kernel.h similarity index 100% rename from config/emscripten/bli_kernel.h rename to config/old/emscripten/bli_kernel.h diff --git a/config/emscripten/make_defs.mk b/config/old/emscripten/make_defs.mk similarity index 97% rename from config/emscripten/make_defs.mk rename to config/old/emscripten/make_defs.mk index 91f65f811..2fe526ecb 100644 --- a/config/emscripten/make_defs.mk +++ b/config/old/emscripten/make_defs.mk @@ -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 := diff --git a/config/loongson3a/bli_kernel.h b/config/old/loongson3a/bli_kernel.h similarity index 100% rename from config/loongson3a/bli_kernel.h rename to config/old/loongson3a/bli_kernel.h diff --git a/config/loongson3a/make_defs.mk b/config/old/loongson3a/make_defs.mk similarity index 81% rename from config/loongson3a/make_defs.mk rename to config/old/loongson3a/make_defs.mk index 89ca32929..195d0ce36 100644 --- a/config/loongson3a/make_defs.mk +++ b/config/old/loongson3a/make_defs.mk @@ -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 diff --git a/frame/3/old/bli_herk_direct.h b/config/old/newarch/bli_kernel.h similarity index 95% rename from frame/3/old/bli_herk_direct.h rename to config/old/newarch/bli_kernel.h index 1f027561c..db71f1ba5 100644 --- a/frame/3/old/bli_herk_direct.h +++ b/config/old/newarch/bli_kernel.h @@ -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 + diff --git a/config/reference/make_defs.mk b/config/old/newarch/make_defs.mk similarity index 82% rename from config/reference/make_defs.mk rename to config/old/newarch/make_defs.mk index 89bcca269..64d53c49e 100644 --- a/config/reference/make_defs.mk +++ b/config/old/newarch/make_defs.mk @@ -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 diff --git a/config/pnacl/bli_kernel.h b/config/old/pnacl/bli_kernel.h similarity index 100% rename from config/pnacl/bli_kernel.h rename to config/old/pnacl/bli_kernel.h diff --git a/config/pnacl/make_defs.mk b/config/old/pnacl/make_defs.mk similarity index 97% rename from config/pnacl/make_defs.mk rename to config/old/pnacl/make_defs.mk index c6f629ef8..b060ba9cb 100644 --- a/config/pnacl/make_defs.mk +++ b/config/old/pnacl/make_defs.mk @@ -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 := diff --git a/config/penryn/bli_cntx_init_penryn.c b/config/penryn/bli_cntx_init_penryn.c new file mode 100644 index 000000000..25ae3f947 --- /dev/null +++ b/config/penryn/bli_cntx_init_penryn.c @@ -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 + ); +} + diff --git a/config/dunnington/bli_kernel.h b/config/penryn/bli_family_penryn.h similarity index 62% rename from config/dunnington/bli_kernel.h rename to config/penryn/bli_family_penryn.h index f5d846d9b..5fc251de2 100644 --- a/config/dunnington/bli_kernel.h +++ b/config/penryn/bli_family_penryn.h @@ -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 + diff --git a/config/dunnington/make_defs.mk b/config/penryn/make_defs.mk similarity index 76% rename from config/dunnington/make_defs.mk rename to config/penryn/make_defs.mk index eec2f5a56..1c9abfbcd 100644 --- a/config/dunnington/make_defs.mk +++ b/config/penryn/make_defs.mk @@ -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 diff --git a/config/piledriver/bli_cntx_init_piledriver.c b/config/piledriver/bli_cntx_init_piledriver.c new file mode 100644 index 000000000..61b987041 --- /dev/null +++ b/config/piledriver/bli_cntx_init_piledriver.c @@ -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 + ); +} + diff --git a/config/piledriver/bli_kernel.h b/config/piledriver/bli_family_piledriver.h similarity index 65% rename from config/piledriver/bli_kernel.h rename to config/piledriver/bli_family_piledriver.h index d073ae15c..386ffb85d 100644 --- a/config/piledriver/bli_kernel.h +++ b/config/piledriver/bli_family_piledriver.h @@ -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 + diff --git a/config/piledriver/kernels b/config/piledriver/kernels deleted file mode 120000 index a3f3e222d..000000000 --- a/config/piledriver/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/x86_64/piledriver \ No newline at end of file diff --git a/config/piledriver/make_defs.mk b/config/piledriver/make_defs.mk index 93cd1f2c8..f2d59ec19 100644 --- a/config/piledriver/make_defs.mk +++ b/config/piledriver/make_defs.mk @@ -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 diff --git a/config/pnacl/kernels b/config/pnacl/kernels deleted file mode 120000 index 4fa74dbb3..000000000 --- a/config/pnacl/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/nacl/pnacl \ No newline at end of file diff --git a/frame/3/old/bli_symm_check.c b/config/power7/bli_cntx_init_power7.c similarity index 56% rename from frame/3/old/bli_symm_check.c rename to config/power7/bli_cntx_init_power7.c index 9783924c7..540045241 100644 --- a/frame/3/old/bli_symm_check.c +++ b/config/power7/bli_cntx_init_power7.c @@ -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 + ); } diff --git a/frame/1/kernels/old/bli_axpyv_ref.h b/config/power7/bli_family_power7.h similarity index 79% rename from frame/1/kernels/old/bli_axpyv_ref.h rename to config/power7/bli_family_power7.h index cf3b08196..bb641fa20 100644 --- a/frame/1/kernels/old/bli_axpyv_ref.h +++ b/config/power7/bli_family_power7.h @@ -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 diff --git a/config/power7/bli_kernel.h b/config/power7/bli_kernel.h deleted file mode 100644 index ad057192e..000000000 --- a/config/power7/bli_kernel.h +++ /dev/null @@ -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 - diff --git a/config/power7/kernels b/config/power7/kernels deleted file mode 120000 index 6993bac7b..000000000 --- a/config/power7/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/power7 \ No newline at end of file diff --git a/config/power7/make_defs.mk b/config/power7/make_defs.mk index f35ffdfff..0c12642f9 100644 --- a/config/power7/make_defs.mk +++ b/config/power7/make_defs.mk @@ -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 diff --git a/config/sandybridge/bli_cntx_init_sandybridge.c b/config/sandybridge/bli_cntx_init_sandybridge.c new file mode 100644 index 000000000..9c3280676 --- /dev/null +++ b/config/sandybridge/bli_cntx_init_sandybridge.c @@ -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 + ); +} + diff --git a/config/sandybridge/bli_kernel.h b/config/sandybridge/bli_family_sandybridge.h similarity index 71% rename from config/sandybridge/bli_kernel.h rename to config/sandybridge/bli_family_sandybridge.h index b90214563..f378d0a17 100644 --- a/config/sandybridge/bli_kernel.h +++ b/config/sandybridge/bli_family_sandybridge.h @@ -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 + diff --git a/config/sandybridge/kernels b/config/sandybridge/kernels deleted file mode 120000 index 0132dbc87..000000000 --- a/config/sandybridge/kernels +++ /dev/null @@ -1 +0,0 @@ -../../kernels/x86_64/sandybridge \ No newline at end of file diff --git a/config/sandybridge/make_defs.mk b/config/sandybridge/make_defs.mk index 7bf48d2a4..f14cb0f60 100644 --- a/config/sandybridge/make_defs.mk +++ b/config/sandybridge/make_defs.mk @@ -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 diff --git a/config/steamroller/bli_cntx_init_steamroller.c b/config/steamroller/bli_cntx_init_steamroller.c new file mode 100644 index 000000000..b1409e4fc --- /dev/null +++ b/config/steamroller/bli_cntx_init_steamroller.c @@ -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 + ); +} + diff --git a/config/steamroller/bli_family_steamroller.h b/config/steamroller/bli_family_steamroller.h new file mode 100644 index 000000000..64b0758ca --- /dev/null +++ b/config/steamroller/bli_family_steamroller.h @@ -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 + diff --git a/config/steamroller/make_defs.mk b/config/steamroller/make_defs.mk new file mode 100644 index 000000000..187d97cda --- /dev/null +++ b/config/steamroller/make_defs.mk @@ -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))) + diff --git a/config/template/bli_cntx_init_template.c b/config/template/bli_cntx_init_template.c new file mode 100644 index 000000000..421be494e --- /dev/null +++ b/config/template/bli_cntx_init_template.c @@ -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 + ); +} + diff --git a/frame/3/old/bli_herk_direct.c b/config/template/bli_family_template.h similarity index 92% rename from frame/3/old/bli_herk_direct.c rename to config/template/bli_family_template.h index 729812e84..3894c4dc3 100644 --- a/frame/3/old/bli_herk_direct.c +++ b/config/template/bli_family_template.h @@ -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 diff --git a/config/template/bli_kernel.h b/config/template/bli_kernel.h deleted file mode 100644 index 999abf6fc..000000000 --- a/config/template/bli_kernel.h +++ /dev/null @@ -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 - diff --git a/config/template/kernels/1/bli_axpyv_opt_var1.c b/config/template/kernels/1/bli_axpyv_template_noopt_var1.c similarity index 84% rename from config/template/kernels/1/bli_axpyv_opt_var1.c rename to config/template/kernels/1/bli_axpyv_template_noopt_var1.c index 1480d54ec..ebc767563 100644 --- a/config/template/kernels/1/bli_axpyv_opt_var1.c +++ b/config/template/kernels/1/bli_axpyv_template_noopt_var1.c @@ -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, diff --git a/config/template/kernels/1/bli_dotv_opt_var1.c b/config/template/kernels/1/bli_dotv_template_noopt_var1.c similarity index 84% rename from config/template/kernels/1/bli_dotv_opt_var1.c rename to config/template/kernels/1/bli_dotv_template_noopt_var1.c index ded49839b..afbd7d6dc 100644 --- a/config/template/kernels/1/bli_dotv_opt_var1.c +++ b/config/template/kernels/1/bli_dotv_template_noopt_var1.c @@ -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, diff --git a/config/template/kernels/1f/bli_axpy2v_opt_var1.c b/config/template/kernels/1f/bli_axpy2v_template_noopt_var1.c similarity index 85% rename from config/template/kernels/1f/bli_axpy2v_opt_var1.c rename to config/template/kernels/1f/bli_axpy2v_template_noopt_var1.c index 5448fbd83..34d790868 100644 --- a/config/template/kernels/1f/bli_axpy2v_opt_var1.c +++ b/config/template/kernels/1f/bli_axpy2v_template_noopt_var1.c @@ -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, diff --git a/config/template/kernels/1f/bli_axpyf_opt_var1.c b/config/template/kernels/1f/bli_axpyf_template_noopt_var1.c similarity index 83% rename from config/template/kernels/1f/bli_axpyf_opt_var1.c rename to config/template/kernels/1f/bli_axpyf_template_noopt_var1.c index 7a987d2e2..37b02363e 100644 --- a/config/template/kernels/1f/bli_axpyf_opt_var1.c +++ b/config/template/kernels/1f/bli_axpyf_template_noopt_var1.c @@ -35,107 +35,17 @@ #include "blis.h" - -void bli_saxpyf_opt_var1 +void bli_zaxpyf_template_noopt ( - conj_t conja, - conj_t conjx, - dim_t m, - dim_t b_n, - float* alpha, - float* a, inc_t inca, inc_t lda, - float* x, inc_t incx, - float* y, inc_t incy, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_SAXPYF_KERNEL_REF - ( - conja, - conjx, - m, - b_n, - alpha, - a, inca, lda, - x, incx, - y, incy, - cntx - ); -} - - - -void bli_daxpyf_opt_var1 - ( - conj_t conja, - conj_t conjx, - dim_t m, - dim_t b_n, - double* alpha, - double* a, inc_t inca, inc_t lda, - double* x, inc_t incx, - double* y, inc_t incy, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_DAXPYF_KERNEL_REF - ( - conja, - conjx, - m, - b_n, - alpha, - a, inca, lda, - x, incx, - y, incy, - cntx - ); -} - - - -void bli_caxpyf_opt_var1 - ( - conj_t conja, - conj_t conjx, - dim_t m, - dim_t b_n, - scomplex* alpha, - scomplex* a, inc_t inca, inc_t lda, - scomplex* x, inc_t incx, - scomplex* y, inc_t incy, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_CAXPYF_KERNEL_REF - ( - conja, - conjx, - m, - b_n, - alpha, - a, inca, lda, - x, incx, - y, incy, - cntx - ); -} - - -void bli_zaxpyf_opt_var1 - ( - conj_t conja, - conj_t conjx, - dim_t m, - dim_t b_n, - dcomplex* alpha, - dcomplex* a, inc_t inca, inc_t lda, - dcomplex* x, inc_t incx, - dcomplex* y, inc_t incy, - cntx_t* cntx + conj_t conja, + conj_t conjx, + dim_t m, + dim_t b_n, + dcomplex* restrict alpha, + dcomplex* restrict a, inc_t inca, inc_t lda, + dcomplex* restrict x, inc_t incx, + dcomplex* restrict y, inc_t incy, + cntx_t* restrict cntx ) { /* @@ -186,8 +96,7 @@ void bli_zaxpyf_opt_var1 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 in the main loops to be BLIS_SIMD_ALIGN_SIZE, which is defined - in bli_config.h.) + alignment in the main loops to be BLIS_SIMD_ALIGN_SIZE.) Additional things to consider: @@ -263,7 +172,9 @@ void bli_zaxpyf_opt_var1 // Call the reference implementation if needed. if ( use_ref == TRUE ) { - BLIS_ZAXPYF_KERNEL_REF + zaxpyf_ft f = bli_zaxpyf_template_ref; + + f ( conja, conjx, diff --git a/config/template/kernels/1f/bli_dotaxpyv_opt_var1.c b/config/template/kernels/1f/bli_dotaxpyv_template_noopt_var1.c similarity index 85% rename from config/template/kernels/1f/bli_dotaxpyv_opt_var1.c rename to config/template/kernels/1f/bli_dotaxpyv_template_noopt_var1.c index 7080505ac..375dffafd 100644 --- a/config/template/kernels/1f/bli_dotaxpyv_opt_var1.c +++ b/config/template/kernels/1f/bli_dotaxpyv_template_noopt_var1.c @@ -35,115 +35,18 @@ #include "blis.h" - -void bli_sdotaxpyv_opt_var1 +void bli_zdotaxpyv_template_noopt ( - conj_t conjxt, - conj_t conjx, - conj_t conjy, - dim_t n, - float* alpha, - float* x, inc_t incx, - float* y, inc_t incy, - float* rho, - float* z, inc_t incz, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_SDOTAXPYV_KERNEL_REF - ( - conjxt, - conjx, - conjy, - n, - alpha, - x, incx, - y, incy, - rho, - z, incz, - cntx - ); -} - - - -void bli_ddotaxpyv_opt_var1 - ( - conj_t conjxt, - conj_t conjx, - conj_t conjy, - dim_t n, - double* alpha, - double* x, inc_t incx, - double* y, inc_t incy, - double* rho, - double* z, inc_t incz, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_DDOTAXPYV_KERNEL_REF - ( - conjxt, - conjx, - conjy, - n, - alpha, - x, incx, - y, incy, - rho, - z, incz, - cntx - ); -} - - - -void bli_cdotaxpyv_opt_var1 - ( - conj_t conjxt, - conj_t conjx, - conj_t conjy, - dim_t n, - scomplex* alpha, - scomplex* x, inc_t incx, - scomplex* y, inc_t incy, - scomplex* rho, - scomplex* z, inc_t incz, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_CDOTAXPYV_KERNEL_REF - ( - conjxt, - conjx, - conjy, - n, - alpha, - x, incx, - y, incy, - rho, - z, incz, - cntx - ); -} - - - -void bli_zdotaxpyv_opt_var1 - ( - conj_t conjxt, - conj_t conjx, - conj_t conjy, - dim_t n, - dcomplex* alpha, - dcomplex* x, inc_t incx, - dcomplex* y, inc_t incy, - dcomplex* rho, - dcomplex* z, inc_t incz, - cntx_t* cntx + conj_t conjxt, + conj_t conjx, + conj_t conjy, + dim_t n, + dcomplex* restrict alpha, + dcomplex* restrict x, inc_t incx, + dcomplex* restrict y, inc_t incy, + dcomplex* restrict rho, + dcomplex* restrict z, inc_t incz, + cntx_t* restrict cntx ) { /* @@ -192,7 +95,7 @@ void bli_zdotaxpyv_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: @@ -268,7 +171,9 @@ void bli_zdotaxpyv_opt_var1 // Call the reference implementation if needed. if ( use_ref == TRUE ) { - BLIS_ZDOTAXPYV_KERNEL_REF + zdotaxpyv_ft f = bli_zdotaxpyv_template_ref; + + f ( conjxt, conjx, diff --git a/config/template/kernels/1f/bli_dotxaxpyf_opt_var1.c b/config/template/kernels/1f/bli_dotxaxpyf_template_noopt_var1.c similarity index 84% rename from config/template/kernels/1f/bli_dotxaxpyf_opt_var1.c rename to config/template/kernels/1f/bli_dotxaxpyf_template_noopt_var1.c index fd4831fbe..9dfb33b69 100644 --- a/config/template/kernels/1f/bli_dotxaxpyf_opt_var1.c +++ b/config/template/kernels/1f/bli_dotxaxpyf_template_noopt_var1.c @@ -35,143 +35,22 @@ #include "blis.h" - -void bli_sdotxaxpyf_opt_var1 +void bli_zdotxaxpyf_template_noopt ( - conj_t conjat, - conj_t conja, - conj_t conjw, - conj_t conjx, - dim_t m, - dim_t b_n, - float* alpha, - float* a, inc_t inca, inc_t lda, - float* w, inc_t incw, - float* x, inc_t incx, - float* beta, - float* y, inc_t incy, - float* z, inc_t incz, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_SDOTXAXPYF_KERNEL_REF - ( - conjat, - conja, - conjw, - conjx, - m, - b_n, - alpha, - a, inca, lda, - w, incw, - x, incx, - beta, - y, incy, - z, incz, - cntx - ); -} - - - -void bli_ddotxaxpyf_opt_var1 - ( - conj_t conjat, - conj_t conja, - conj_t conjw, - conj_t conjx, - dim_t m, - dim_t b_n, - double* alpha, - double* a, inc_t inca, inc_t lda, - double* w, inc_t incw, - double* x, inc_t incx, - double* beta, - double* y, inc_t incy, - double* z, inc_t incz, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_DDOTXAXPYF_KERNEL_REF - ( - conjat, - conja, - conjw, - conjx, - m, - b_n, - alpha, - a, inca, lda, - w, incw, - x, incx, - beta, - y, incy, - z, incz, - cntx - ); -} - - - -void bli_cdotxaxpyf_opt_var1 - ( - conj_t conjat, - conj_t conja, - conj_t conjw, - conj_t conjx, - dim_t m, - dim_t b_n, - scomplex* alpha, - scomplex* a, inc_t inca, inc_t lda, - scomplex* w, inc_t incw, - scomplex* x, inc_t incx, - scomplex* beta, - scomplex* y, inc_t incy, - scomplex* z, inc_t incz, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_CDOTXAXPYF_KERNEL_REF - ( - conjat, - conja, - conjw, - conjx, - m, - b_n, - alpha, - a, inca, lda, - w, incw, - x, incx, - beta, - y, incy, - z, incz, - cntx - ); -} - - - -void bli_zdotxaxpyf_opt_var1 - ( - conj_t conjat, - conj_t conja, - conj_t conjw, - conj_t conjx, - dim_t m, - dim_t b_n, - dcomplex* alpha, - dcomplex* a, inc_t inca, inc_t lda, - dcomplex* w, inc_t incw, - dcomplex* x, inc_t incx, - dcomplex* beta, - dcomplex* y, inc_t incy, - dcomplex* z, inc_t incz, - cntx_t* cntx + conj_t conjat, + conj_t conja, + conj_t conjw, + conj_t conjx, + dim_t m, + dim_t b_n, + dcomplex* restrict alpha, + dcomplex* restrict a, inc_t inca, inc_t lda, + dcomplex* restrict w, inc_t incw, + dcomplex* restrict x, inc_t incx, + dcomplex* restrict beta, + dcomplex* restrict y, inc_t incy, + dcomplex* restrict z, inc_t incz, + cntx_t* restrict cntx ) { @@ -233,8 +112,7 @@ void bli_zdotxaxpyf_opt_var1 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 in the main loops to be BLIS_SIMD_ALIGN_SIZE, which - is defined in bli_config.h.) + guarantees alignment in the main loops to be BLIS_SIMD_ALIGN_SIZE.) Additional things to consider: @@ -317,7 +195,9 @@ void bli_zdotxaxpyf_opt_var1 // Call the reference implementation if needed. if ( use_ref == TRUE ) { - BLIS_ZDOTXAXPYF_KERNEL_REF + zdotxaxpyf_ft f = bli_zdotxaxpyf_template_ref; + + f ( conjat, conja, diff --git a/config/template/kernels/1f/bli_dotxf_opt_var1.c b/config/template/kernels/1f/bli_dotxf_template_noopt_var1.c similarity index 83% rename from config/template/kernels/1f/bli_dotxf_opt_var1.c rename to config/template/kernels/1f/bli_dotxf_template_noopt_var1.c index 8f721309c..738af3bdc 100644 --- a/config/template/kernels/1f/bli_dotxf_opt_var1.c +++ b/config/template/kernels/1f/bli_dotxf_template_noopt_var1.c @@ -35,115 +35,18 @@ #include "blis.h" - -void bli_sdotxf_opt_var1 +void bli_zdotxf_template_noopt ( - conj_t conjat, - conj_t conjx, - dim_t m, - dim_t b_n, - float* alpha, - float* a, inc_t inca, inc_t lda, - float* x, inc_t incx, - float* beta, - float* y, inc_t incy, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_SDOTXF_KERNEL_REF - ( - conjat, - conjx, - m, - b_n, - alpha, - a, inca, lda, - x, incx, - beta, - y, incy, - cntx - ); -} - - - -void bli_ddotxf_opt_var1 - ( - conj_t conjat, - conj_t conjx, - dim_t m, - dim_t b_n, - double* alpha, - double* a, inc_t inca, inc_t lda, - double* x, inc_t incx, - double* beta, - double* y, inc_t incy, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_DDOTXF_KERNEL_REF - ( - conjat, - conjx, - m, - b_n, - alpha, - a, inca, lda, - x, incx, - beta, - y, incy, - cntx - ); -} - - - -void bli_cdotxf_opt_var1 - ( - conj_t conjat, - conj_t conjx, - dim_t m, - dim_t b_n, - scomplex* alpha, - scomplex* a, inc_t inca, inc_t lda, - scomplex* x, inc_t incx, - scomplex* beta, - scomplex* y, inc_t incy, - cntx_t* cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_CDOTXF_KERNEL_REF - ( - conjat, - conjx, - m, - b_n, - alpha, - a, inca, lda, - x, incx, - beta, - y, incy, - cntx - ); -} - - - -void bli_zdotxf_opt_var1 - ( - conj_t conjat, - conj_t conjx, - dim_t m, - dim_t b_n, - dcomplex* alpha, - dcomplex* a, inc_t inca, inc_t lda, - dcomplex* x, inc_t incx, - dcomplex* beta, - dcomplex* y, inc_t incy, - cntx_t* cntx + conj_t conjat, + conj_t conjx, + dim_t m, + dim_t b_n, + dcomplex* restrict alpha, + dcomplex* restrict a, inc_t inca, inc_t lda, + dcomplex* restrict x, inc_t incx, + dcomplex* restrict beta, + dcomplex* restrict y, inc_t incy, + cntx_t* restrict cntx ) { /* @@ -196,8 +99,7 @@ void bli_zdotxf_opt_var1 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 in the main loops to be BLIS_SIMD_ALIGN_SIZE, which is defined - in bli_config.h.) + alignment in the main loops to be BLIS_SIMD_ALIGN_SIZE.) Additional things to consider: @@ -289,7 +191,9 @@ void bli_zdotxf_opt_var1 // Call the reference implementation if needed. if ( use_ref == TRUE ) { - BLIS_ZDOTXF_KERNEL_REF + zdotxf_ft f = bli_zdotxf_template_ref; + + f ( conjat, conjx, diff --git a/config/template/kernels/3/bli_gemm_opt_mxn.c b/config/template/kernels/3/bli_gemm_template_noopt_mxn.c similarity index 64% rename from config/template/kernels/3/bli_gemm_opt_mxn.c rename to config/template/kernels/3/bli_gemm_template_noopt_mxn.c index 5fda378e0..4a97499fd 100644 --- a/config/template/kernels/3/bli_gemm_opt_mxn.c +++ b/config/template/kernels/3/bli_gemm_template_noopt_mxn.c @@ -35,43 +35,14 @@ #include "blis.h" - -void bli_sgemm_opt_mxn +void bli_zgemm_template_noopt ( dim_t k, - float* restrict alpha, - float* restrict a1, - float* restrict b1, - float* restrict beta, - float* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_SGEMM_UKERNEL_REF - ( - k, - alpha, - a1, - b1, - beta, - c11, rs_c, cs_c, - data, - cntx - ); -} - - - -void bli_dgemm_opt_mxn - ( - dim_t k, - double* restrict alpha, - double* restrict a1, - double* restrict b1, - double* restrict beta, - double* restrict c11, inc_t rs_c, inc_t cs_c, + dcomplex* restrict alpha, + dcomplex* restrict a1, + dcomplex* restrict b1, + dcomplex* restrict beta, + dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, auxinfo_t* restrict data, cntx_t* restrict cntx ) @@ -80,9 +51,9 @@ void bli_dgemm_opt_mxn Template gemm micro-kernel implementation This function contains a template implementation for a double-precision - real micro-kernel, coded in C, which can serve as the starting point for + complex micro-kernel, coded in C, which can serve as the starting point for one to write an optimized micro-kernel on an arbitrary architecture. (We - show a template implementation for only double-precision real because + show a template implementation for only double-precision complex because the templates for the other three floating-point types would be nearly identical.) @@ -101,7 +72,7 @@ void bli_dgemm_opt_mxn -FGVZ */ - const num_t dt = BLIS_DOUBLE; + const num_t dt = BLIS_DCOMPLEX; const dim_t mr = bli_cntx_get_blksz_def_dt( dt, BLIS_MR, cntx ); const dim_t nr = bli_cntx_get_blksz_def_dt( dt, BLIS_NR, cntx ); @@ -117,16 +88,16 @@ void bli_dgemm_opt_mxn dim_t l, j, i; - double ab[ bli_dmr * - bli_dnr ]; - double* abij; - double ai, bj; + dcomplex ab[ bli_zmr * + bli_znr ]; + dcomplex* abij; + dcomplex ai, bj; /* Initialize the accumulator elements in ab to zero. */ for ( i = 0; i < mr * nr; ++i ) { - bli_dset0s( *(ab + i) ); + bli_zset0s( *(ab + i) ); } /* Perform a series of k rank-1 updates into ab. */ @@ -144,7 +115,7 @@ void bli_dgemm_opt_mxn { ai = *(a1 + i); - bli_ddots( ai, bj, *abij ); + bli_zdots( ai, bj, *abij ); abij += rs_ab; } @@ -157,16 +128,16 @@ void bli_dgemm_opt_mxn /* Scale each element of ab by alpha. */ for ( i = 0; i < mr * nr; ++i ) { - bli_dscals( *alpha, *(ab + i) ); + bli_zscals( *alpha, *(ab + i) ); } /* If beta is zero, overwrite c11 with the scaled result in ab. Otherwise, scale c11 by beta and then add the scaled result in ab. */ - if ( bli_deq0( *beta ) ) + if ( bli_zeq0( *beta ) ) { /* c11 := ab */ - bli_dcopys_mxn( mr, + bli_zcopys_mxn( mr, nr, ab, rs_ab, cs_ab, c11, rs_c, cs_c ); @@ -174,7 +145,7 @@ void bli_dgemm_opt_mxn else { /* c11 := beta * c11 + ab */ - bli_dxpbys_mxn( mr, + bli_zxpbys_mxn( mr, nr, ab, rs_ab, cs_ab, beta, @@ -182,67 +153,3 @@ void bli_dgemm_opt_mxn } } - - -void bli_cgemm_opt_mxn( - dim_t k, - scomplex* restrict alpha, - scomplex* restrict a1, - scomplex* restrict b1, - scomplex* restrict beta, - scomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* data - ) - ( - dim_t k, - scomplex* restrict alpha, - scomplex* restrict a1, - scomplex* restrict b1, - scomplex* restrict beta, - scomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_CGEMM_UKERNEL_REF - ( - k, - alpha, - a1, - b1, - beta, - c11, rs_c, cs_c, - data, - cntx - ); -} - - - -void bli_zgemm_opt_mxn - ( - dim_t k, - dcomplex* restrict alpha, - dcomplex* restrict a1, - dcomplex* restrict b1, - dcomplex* restrict beta, - dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_ZGEMM_UKERNEL_REF - ( - k, - alpha, - a1, - b1, - beta, - c11, rs_c, cs_c, - data, - cntx - ); -} - diff --git a/config/template/kernels/3/bli_gemmtrsm_l_opt_mxn.c b/config/template/kernels/3/bli_gemmtrsm_l_opt_mxn.c deleted file mode 100644 index edad8be36..000000000 --- a/config/template/kernels/3/bli_gemmtrsm_l_opt_mxn.c +++ /dev/null @@ -1,218 +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. - -*/ - -#include "blis.h" - - - -void bli_sgemmtrsm_l_opt_mxn - ( - dim_t k, - float* restrict alpha, - float* restrict a10, - float* restrict a11, - float* restrict b01, - float* restrict b11, - float* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - const num_t dt = BLIS_FLOAT; - - const inc_t packnr = bli_cntx_get_blksz_max_dt( dt, BLIS_NR, cntx ); - - const inc_t rs_b = packnr; - const inc_t cs_b = 1; - - float* restrict minus_one = bli_sm1; - - - bli_sgemm_opt_mxn( k, - minus_one, - a10, - b01, - alpha, - b11, rs_b, cs_b, - data ); - - bli_strsm_l_opt_mxn( a11, - b11, - c11, rs_c, cs_c, - data ); -} - - - -void bli_dgemmtrsm_l_opt_mxn - ( - dim_t k, - double* restrict alpha, - double* restrict a10, - double* restrict a11, - double* restrict b01, - double* restrict b11, - double* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -/* - Template gemmtrsm_l micro-kernel implementation - - This function contains a template implementation for a double-precision - real micro-kernel that fuses a gemm with a trsm_l subproblem. - - This micro-kernel performs the following compound operation: - - B11 := alpha * B11 - A10 * B01 (gemm) - B11 := inv(A11) * B11 (trsm) - C11 := B11 - - where A11 is MR x MR and lower triangular, A10 is MR x k, B01 is k x NR, - B11 is MR x NR, and alpha is a scalar. Here, inv() denotes matrix - inverse. - - For more info, please refer to the BLIS website's wiki on kernels: - - https://github.com/flame/blis/wiki/KernelsHowTo - - and/or contact the blis-devel mailing list. - - -FGVZ -*/ - const num_t dt = BLIS_DOUBLE; - - const inc_t packnr = bli_cntx_get_blksz_max_dt( dt, BLIS_NR, cntx ); - - const inc_t rs_b = packnr; - const inc_t cs_b = 1; - - double* restrict minus_one = bli_dm1; - - /* b11 = alpha * b11 - a10 * b01; */ - bli_dgemm_opt_mxn( k, - minus_one, - a10, - b01, - alpha, - b11, rs_b, cs_b, - data ); - - /* b11 = inv(a11) * b11; - c11 = b11; */ - bli_dtrsm_l_opt_mxn( a11, - b11, - c11, rs_c, cs_c, - data ); -} - - - -void bli_cgemmtrsm_l_opt_mxn - ( - dim_t k, - scomplex* restrict alpha, - scomplex* restrict a10, - scomplex* restrict a11, - scomplex* restrict b01, - scomplex* restrict b11, - scomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - const num_t dt = BLIS_SCOMPLEX; - - const inc_t packnr = bli_cntx_get_blksz_max_dt( dt, BLIS_NR, cntx ); - - const inc_t rs_b = packnr; - const inc_t cs_b = 1; - - scomplex* restrict minus_one = bli_cm1; - - - bli_cgemm_opt_mxn( k, - minus_one, - a10, - b01, - alpha, - b11, rs_b, cs_b, - data ); - - bli_ctrsm_l_opt_mxn( a11, - b11, - c11, rs_c, cs_c, - data ); -} - - - -void bli_zgemmtrsm_l_opt_mxn - ( - dim_t k, - dcomplex* restrict alpha, - dcomplex* restrict a10, - dcomplex* restrict a11, - dcomplex* restrict b01, - dcomplex* restrict b11, - dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - const num_t dt = BLIS_DCOMPLEX; - - const inc_t packnr = bli_cntx_get_blksz_max_dt( dt, BLIS_NR, cntx ); - - const inc_t rs_b = packnr; - const inc_t cs_b = 1; - - dcomplex* restrict minus_one = bli_zm1; - - - bli_zgemm_opt_mxn( k, - minus_one, - a10, - b01, - alpha, - b11, rs_b, cs_b, - data ); - - bli_ztrsm_l_opt_mxn( a11, - b11, - c11, rs_c, cs_c, - data ); -} - diff --git a/frame/3/old/bli_gemmtrsm_u_ukr_ref.c b/config/template/kernels/3/bli_gemmtrsm_l_template_noopt_mxn.c similarity index 52% rename from frame/3/old/bli_gemmtrsm_u_ukr_ref.c rename to config/template/kernels/3/bli_gemmtrsm_l_template_noopt_mxn.c index 0f7921410..ae648a2da 100644 --- a/frame/3/old/bli_gemmtrsm_u_ukr_ref.c +++ b/config/template/kernels/3/bli_gemmtrsm_l_template_noopt_mxn.c @@ -35,41 +35,73 @@ #include "blis.h" -#undef GENTFUNC -#define GENTFUNC( ctype, ch, varname, gemmukr, trsmukr ) \ -\ -void PASTEMAC(ch,varname)( \ - dim_t k, \ - ctype* restrict alpha, \ - ctype* restrict a12, \ - ctype* restrict a11, \ - ctype* restrict b21, \ - ctype* restrict b11, \ - ctype* restrict c11, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data \ - ) \ -{ \ - const inc_t rs_b = PASTEMAC(ch,packnr); \ - const inc_t cs_b = 1; \ -\ - ctype* restrict minus_one = PASTEMAC(ch,m1); \ -\ - /* b11 = alpha * b11 - a12 * b21; */ \ - PASTEMAC(ch,gemmukr)( k, \ - minus_one, \ - a12, \ - b21, \ - alpha, \ - b11, rs_b, cs_b, \ - data ); \ -\ +void bli_zgemmtrsm_l_template_noopt + ( + dim_t k, + dcomplex* restrict alpha, + dcomplex* restrict a10, + dcomplex* restrict a11, + dcomplex* restrict b01, + dcomplex* restrict b11, + dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, + auxinfo_t* restrict data, + cntx_t* restrict cntx + ) +{ +/* + Template gemmtrsm_l micro-kernel implementation + + This function contains a template implementation for a double-precision + complex micro-kernel that fuses a gemm with a trsm_l subproblem. + + This micro-kernel performs the following compound operation: + + B11 := alpha * B11 - A10 * B01 (gemm) + B11 := inv(A11) * B11 (trsm) + C11 := B11 + + where A11 is MR x MR and lower triangular, A10 is MR x k, B01 is k x NR, + B11 is MR x NR, and alpha is a scalar. Here, inv() denotes matrix + inverse. + + For more info, please refer to the BLIS website's wiki on kernels: + + https://github.com/flame/blis/wiki/KernelsHowTo + + and/or contact the blis-devel mailing list. + + -FGVZ +*/ + const num_t dt = BLIS_DCOMPLEX; + + const inc_t packnr = bli_cntx_get_blksz_max_dt( dt, BLIS_NR, cntx ); + + const inc_t rs_b = packnr; + const inc_t cs_b = 1; + + dcomplex* restrict minus_one = bli_zm1; + + /* b11 = alpha * b11 - a10 * b01; */ + bli_zgemm_template_noopt + ( + k, + minus_one, + a10, + b01, + alpha, + b11, rs_b, cs_b, + data + ); + /* b11 = inv(a11) * b11; - c11 = b11; */ \ - PASTEMAC(ch,trsmukr)( a11, \ - b11, \ - c11, rs_c, cs_c, \ - data ); \ + c11 = b11; */ + bli_ztrsm_l_template_noopt + ( + a11, + b11, + c11, rs_c, cs_c, + data + ); } -INSERT_GENTFUNC_BASIC2( gemmtrsm_u_ukr_ref, GEMM_UKERNEL, TRSM_U_UKERNEL ) diff --git a/config/template/kernels/3/bli_gemmtrsm_u_opt_mxn.c b/config/template/kernels/3/bli_gemmtrsm_u_opt_mxn.c deleted file mode 100644 index b0fd27b1e..000000000 --- a/config/template/kernels/3/bli_gemmtrsm_u_opt_mxn.c +++ /dev/null @@ -1,218 +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. - -*/ - -#include "blis.h" - - - -void bli_sgemmtrsm_u_opt_mxn - ( - dim_t k, - float* restrict alpha, - float* restrict a10, - float* restrict a11, - float* restrict b01, - float* restrict b11, - float* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - const num_t dt = BLIS_FLOAT; - - const inc_t packnr = bli_cntx_get_blksz_max_dt( dt, BLIS_NR, cntx ); - - const inc_t rs_b = packnr; - const inc_t cs_b = 1; - - float* restrict minus_one = bli_sm1; - - - bli_sgemm_opt_mxn( k, - minus_one, - a12, - b21, - alpha, - b11, rs_b, cs_b, - data ); - - bli_strsm_u_opt_mxn( a11, - b11, - c11, rs_c, cs_c, - data ); -} - - - -void bli_dgemmtrsm_u_opt_mxn - ( - dim_t k, - double* restrict alpha, - double* restrict a10, - double* restrict a11, - double* restrict b01, - double* restrict b11, - double* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -/* - Template gemmtrsm_u micro-kernel implementation - - This function contains a template implementation for a double-precision - real micro-kernel that fuses a gemm with a trsm_u subproblem. - - This micro-kernel performs the following compound operation: - - B11 := alpha * B11 - A12 * B21 (gemm) - B11 := inv(A11) * B11 (trsm) - C11 := B11 - - where A11 is MR x MR and upper triangular, A12 is MR x k, B21 is k x NR, - B11 is MR x NR, and alpha is a scalar. Here, inv() denotes matrix - inverse. - - For more info, please refer to the BLIS website's wiki on kernels: - - https://github.com/flame/blis/wiki/KernelsHowTo - - and/or contact the blis-devel mailing list. - - -FGVZ -*/ - const num_t dt = BLIS_DOUBLE; - - const inc_t packnr = bli_cntx_get_blksz_max_dt( dt, BLIS_NR, cntx ); - - const inc_t rs_b = packnr; - const inc_t cs_b = 1; - - double* restrict minus_one = bli_dm1; - - /* b11 = alpha * b11 - a12 * b21; */ - bli_dgemm_opt_mxn( k, - minus_one, - a12, - b21, - alpha, - b11, rs_b, cs_b, - data ); - - /* b11 = inv(a11) * b11; - c11 = b11; */ - bli_dtrsm_u_opt_mxn( a11, - b11, - c11, rs_c, cs_c, - data ); -} - - - -void bli_cgemmtrsm_u_opt_mxn - ( - dim_t k, - scomplex* restrict alpha, - scomplex* restrict a10, - scomplex* restrict a11, - scomplex* restrict b01, - scomplex* restrict b11, - scomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - const num_t dt = BLIS_SCOMPLEX; - - const inc_t packnr = bli_cntx_get_blksz_max_dt( dt, BLIS_NR, cntx ); - - const inc_t rs_b = packnr; - const inc_t cs_b = 1; - - scomplex* restrict minus_one = bli_cm1; - - - bli_cgemm_opt_mxn( k, - minus_one, - a12, - b21, - alpha, - b11, rs_b, cs_b, - data ); - - bli_ctrsm_u_opt_mxn( a11, - b11, - c11, rs_c, cs_c, - data ); -} - - - -void bli_zgemmtrsm_u_opt_mxn - ( - dim_t k, - dcomplex* restrict alpha, - dcomplex* restrict a10, - dcomplex* restrict a11, - dcomplex* restrict b01, - dcomplex* restrict b11, - dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - const num_t dt = BLIS_DCOMPLEX; - - const inc_t packnr = bli_cntx_get_blksz_max_dt( dt, BLIS_NR, cntx ); - - const inc_t rs_b = packnr; - const inc_t cs_b = 1; - - dcomplex* restrict minus_one = bli_zm1; - - - bli_zgemm_opt_mxn( k, - minus_one, - a12, - b21, - alpha, - b11, rs_b, cs_b, - data ); - - bli_ztrsm_u_opt_mxn( a11, - b11, - c11, rs_c, cs_c, - data ); -} - diff --git a/frame/3/old/bli_gemmtrsm_l_ukr_ref.c b/config/template/kernels/3/bli_gemmtrsm_u_template_noopt_mxn.c similarity index 52% rename from frame/3/old/bli_gemmtrsm_l_ukr_ref.c rename to config/template/kernels/3/bli_gemmtrsm_u_template_noopt_mxn.c index 37f0aa3cd..a2055c7ff 100644 --- a/frame/3/old/bli_gemmtrsm_l_ukr_ref.c +++ b/config/template/kernels/3/bli_gemmtrsm_u_template_noopt_mxn.c @@ -35,48 +35,72 @@ #include "blis.h" -#undef GENTFUNC -#define GENTFUNC( ctype, ch, varname, gemmukr, trsmukr ) \ -\ -void PASTEMAC(ch,varname)( \ - dim_t k, \ - ctype* restrict alpha, \ - ctype* restrict a10, \ - ctype* restrict a11, \ - ctype* restrict b01, \ - ctype* restrict b11, \ - ctype* restrict c11, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data \ - ) \ -{ \ - const inc_t rs_b = PASTEMAC(ch,packnr); \ - const inc_t cs_b = 1; \ -\ - ctype* restrict minus_one = PASTEMAC(ch,m1); \ -\ - /* b11 = alpha * b11 - a10 * b01; */ \ - PASTEMAC(ch,gemmukr)( k, \ - minus_one, \ - a10, \ - b01, \ - alpha, \ - b11, rs_b, cs_b, \ - data ); \ -\ - /* b11 = inv(a11) * b11; - c11 = b11; */ \ - PASTEMAC(ch,trsmukr)( a11, \ - b11, \ - c11, rs_c, cs_c, \ - data ); \ -\ +void bli_zgemmtrsm_u_template_noopt + ( + dim_t k, + dcomplex* restrict alpha, + dcomplex* restrict a10, + dcomplex* restrict a11, + dcomplex* restrict b01, + dcomplex* restrict b11, + dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, + auxinfo_t* restrict data, + cntx_t* restrict cntx + ) +{ /* -PASTEMAC(d,fprintm)( stdout, "gemmtrsm_l_ukr: b0111p_r after", k+3, 8, \ - ( double* )b01, 2*PASTEMAC(ch,packnr), 2, "%4.1f", "" ); \ -PASTEMAC(d,fprintm)( stdout, "gemmtrsm_l_ukr: b0111p_i after", k+3, 8, \ - ( double* )b01 + 1, 2*PASTEMAC(ch,packnr), 2, "%4.1f", "" ); \ -*/ \ + Template gemmtrsm_u micro-kernel implementation + + This function contains a template implementation for a double-precision + complex micro-kernel that fuses a gemm with a trsm_u subproblem. + + This micro-kernel performs the following compound operation: + + B11 := alpha * B11 - A12 * B21 (gemm) + B11 := inv(A11) * B11 (trsm) + C11 := B11 + + where A11 is MR x MR and upper triangular, A12 is MR x k, B21 is k x NR, + B11 is MR x NR, and alpha is a scalar. Here, inv() denotes matrix + inverse. + + For more info, please refer to the BLIS website's wiki on kernels: + + https://github.com/flame/blis/wiki/KernelsHowTo + + and/or contact the blis-devel mailing list. + + -FGVZ +*/ + const num_t dt = BLIS_DCOMPLEX; + + const inc_t packnr = bli_cntx_get_blksz_max_dt( dt, BLIS_NR, cntx ); + + const inc_t rs_b = packnr; + const inc_t cs_b = 1; + + dcomplex* restrict minus_one = bli_zm1; + + /* b11 = alpha * b11 - a12 * b21; */ + bli_zgemm_template_noopt + ( + k, + minus_one, + a12, + b21, + alpha, + b11, rs_b, cs_b, + data + ); + + /* b11 = inv(a11) * b11; + c11 = b11; */ + bli_ztrsm_u_template_noopt + ( + a11, + b11, + c11, rs_c, cs_c, + data + ); } -INSERT_GENTFUNC_BASIC2( gemmtrsm_l_ukr_ref, GEMM_UKERNEL, TRSM_L_UKERNEL ) - diff --git a/config/template/kernels/3/bli_trsm_l_opt_mxn.c b/config/template/kernels/3/bli_trsm_l_template_noopt_mxn.c similarity index 70% rename from config/template/kernels/3/bli_trsm_l_opt_mxn.c rename to config/template/kernels/3/bli_trsm_l_template_noopt_mxn.c index d9513f1fe..a698c42ef 100644 --- a/config/template/kernels/3/bli_trsm_l_opt_mxn.c +++ b/config/template/kernels/3/bli_trsm_l_template_noopt_mxn.c @@ -35,34 +35,11 @@ #include "blis.h" - -void bli_strsm_l_opt_mxn +void bli_ztrsm_l_template_noopt ( - float* restrict a11, - float* restrict b11, - float* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_STRSM_L_UKERNEL_REF - ( - a11, - b11, - c11, rs_c, cs_c, - data, - cntx - ); -} - - - -void bli_dtrsm_l_opt_mxn - ( - double* restrict a11, - double* restrict b11, - double* restrict c11, inc_t rs_c, inc_t cs_c, + dcomplex* restrict a11, + dcomplex* restrict b11, + dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, auxinfo_t* restrict data, cntx_t* restrict cntx ) @@ -71,9 +48,9 @@ void bli_dtrsm_l_opt_mxn Template trsm_l micro-kernel implementation This function contains a template implementation for a double-precision - real trsm micro-kernel, coded in C, which can serve as the starting point + complex trsm micro-kernel, coded in C, which can serve as the starting point for one to write an optimized micro-kernel on an arbitrary architecture. - (We show a template implementation for only double-precision real because + (We show a template implementation for only double-precision complex because the templates for the other three floating-point types would be nearly identical.) @@ -110,16 +87,16 @@ void bli_dtrsm_l_opt_mxn dim_t iter, i, j, l; dim_t n_behind; - double* restrict alpha11; - double* restrict a10t; - double* restrict alpha10; - double* restrict X0; - double* restrict x1; - double* restrict x01; - double* restrict chi01; - double* restrict chi11; - double* restrict gamma11; - double rho11; + dcomplex* restrict alpha11; + dcomplex* restrict a10t; + dcomplex* restrict alpha10; + dcomplex* restrict X0; + dcomplex* restrict x1; + dcomplex* restrict x01; + dcomplex* restrict chi01; + dcomplex* restrict chi11; + dcomplex* restrict gamma11; + dcomplex rho11; for ( iter = 0; iter < m; ++iter ) { @@ -139,70 +116,26 @@ void bli_dtrsm_l_opt_mxn gamma11 = c11 + (i )*rs_c + (j )*cs_c; /* chi11 = chi11 - a10t * x01; */ - bli_dset0s( rho11 ); + bli_zset0s( rho11 ); for ( l = 0; l < n_behind; ++l ) { alpha10 = a10t + (l )*cs_a; chi01 = x01 + (l )*rs_b; - bli_daxpys( *alpha10, *chi01, rho11 ); + bli_zaxpys( *alpha10, *chi01, rho11 ); } - bli_dsubs( rho11, *chi11 ); + bli_zsubs( rho11, *chi11 ); /* chi11 = chi11 / alpha11; */ /* NOTE: The INVERSE of alpha11 (1.0/alpha11) is stored instead of alpha11, so we can multiply rather than divide. We store the inverse of alpha11 intentionally to avoid expensive division instructions within the micro-kernel. */ - bli_dscals( *alpha11, *chi11 ); + bli_zscals( *alpha11, *chi11 ); /* Output final result to matrix C. */ - bli_dcopys( *chi11, *gamma11 ); + bli_zcopys( *chi11, *gamma11 ); } } } - - -void bli_ctrsm_l_opt_mxn - ( - scomplex* restrict a11, - scomplex* restrict b11, - scomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_CTRSM_L_UKERNEL_REF - ( - a11, - b11, - c11, rs_c, cs_c, - data, - cntx - ); -} - - - -void bli_ztrsm_l_opt_mxn - ( - dcomplex* restrict a11, - dcomplex* restrict b11, - dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_ZTRSM_L_UKERNEL_REF - ( - a11, - b11, - c11, rs_c, cs_c, - data, - cntx - ); -} - diff --git a/config/template/kernels/3/bli_trsm_u_opt_mxn.c b/config/template/kernels/3/bli_trsm_u_template_noopt_mxn.c similarity index 67% rename from config/template/kernels/3/bli_trsm_u_opt_mxn.c rename to config/template/kernels/3/bli_trsm_u_template_noopt_mxn.c index ce68db673..ffeeb841f 100644 --- a/config/template/kernels/3/bli_trsm_u_opt_mxn.c +++ b/config/template/kernels/3/bli_trsm_u_template_noopt_mxn.c @@ -35,39 +35,11 @@ #include "blis.h" - -void bli_strsm_u_opt_mxn +void bli_ztrsm_u_template_noopt ( - float* restrict a11, - float* restrict b11, - float* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_STRSM_U_UKERNEL_REF - ( - a11, - b11, - c11, rs_c, cs_c, - data, - cntx - ); -} - - - -void bli_dtrsm_u_opt_mxn( - double* restrict a11, - double* restrict b11, - double* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* data - ) - ( - double* restrict a11, - double* restrict b11, - double* restrict c11, inc_t rs_c, inc_t cs_c, + dcomplex* restrict a11, + dcomplex* restrict b11, + dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, auxinfo_t* restrict data, cntx_t* restrict cntx ) @@ -76,9 +48,9 @@ void bli_dtrsm_u_opt_mxn( Template trsm_u micro-kernel implementation This function contains a template implementation for a double-precision - real trsm micro-kernel, coded in C, which can serve as the starting point + complex trsm micro-kernel, coded in C, which can serve as the starting point for one to write an optimized micro-kernel on an arbitrary architecture. - (We show a template implementation for only double-precision real because + (We show a template implementation for only double-precision complex because the templates for the other three floating-point types would be nearly identical.) @@ -115,16 +87,16 @@ void bli_dtrsm_u_opt_mxn( dim_t iter, i, j, l; dim_t n_behind; - double* restrict alpha11; - double* restrict a12t; - double* restrict alpha12; - double* restrict X2; - double* restrict x1; - double* restrict x21; - double* restrict chi21; - double* restrict chi11; - double* restrict gamma11; - double rho11; + dcomplex* restrict alpha11; + dcomplex* restrict a12t; + dcomplex* restrict alpha12; + dcomplex* restrict X2; + dcomplex* restrict x1; + dcomplex* restrict x21; + dcomplex* restrict chi21; + dcomplex* restrict chi11; + dcomplex* restrict gamma11; + dcomplex rho11; for ( iter = 0; iter < m; ++iter ) { @@ -144,70 +116,26 @@ void bli_dtrsm_u_opt_mxn( gamma11 = c11 + (i )*rs_c + (j )*cs_c; /* chi11 = chi11 - a12t * x21; */ - bli_dset0s( rho11 ); + bli_zset0s( rho11 ); for ( l = 0; l < n_behind; ++l ) { alpha12 = a12t + (l )*cs_a; chi21 = x21 + (l )*rs_b; - bli_daxpys( *alpha12, *chi21, rho11 ); + bli_zaxpys( *alpha12, *chi21, rho11 ); } - bli_dsubs( rho11, *chi11 ); + bli_zsubs( rho11, *chi11 ); /* chi11 = chi11 / alpha11; */ /* NOTE: The INVERSE of alpha11 (1.0/alpha11) is stored instead of alpha11, so we can multiply rather than divide. We store the inverse of alpha11 intentionally to avoid expensive division instructions within the micro-kernel. */ - bli_dscals( *alpha11, *chi11 ); + bli_zscals( *alpha11, *chi11 ); /* Output final result to matrix C. */ - bli_dcopys( *chi11, *gamma11 ); + bli_zcopys( *chi11, *gamma11 ); } } } - - -void bli_ctrsm_u_opt_mxn - ( - scomplex* restrict a11, - scomplex* restrict b11, - scomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_CTRSM_U_UKERNEL_REF - ( - a11, - b11, - c11, rs_c, cs_c, - data, - cntx - ); -} - - - -void bli_ztrsm_u_opt_mxn - ( - dcomplex* restrict a11, - dcomplex* restrict b11, - dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ - /* Just call the reference implementation. */ - BLIS_ZTRSM_U_UKERNEL_REF - ( - a11, - b11, - c11, rs_c, cs_c, - data, - cntx - ); -} - diff --git a/config/template/make_defs.mk b/config/template/make_defs.mk index e563d9308..7b1521608 100644 --- a/config/template/make_defs.mk +++ b/config/template/make_defs.mk @@ -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 := template +#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 CPICFLAGS := -fPIC -CWARNFLAGS := -Wall +CWARNFLAGS := -Wall -Wno-unused-function -Wfatal-errors ifneq ($(DEBUG_TYPE),off) CDBGFLAGS := -g @@ -67,21 +64,9 @@ else COPTFLAGS := -O2 endif -CVECFLAGS := #-msse3 -march=core2 # -mfpmath=sse CKOPTFLAGS := $(COPTFLAGS) -# --- 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 diff --git a/config/x86_64/bli_family_x86_64.h b/config/x86_64/bli_family_x86_64.h new file mode 100644 index 000000000..0cc9e94b7 --- /dev/null +++ b/config/x86_64/bli_family_x86_64.h @@ -0,0 +1,41 @@ +/* + + 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 + + + +//#endif + diff --git a/config/x86_64/make_defs.mk b/config/x86_64/make_defs.mk new file mode 100644 index 000000000..c79aa05d6 --- /dev/null +++ b/config/x86_64/make_defs.mk @@ -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 := x86_64 +#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 := -xSSE3 +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))) + diff --git a/config/zen/bli_cntx_init_zen.c b/config/zen/bli_cntx_init_zen.c new file mode 100644 index 000000000..8e5c67655 --- /dev/null +++ b/config/zen/bli_cntx_init_zen.c @@ -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_zen( cntx_t* cntx ) +{ + blksz_t blkszs[ BLIS_NUM_BLKSZS ]; + + // Set default kernel blocksizes and functions. + bli_cntx_init_zen_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 + ); +} + diff --git a/config/zen/bli_family_zen.h b/config/zen/bli_family_zen.h new file mode 100644 index 000000000..3894c4dc3 --- /dev/null +++ b/config/zen/bli_family_zen.h @@ -0,0 +1,42 @@ +/* + + 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 + + + + +//#endif + diff --git a/config/zen/make_defs.mk b/config/zen/make_defs.mk new file mode 100644 index 000000000..08b37348f --- /dev/null +++ b/config/zen/make_defs.mk @@ -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 := zen +#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 := -mavx2 -mfpmath=sse -mfma -march=bdver4 +else +ifeq ($(CC_VENDOR),clang) +CVECFLAGS := -mavx2 -mfpmath=sse -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))) + diff --git a/config_registry b/config_registry new file mode 100644 index 000000000..780f39455 --- /dev/null +++ b/config_registry @@ -0,0 +1,35 @@ +# +# config_registry +# +# Please refer to the BLIS wiki on configurations for information on the +# syntax and semantics of this file [1]. +# +# [1] https://github.com/flame/blis/wiki/ConfigurationHowTo +# + +# Processor families. +intel64: haswell sandybridge penryn generic +amd64: zen excavator steamroller piledriver bulldozer generic +arm32: cortexa9 cortexa15 generic +x86_64: haswell sandybridge penryn zen excavator steamroller piledriver bulldozer generic + +# Intel architectures. +haswell: haswell +sandybridge: sandybridge +penryn: penryn +knl: knl + +# AMD architectures. +zen: zen/haswell +excavator: excavator/piledriver +steamroller: steamroller/piledriver +piledriver: piledriver +bulldozer: bulldozer + +# ARM architectures. +cortexa9: cortexa9/armv7a +cortexa15: cortexa15/armv7a +cortexa57: cortexa57/armv8a + +# Generic architectures. +generic: generic diff --git a/configure b/configure index 9edfaa98b..01fd149a7 100755 --- a/configure +++ b/configure @@ -32,6 +32,10 @@ # # +# +# -- Helper functions ---------------------------------------------------------- +# + print_usage() { # Echo usage info. @@ -54,8 +58,8 @@ print_usage() echo " confname The name of the sub-directory inside of the 'config'" echo " directory containing the desired BLIS configuration." echo " Note that confname MUST be specified; if it is not," - echo " configure will complain. To build a reference" - echo " implementation, use the 'reference' configuration" + echo " configure will complain. To build a completely generic" + echo " implementation, use the 'generic' configuration" echo " " echo " Options:" echo " " @@ -129,6 +133,14 @@ print_usage() echo " STRING. This option may be useful when repackaging" echo " custom versions of BLIS by outside organizations." echo " " + echo " -c, --show-config-lists" + echo " " + echo " Print the config and kernel lists, and kernel-to-config" + echo " map after they are read from file. This can be useful" + echo " when debugging certain configuration issues, and/or as" + echo " a sanity check to make sure these lists are constituted" + echo " as expected." + echo " " echo " -h, --help Output this information and quit." echo " " echo " Environment Variables:" @@ -148,8 +160,247 @@ print_usage() exit 1 } +query_array() +{ + array_name=$1 + key_name=$2 + + var_name="${array_name}_${key_name}" + + echo "${!var_name}" +} + +read_registry_file() +{ + local cname clist + + filename="$1" + while read -r line + do + curline="${line}" + + #echo "curline: ${curline}" + + # Remove leading whitespace from the current line. + # NOTE: read -r already prunes leading whitespace + #curline=$(echo "${curline}" | sed "s/^[ \t]*//") + + # Remove everything after comment character '#'. + curline=${curline%%#*} + + # We've stripped out leading whitespace and trailing comments. If + # the line is now empty, then we can skip it altogether. + if [ "x${curline}" = "x" ]; then + continue; + fi + + # Read the config name and config list for the current line. + cname=${curline%%:*} + list=${curline##*:} + + # If we encounter a slash, it means the name of the configuration + # and the kernel set needed by that configuration are different. + if [[ ${list} == *[/]* ]]; then + + #echo "Slash found." + klist="" + clist="" + for item in "${list}"; do + + # The sub-configuration name is always the first sub-word in + # the slash-separated compound word. + config=${item%%/*} + + # Delete the sub-configuration name from the front of the + # string, leaving the slash-separated kernel names (or just + # the kernel name, if there is only one). + kernels=${list#*/} + + # Replace the slashes with spaces to transform the string + # into a space-separated list of kernel names. + kernels=$(echo -e ${kernels} | sed -e "s/\// /g") + + clist="${clist} ${config}" + klist="${klist} ${kernels}" + done + else + #echo "Slash not found." + clist=${list} + klist=${list} + fi + + # Strip out whitespace from the config name and config/kernel list + # on each line. + cname=$(canonicalize_ws "${cname}") + clist=$(canonicalize_ws "${clist}") + klist=$(canonicalize_ws "${klist}") + + # Store the config and kernel lists to the entry in the associative + # arrays that corresponds to the config name. + #config_registry[${cname}]=${clist} + #kernel_registry[${cname}]=${klist} + printf -v "config_registry_${cname}" %s "${clist}" + printf -v "kernel_registry_${cname}" %s "${klist}" + + + done < "${filename}" + + # Now go back through the kernel registry and substitute any remaining + # configuration names occurring in the kernel list (right side of ':') + # with its registered kernel set. + #for config in "${!kernel_registry[@]}"; do + for kr_var in ${!kernel_registry_*}; do + + config=${kr_var##kernel_registry_} + + #for ker in ${kernel_registry[$config]}; do + for ker in ${!kr_var}; do + + #kers_ker="${kernel_registry[${ker}]}" + kers_ker=$(query_array "kernel_registry" ${ker}) + + # If kers_ker is empty string, then ker was not found as a key + # in the kernel list associative array. In that case, we continue + # and will echo an error later in the script. + if [ "${kers_ker}" == "" ]; then + #echo " kernel for ${ker} is empty string! no entry in kernel list." + continue; + fi + + # If the current config/kernel (ker) differs from its singleton kernel + # entry (kers_ker), then that singleton entry was specified to use + # a different configuration's kernel set. Thus, we need to replace the + # occurrence in the current config/kernel name with that of the kernel + # set it needs. + if [ "${ker}" != "${kers_ker}" ]; then + + #klist="${kernel_registry[$config]}" + klist=$(query_array "kernel_registry" ${config}) + + # Replace the current config with its requisite kernels, + # canonicalize whitespace, and then remove duplicate kernel + # set names, if they exist. Finally, update the kernel registry + # with the new kernel list. + newklist=$(echo -e "${klist}" | sed -e "s/${ker}/${kers_ker}/g") + newklist=$(canonicalize_ws "${newklist}") + newklist=$(rm_duplicate_words "${newklist}") + + #kernel_registry[${config}]=${newklist} + printf -v "kernel_registry_${config}" %s "${newklist}" + fi + + done + + done +} + +build_kconfig_registry() +{ + familyname="$1" + + #clist="${config_registry[${familyname}]}" + clist=$(query_array "config_registry" ${familyname}) + + for config in ${clist}; do + + #echo "${config}" + + # Look up the kernel for the current sub-configuration. + #kernels="${kernel_registry[${config}]}" + kernels=$(query_array "kernel_registry" ${config}) + + for kernel in ${kernels}; do + + #echo " ${kernel}" + + # Add the sub-configuration to the list associated with the + # kernel. + + # Query the current sub-configs for the current ${kernel}. + #cur_configs="${kconfig_registry[${kernel}]}" + cur_configs=$(query_array "kconfig_registry" ${kernel}) + + # Add the current sub-configuration to the list of sub-configs + # we just queried. + newvalue=$(canonicalize_ws "${cur_configs} ${config}") + + # Update the array. + #kconfig_registry[${kernel}]="${newvalue}" + printf -v "kconfig_registry_${kernel}" %s "${newvalue}" + + done + + done +} + +is_word_in_list() +{ + word="$1" + list="$2" + rval="false" + + for item in ${list}; do + + if [ "${item}" == "${word}" ]; then + rval="true" + break + fi + done + + echo "${rval}" +} + +is_singleton() +{ + list="$1" + rval="false" + + count_str="" + for item in ${list}; do + + count_str="${count_str}x" + done + + if [ ${count_str} == "x" ]; then + rval="true" + fi + + echo "${rval}" +} + +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}" +} + +rm_duplicate_words() +{ + str="$1" + + str=$(echo "${str}" | awk '{for (i=1;i<=NF;i++) if (!a[$i]++) printf("%s%s",$i,FS)}{printf("\n")}') + + echo "${str}" +} + +# +# -- main function ------------------------------------------------------------- +# + main() { + #declare -A config_registry + #declare -A kernel_registry + #declare -A kconfig_registry + # The name of the script, stripped of any preceeding path. script_name=${0##*/} @@ -172,6 +423,10 @@ main() build_dir='build' build_dirpath="${dist_path}/${build_dir}" + # The name/path to the registry (master list) of supported configurations. + registry_file="config_registry" + registry_filepath=${dist_path}/${registry_file} + # The names/paths for the template config.mk.in and its instantiated # counterpart. config_mk_in='config.mk.in' @@ -196,14 +451,22 @@ main() gen_make_frags_dirpath="${build_dirpath}/gen-make-frags" gen_make_frags_sh="${gen_make_frags_dirpath}/gen-make-frag.sh" - # The root directory of the BLIS framework. - frame_dir='frame' - frame_dirpath="${dist_path}/${frame_dir}" - # The name of the (top-level) configuration directory. config_dir='config' config_dirpath="${dist_path}/${config_dir}" + # The name of the (top-level) kernels directory. + kernels_dir='kernels' + kernels_dirpath="${dist_path}/${kernels_dir}" + + # The name of the (top-level) reference kernels directory. + refkern_dir='ref_kernels' + refkern_dirpath="${dist_path}/${refkern_dir}" + + # The root directory of the BLIS framework. + frame_dir='frame' + frame_dirpath="${dist_path}/${frame_dir}" + # The name of the directory in which object files will be kept. obj_dir='obj' obj_dirpath="${cur_dirpath}/${obj_dir}" @@ -212,6 +475,10 @@ main() lib_dir='lib' lib_dirpath="${cur_dirpath}/${lib_dir}" + # The name of the directory in which headers will be kept. + include_dir='include' + include_dirpath="${cur_dirpath}/${include_dir}" + # The name of the directory in which the test suite is kept. testsuite_dir='testsuite' @@ -229,6 +496,7 @@ main() # Option variables. quiet_flag='' + show_config_list='' # Additional flags. enable_verbose='no' @@ -243,19 +511,29 @@ main() # The path to the auto-detection script. auto_detect_sh="${build_dirpath}/auto-detect/auto-detect.sh" - # The name of the reference configuration sub-directory. - config_name_ref='reference' - - # The name of the chosen configuration sub-directory. + # The name of the chosen configuration (the configuration "family"). config_name='' + # The list of sub-configurations associated with config_name. + config_list='' + + # The list of kernel sets that will be needed by the sub-configurations + # in config_list.. + kernel_list='' + + # The list of kernel:sub-configuration pairs for all kernels contained + # in kernel_list. + kconfig_map='' + # Dummy file. Used to check whether the cwd is the same as the top-level # source distribution directory. dummy_file='_blis_dir_detect.tmp' + # -- Command line option/argument parsing ---------------------------------- + # Process our command line options. - while getopts ":hp:d:t:qi:b:-:" opt; do + while getopts ":hp:d:t:qci:b:-:" opt; do case $opt in -) case "$OPTARG" in @@ -325,6 +603,9 @@ main() force-version=*) force_version=${OPTARG#*=} ;; + show-config-list) + show_config_list=1 + ;; *) print_usage ;; @@ -352,6 +633,9 @@ main() b) blas2blis_int_type_size=$OPTARG ;; + c) + show_config_list=1 + ;; \?) print_usage ;; @@ -359,7 +643,6 @@ main() done shift $(($OPTIND - 1)) - # Parse environment variables while [ $# -gt 0 ]; do case $1 in @@ -377,18 +660,35 @@ main() done + # -- Read the configuration registry --------------------------------------- + + # Make sure the config registry file exists and can be opened. + if [ ! -f "${registry_filepath}" ]; then + + echo "${script_name}: could not open '${registry_file}' file; cannot continue." + echo "${script_name}: BLIS distribution appears to be incomplete." + + exit 1 + fi + + # Read the registered configuration names and lists into an associative + # array. + echo -n "${script_name}: reading configuration registry..." + read_registry_file ${registry_filepath} + echo "done." + + + # -- Acquire the BLIS version ---------------------------------------------- + # Check whether we need to update the version file. ${update_version_file_sh} -o "${script_name}" "${version_filepath}" - # Query which version of BLIS this is. version=$(cat ${version_filepath}) - # Initial message. echo "${script_name}: starting configuration of BLIS ${version}." - # Check if the user requested a custom version string. if [ "x${force_version}" = "xno" ]; then echo "${script_name}: configuring with official version string." @@ -398,11 +698,13 @@ main() fi + # -- Various pre-configuration checks -------------------------------------- + # Set config_name based on the number of arguments leftover (after command # line option processing). if [ $# = "0" ]; then - configs_avail="auto "$(ls ${config_dirpath}) + #configs_avail="auto "$(ls ${config_dirpath}) echo "${script_name}: " echo "${script_name}: *** No configuration given! ***" @@ -410,58 +712,244 @@ main() echo "${script_name}: Default configuration behavior is not implemented (for your" echo "${script_name}: own safety). Please re-run '${script_name}' and specify one" echo "${script_name}: of the existing configurations in the source distribution's" - echo "${script_name} '${config_dir}' directory:" + echo "${script_name} '${registry_file}' file:" echo "${script_name}: " - for conf in ${configs_avail}; do - echo "${script_name}: ${conf}" + #for k in "${!config_registry[@]}"; do + for cr_var in ${!config_registry_*}; do + + #v=${config_registry[$k]} + k=${cr_var##config_registry_}; v=${!cr_var} + + echo "${script_name}: $k (${v})" done echo "${script_name}: " - echo "${script_name}: or, alternatively, first create a new configuration (placing" - echo "${script_name}: it in the '${config_dir}' directory) and then run '${script_name}' with" - echo "${script_name}: that configuration. To build a reference implementation of" - echo "${script_name}: BLIS, use the '${config_name_ref}' configuration:" - echo "${script_name}: " - echo "${script_name}: ./${script_name} ${config_name_ref}" - echo "${script_name}: " - echo "${script_name}: For a full description of how to run ${script_name}, please refer" - echo "${script_name}: to the output of:" - echo "${script_name}: " - echo "${script_name}: ./${script_name} -h" - echo "${script_name}: " exit 1 - elif [ $# = "1" ]; then + elif [ $# != "1" ]; then # more than one configuration argument given. + print_usage + + fi + + if [ $1 = "auto" ]; then + + echo "${script_name}: automatic configuration requested." + + # Run the auto-detect script and save the result in config_name. + config_name=`${build_dirpath}/auto-detect/auto-detect.sh` + + echo "${script_name}: auto-detect script returned '${config_name}'." + + else + + # Use the command line argument as the configuration name. + config_name=$1 + + #echo "${script_name}: manual configuration requested." + echo "${script_name}: manual configuration requested; configuring with '${config_name}'." + + fi + + # Use the selected config name to look up the list of configurations + # and kernels associated with that name. + #config_list=${config_registry[${config_name}]} + #kernel_list=${kernel_registry[${config_name}]} + config_list=$(query_array "config_registry" ${config_name}) + kernel_list=$(query_array "kernel_registry" ${config_name}) + + # Use the config_registry and kernel_registry to build a kconfig_registry + # for the selected config_name. + build_kconfig_registry "${config_name}" + + # Print the configuration list and kernel list, if requested. + if [ "${show_config_list}" == "1" ]; then + + echo "${script_name}: configuration list:" + #for k in "${!config_registry[@]}"; do + for cr_var in ${!config_registry_*}; do + + #v=${config_registry[$k]} + k=${cr_var##config_registry_}; v=${!cr_var} + + echo "${script_name}: $k: ${v}" + done + + echo "${script_name}: kernel list:" + #for k in "${!kernel_registry[@]}"; do + for kr_var in ${!kernel_registry_*}; do + + #v=${kernel_registry[$k]} + k=${kr_var##kernel_registry_}; v=${!kr_var} + + echo "${script_name}: $k: ${v}" + done + + echo "${script_name}: kernel-to-config map:" + #for k in "${!kconfig_registry[@]}"; do + for kc_var in ${!kconfig_registry_*}; do + + #v=${kconfig_registry[$k]} + k=${kc_var##kconfig_registry_}; v=${!kc_var} + + echo "${script_name}: $k: ${v}" + done + fi + + # For each kernel in the kernel list, reduce the list of associated + # sub-configurations (in the kconfig_registry) to a singleton using + # the following rules: + # 1. If the list is a singleton, use that name. + # 2. If the list contains a sub-configuration name that matches the + # kernel name, use that name. + # 3. Otherwise, use the first name in the list. + # We use the chosen singleton to ceate a "kernel:subconfig" pair, which + # we accumulate into a list. This list is the kernel-to-config map, or + # kconfig_map. + + # We use a sorted version of kernel_list so that it ends up matching the + # display order of the kconfig_registry above. + kernel_list_sort=$(echo ${kernel_list} | xargs -n1 | sort -u) + + kconfig_map="" + for kernel in ${kernel_list_sort}; do + + #configs="${kconfig_registry[$kernel]}" + configs=$(query_array "kconfig_registry" ${kernel}) + + has_one_kernel=$(is_singleton "${configs}") + contains_kernel=$(is_word_in_list "${kernel}" "${configs}") + + # Check if the list is a singleton. + if [ "${has_one_kernel}" == "true" ]; then + + reducedclist="${configs}" + + # Check if the list contains a sub-config name that matches the kernel. + elif [ "${contains_kernel}" == "true" ]; then + + reducedclist="${kernel}" + + # Otherwise, use the first name. + else + + first_config=${configs%% *} + reducedclist="${first_config}" + fi + + # Create a new "kernel:subconfig" pair and add it to the kconfig_map + # list, removing whitespace. + new_pair="${kernel}:${reducedclist}" + kconfig_map=$(canonicalize_ws "${kconfig_map} ${new_pair}") + done + + if [ "${show_config_list}" == "1" ]; then + + echo "${script_name}: kernel-to-config map (chosen pairs):" + for k in ${kconfig_map}; do + echo "${script_name}: $k" + done + fi + + + echo "${script_name}: checking configuration against contents of '${registry_file}'." + + # First, ensure that the config name is registered (ie: it is present + # in the config_registry file). + if [ -z "${config_list}" ]; then + + # NOTE: This branch should never execute when using the + # auto-detect script, but we have it here just in case. if [ $1 = "auto" ]; then - echo "${script_name}: automatic configuration requested." - config_name=`${build_dirpath}/auto-detect/auto-detect.sh` - #config_name=$(${auto_detect_sh}) + echo "${script_name}: 'auto-detected configuration '${conf}' is NOT registered!" + echo "${script_name}: " + echo "${script_name}: *** Cannot continue with unregistered configuration '${conf}'. ***" + echo "${script_name}: " + exit 1; else - echo "${script_name}: manual configuration requested." - config_name=$1 + echo "${script_name}: 'user-specified configuration '${conf}' is NOT registered!" + echo "${script_name}: " + echo "${script_name}: *** Cannot continue with unregistered configuration '${conf}'. ***" + echo "${script_name}: " + exit 1; - # Ensure configuration is valid. - if [ ! -d "${config_dirpath}/${config_name}" ]; then - echo "${script_name}: " - echo "${script_name}: *** configuration '${config_name}' does not exist. ***" - echo "${script_name}: " - exit 1; - fi fi - echo "${script_name}: configuring with '${config_name}' configuration sub-directory." else - print_usage + # This branch executes when the configuration is found to be present + # (i.e. registered) in the config_registry file. + + echo "${script_name}: configuration '${config_name}' is registered." + echo "${script_name}: '${config_name}' is defined as having the following sub-configurations:" + echo "${script_name}: ${config_list}" + echo "${script_name}: which collectively require the following kernels:" + echo "${script_name}: ${kernel_list}" + fi - # Build the config directory path. - configname_dirpath="${config_dirpath}/${config_name}" + echo "${script_name}: checking sub-configurations:" + + # Now, verify that the constituent configurations associated with the + # config name are all valid. + for conf in ${config_list}; do + + # First confirm that the current configuration is registered. + #this_clist=${config_registry[${conf}]} + this_clist=$(query_array "config_registry" ${conf}) + + # If the config_list associated with conf is empty, then it was + # never entered into the config_registry to begin with. Thus, + # conf must be unregistered. + if [ -z "${this_clist}" ]; then + echo "${script_name}: '${conf}' is NOT registered!" + echo "${script_name}: " + echo "${script_name}: *** Cannot continue with unregistered configuration '${conf}'. ***" + echo "${script_name}: " + exit 1; + else + echo -n "${script_name}: '${conf}' is registered." + fi + + # Then confirm that the current sub-configuration directory exists. + if [ ! -d "${config_dirpath}/${conf}" ]; then + echo "..but does NOT exist!" + echo "${script_name}: " + echo "${script_name}: *** Cannot continue with nonexistent configuration '${conf}'. ***" + echo "${script_name}: " + exit 1; + else + echo "..and exists." + fi + done + + + echo "${script_name}: checking sub-configurations' requisite kernels:" + + # Also, let's verify that the requisite kernel sets associated with + # the config name all correspond to directories that exist. + for kernel in ${kernel_list}; do + + echo -n "${script_name}: '${kernel}' kernels..." + + # Confirm that the current kernel sub-directory exists. + if [ ! -d "${kernels_dirpath}/${kernel}" ]; then + echo "do NOT exist!" + echo "${script_name}: " + echo "${script_name}: *** Cannot continue with nonexistent kernel '${kernel}'. ***" + echo "${script_name}: " + exit 1; + else + echo "exist." + fi + done + + + # -- Prepare variables for subsitution into template files ----------------- # Set the install prefix if it was not already set when parsing the install # prefix flag. @@ -472,7 +960,6 @@ main() echo "${script_name}: no install prefix given; defaulting to '${install_prefix}'." fi - # Check if the debug flag was specified. if [ -n "${debug_flag}" ]; then if [ "x${debug_type}" = "xopt" ]; then @@ -489,7 +976,6 @@ main() echo "${script_name}: debug symbols disabled." fi - # Check if the verbose make flag was specified. if [ "x${enable_verbose}" = "xyes" ]; then echo "${script_name}: enabling verbose make output, disable with 'make V=0'." @@ -497,7 +983,6 @@ main() echo "${script_name}: disabling verbose make output, enable with 'make V=1'." fi - # Check if the static lib flag was specified. if [ "x${enable_static}" = "xyes" ]; then echo "${script_name}: building BLIS as a static library." @@ -513,8 +998,7 @@ main() echo "Neither a shared nor static library build has been requested." exit 1 fi - - + # Check the threading model flag and standardize its value, if needed. # NOTE: 'omp' is deprecated but still supported; 'openmp' is preferred. enable_openmp='no' @@ -544,26 +1028,24 @@ main() exit 1 fi - # Convert 'yes' and 'no' flags to booleans. if [ "x${enable_cblas}" = "xyes" ]; then - echo "${script_name}: the CBLAS compatibility layer is enabled." - enable_cblas_01=1 - # Force BLAS layer when CBLAS is enabled - enable_blas2blis='yes' + echo "${script_name}: the CBLAS compatibility layer is enabled." + enable_cblas_01=1 + # Force BLAS layer when CBLAS is enabled + enable_blas2blis='yes' else - echo "${script_name}: the CBLAS compatibility layer is disabled." - enable_cblas_01=0 + echo "${script_name}: the CBLAS compatibility layer is disabled." + enable_cblas_01=0 fi if [ "x${enable_blas2blis}" = "xyes" ]; then - echo "${script_name}: the BLAS compatibility layer is enabled." - enable_blas2blis_01=1 + echo "${script_name}: the BLAS compatibility layer is enabled." + enable_blas2blis_01=1 else - echo "${script_name}: the BLAS compatibility layer is disabled." - enable_blas2blis_01=0 + echo "${script_name}: the BLAS compatibility layer is disabled." + enable_blas2blis_01=0 fi - # Report integer sizes if [ "x${int_type_size}" = "x32" ]; then echo "${script_name}: the internal integer size is 32-bit." @@ -581,62 +1063,130 @@ main() fi - # Insert escape characters into the paths used in the sed command below. + # Variables that contain forward slashes, such as paths, need extra + # escaping when used in sed commands. We insert those extra escape + # characters here so that the sed commands below do the right thing. install_prefix_esc=$(echo "${install_prefix}" | sed 's/\//\\\//g') dist_path_esc=$(echo "${dist_path}" | sed 's/\//\\\//g') cc_esc=$(echo "${CC}" | sed 's/\//\\\//g') - #echo "${install_prefix_esc}" - #exit 1 + # Create a #define for the configuration family (config_name). + uconf=$(echo ${config_name} | tr '[:lower:]' '[:upper:]') + config_name_define="#define BLIS_FAMILY_${uconf}\n" + + # Create a list of #defines, one for each configuration in config_list. + config_list_defines="" + for conf in ${config_list}; do + + # Convert the current config name to uppercase. + uconf=$(echo ${conf} | tr '[:lower:]' '[:upper:]') + + # Create a #define and add it to the running list. + config_define="BLIS_CONFIG_${uconf}" + config_list_defines="${config_list_defines}#define ${config_define}\n" + done + + # Create a list of #defines, one for each kernel set in kernel_list. + kernel_list_defines="" + for kern in ${kernel_list}; do + + # Convert the current config name to uppercase. + uconf=$(echo ${kern} | tr '[:lower:]' '[:upper:]') + + # Create a #define and add it to the running list. + kernel_define="BLIS_KERNELS_${uconf}" + kernel_list_defines="${kernel_list_defines}#define ${kernel_define}\n" + done + + + # -- Instantiate config.mk, bli_config.h files from templates -------------- # Begin substituting information into the config_mk_in file, outputting # to config_mk_out. echo "${script_name}: creating ${config_mk_out_path} from ${config_mk_in_path}" cat "${config_mk_in_path}" \ - | sed "s/@version@/${version}/g" \ - | sed "s/@config_name@/${config_name}/g" \ - | sed "s/@dist_path@/${dist_path_esc}/g" \ - | sed "s/@CC@/${cc_esc}/g" \ - | sed "s/@debug_type@/${debug_type}/g" \ - | sed "s/@install_prefix@/${install_prefix_esc}/g" \ - | sed "s/@enable_verbose@/${enable_verbose}/g" \ - | sed "s/@enable_static@/${enable_static}/g" \ - | sed "s/@enable_dynamic@/${enable_shared}/g" \ - | sed "s/@threading_model@/${threading_model}/g" \ - | sed "s/@enable_blas2blis@/${enable_blas2blis}/g" \ - | sed "s/@enable_cblas@/${enable_cblas}/g" \ + | sed -e "s/@version@/${version}/g" \ + | sed -e "s/@config_name@/${config_name}/g" \ + | sed -e "s/@config_list@/${config_list}/g" \ + | sed -e "s/@kernel_list@/${kernel_list}/g" \ + | sed -e "s/@kconfig_map@/${kconfig_map}/g" \ + | sed -e "s/@dist_path@/${dist_path_esc}/g" \ + | sed -e "s/@CC@/${cc_esc}/g" \ + | sed -e "s/@debug_type@/${debug_type}/g" \ + | sed -e "s/@install_prefix@/${install_prefix_esc}/g" \ + | sed -e "s/@enable_verbose@/${enable_verbose}/g" \ + | sed -e "s/@enable_static@/${enable_static}/g" \ + | sed -e "s/@enable_dynamic@/${enable_shared}/g" \ + | sed -e "s/@threading_model@/${threading_model}/g" \ + | sed -e "s/@enable_blas2blis@/${enable_blas2blis}/g" \ + | sed -e "s/@enable_cblas@/${enable_cblas}/g" \ > "${config_mk_out_path}" # Begin substituting information into the bli_config_h_in file, outputting - # to bli_config_h_out. + # to bli_config_h_out. NOTE: We use perl instead of sed because the version + # of sed used on OS X is old and does not handle the '\n' character + # intuitively, which was used when constructing ${config_name_define}, + # ${config_list_defines}, and ${kernel_list_defines}. echo "${script_name}: creating ${bli_config_h_out_path} from ${bli_config_h_in_path}" cat "${bli_config_h_in_path}" \ - | sed "s/@enable_openmp@/${enable_openmp_01}/g" \ - | sed "s/@enable_pthreads@/${enable_pthreads_01}/g" \ - | sed "s/@int_type_size@/${int_type_size}/g" \ - | sed "s/@blas2blis_int_type_size@/${blas2blis_int_type_size}/g" \ - | sed "s/@enable_blas2blis@/${enable_blas2blis_01}/g" \ - | sed "s/@enable_cblas@/${enable_cblas_01}/g" \ + | perl -pe "s/\@config_name_define\@/${config_name_define}/g" \ + | perl -pe "s/\@config_list_defines\@/${config_list_defines}/g" \ + | perl -pe "s/\@kernel_list_defines\@/${kernel_list_defines}/g" \ + | sed -e "s/@enable_openmp@/${enable_openmp_01}/g" \ + | sed -e "s/@enable_pthreads@/${enable_pthreads_01}/g" \ + | sed -e "s/@int_type_size@/${int_type_size}/g" \ + | sed -e "s/@blas2blis_int_type_size@/${blas2blis_int_type_size}/g" \ + | sed -e "s/@enable_blas2blis@/${enable_blas2blis_01}/g" \ + | sed -e "s/@enable_cblas@/${enable_cblas_01}/g" \ > "${bli_config_h_out_path}" + # -- Create top-level object directories ----------------------------------- + # Create obj sub-directories (if they do not already exist). base_obj_dirpath="${obj_dirpath}/${config_name}" echo "${script_name}: creating ${base_obj_dirpath}" mkdir -p ${base_obj_dirpath} + obj_config_dirpath="${base_obj_dirpath}/${config_dir}" echo "${script_name}: creating ${obj_config_dirpath}" mkdir -p ${obj_config_dirpath} + for conf in ${config_list}; do + echo "${script_name}: creating ${obj_config_dirpath}/${conf}" + mkdir -p ${obj_config_dirpath}/${conf} + done + + + obj_kernels_dirpath="${base_obj_dirpath}/${kernels_dir}" + + echo "${script_name}: creating ${obj_kernels_dirpath}" + mkdir -p ${obj_kernels_dirpath} + for kern in ${kernel_list}; do + echo "${script_name}: creating ${obj_kernels_dirpath}/${kern}" + mkdir -p ${obj_kernels_dirpath}/${kern} + done + + + obj_refkern_dirpath="${base_obj_dirpath}/${refkern_dir}" + + echo "${script_name}: creating ${obj_refkern_dirpath}" + mkdir -p ${obj_refkern_dirpath} + for conf in ${config_list}; do + echo "${script_name}: creating ${obj_refkern_dirpath}/${conf}" + mkdir -p ${obj_refkern_dirpath}/${conf} + done + obj_frame_dirpath="${base_obj_dirpath}/${frame_dir}" echo "${script_name}: creating ${obj_frame_dirpath}" mkdir -p ${obj_frame_dirpath} + obj_testsuite_dirpath="${base_obj_dirpath}/${testsuite_dir}" echo "${script_name}: creating ${obj_testsuite_dirpath}" @@ -649,26 +1199,109 @@ main() echo "${script_name}: creating ${base_lib_dirpath}" mkdir -p ${base_lib_dirpath} + # Create include directory (if it does not already exist). + base_include_dirpath="${include_dirpath}/${config_name}" - # Mirror config source tree to the object config sub-directory. - echo "${script_name}: mirroring ${configname_dirpath} to ${obj_config_dirpath}" - ${mirror_tree_sh} ${configname_dirpath} ${obj_config_dirpath} + echo "${script_name}: creating ${base_include_dirpath}" + mkdir -p ${base_include_dirpath} - # Mirror frame source tree to the object frame sub-directory. + + # -- Mirror source directory hierarchies to object directories ------------- + + # Mirror each of the sub-configuration directories to the object directory. + for conf in ${config_list}; do + + echo "${script_name}: mirroring ${config_dirpath}/${conf} to ${obj_config_dirpath}/${conf}" + ${mirror_tree_sh} "${config_dirpath}/${conf}" "${obj_config_dirpath}/${conf}" + done + + # Mirror optimized kernels source tree to its object sub-directory. + # We perform the mirroring on each configuration/kernel sub-directory + # within 'kernels'. + for kern in ${kernel_list}; do + + # Only mirror the optimized kernels source directory if it exists. + # There are occasions where one of the sub-configurations in the + # config_list does not correspond to a kernels sub-directory, such + # as when architecture B is so close to architecture A that B can + # use A's kernel source code unmodified (though perhaps with + # different blocksizes). + #if [ -d "${kernels_dirpath}/${conf}" ]; then + + echo "${script_name}: mirroring ${kernels_dirpath}/${kern} to ${obj_kernels_dirpath}/${kern}" + ${mirror_tree_sh} "${kernels_dirpath}/${kern}" "${obj_kernels_dirpath}/${kern}" + #else + # echo "${script_name}: mirroring ${kernels_dirpath}/${conf} skipped... directory does not exist" + #fi + done + + # Mirror reference kernels source tree to its object sub-directory. + for conf in ${config_list}; do + + echo "${script_name}: mirroring ${refkern_dirpath} to ${obj_refkern_dirpath}/${conf}" + ${mirror_tree_sh} "${refkern_dirpath}" "${obj_refkern_dirpath}/${conf}" + done + + # Mirror framework source tree to its object sub-directory. echo "${script_name}: mirroring ${frame_dirpath} to ${obj_frame_dirpath}" ${mirror_tree_sh} ${frame_dirpath} ${obj_frame_dirpath} - # Generate makefile fragments in the chosen configuration directory. + # -- Generate makefile fragements ------------------------------------------ + + clist_contains_cname=$(is_word_in_list "${config_name}" "${config_list}") + + # If the config_list does not already contain the config_name, generate + # makefiles in that directory. + if [ "${clist_contains_cname}" == "false" ]; then + + ${gen_make_frags_sh} \ + -h -r -v1 \ + -o ${script_name} \ + -p 'CONFIG' \ + ${config_dirpath}/${config_name} \ + ${gen_make_frags_dirpath}/fragment.mk \ + ${gen_make_frags_dirpath}/suffix_list \ + ${gen_make_frags_dirpath}/ignore_list + fi + + # Generate makefile fragments for each of the sub-configurations present + # in the configuration list. + for conf in ${config_list}; do + + ${gen_make_frags_sh} \ + -h -r -v1 \ + -o ${script_name} \ + -p 'CONFIG' \ + ${config_dirpath}/${conf} \ + ${gen_make_frags_dirpath}/fragment.mk \ + ${gen_make_frags_dirpath}/suffix_list \ + ${gen_make_frags_dirpath}/ignore_list + done + + # Generate makefile fragments for each of the kernel sets required by + # the configuration list (in the kernel list). + for kern in ${kernel_list}; do + + ${gen_make_frags_sh} \ + -h -r -v1 \ + -o ${script_name} \ + -p 'KERNELS' \ + ${kernels_dirpath}/${kern} \ + ${gen_make_frags_dirpath}/fragment.mk \ + ${gen_make_frags_dirpath}/suffix_list \ + ${gen_make_frags_dirpath}/ignore_list + done + + # Generate makefile fragments in the reference kernels directory. ${gen_make_frags_sh} \ -h -r -v1 \ -o ${script_name} \ - -p 'CONFIG' \ - ${configname_dirpath} \ + -p 'REFKERN' \ + ${refkern_dirpath} \ ${gen_make_frags_dirpath}/fragment.mk \ ${gen_make_frags_dirpath}/suffix_list \ - ${gen_make_frags_dirpath}/ignore_list \ - ${gen_make_frags_dirpath}/special_list + ${gen_make_frags_dirpath}/ignore_list # Generate makefile fragments in the framework directory. ${gen_make_frags_sh} \ @@ -678,10 +1311,11 @@ main() ${frame_dirpath} \ ${gen_make_frags_dirpath}/fragment.mk \ ${gen_make_frags_dirpath}/suffix_list \ - ${gen_make_frags_dirpath}/ignore_list \ - ${gen_make_frags_dirpath}/special_list + ${gen_make_frags_dirpath}/ignore_list + # -- Handle out-of-tree builds --------------------------------------------- + # Under some circumstances, we need to create a symbolic link to the # Makefile. We only proceed with this if configure was run with a path # other than "./". @@ -743,3 +1377,4 @@ main() # The script's main entry point, passing all parameters given. main "$@" + diff --git a/frame/0/bli_l0_tapi.h b/frame/0/bli_l0_tapi.h index 36b282824..f47d65788 100644 --- a/frame/0/bli_l0_tapi.h +++ b/frame/0/bli_l0_tapi.h @@ -47,10 +47,10 @@ void PASTEMAC(ch,opname) \ ctype* psi \ ); -INSERT_GENTPROT_BASIC( addsc ) -INSERT_GENTPROT_BASIC( divsc ) -INSERT_GENTPROT_BASIC( mulsc ) -INSERT_GENTPROT_BASIC( subsc ) +INSERT_GENTPROT_BASIC0( addsc ) +INSERT_GENTPROT_BASIC0( divsc ) +INSERT_GENTPROT_BASIC0( mulsc ) +INSERT_GENTPROT_BASIC0( subsc ) #undef GENTPROT @@ -62,7 +62,7 @@ void PASTEMAC(ch,opname) \ ctype* chi \ ); -INSERT_GENTPROT_BASIC( invertsc ) +INSERT_GENTPROT_BASIC0( invertsc ) #undef GENTPROTR @@ -74,8 +74,8 @@ void PASTEMAC(ch,opname) \ ctype_r* absq \ ); -INSERT_GENTPROTR_BASIC( absqsc ) -INSERT_GENTPROTR_BASIC( normfsc ) +INSERT_GENTPROTR_BASIC0( absqsc ) +INSERT_GENTPROTR_BASIC0( normfsc ) #undef GENTPROT @@ -87,7 +87,7 @@ void PASTEMAC(ch,opname) \ ctype* psi \ ); -INSERT_GENTPROT_BASIC( sqrtsc ) +INSERT_GENTPROT_BASIC0( sqrtsc ) #undef GENTPROT @@ -100,7 +100,7 @@ void PASTEMAC(ch,opname) \ double* zeta_i \ ); -INSERT_GENTPROT_BASIC( getsc ) +INSERT_GENTPROT_BASIC0( getsc ) #undef GENTPROT @@ -113,7 +113,7 @@ void PASTEMAC(ch,opname) \ ctype* chi \ ); -INSERT_GENTPROT_BASIC( setsc ) +INSERT_GENTPROT_BASIC0( setsc ) #undef GENTPROTR @@ -126,7 +126,7 @@ void PASTEMAC(ch,opname) \ ctype_r* zeta_i \ ); -INSERT_GENTPROTR_BASIC( unzipsc ) +INSERT_GENTPROTR_BASIC0( unzipsc ) #undef GENTPROTR @@ -139,7 +139,7 @@ void PASTEMAC(ch,opname) \ ctype* chi \ ); -INSERT_GENTPROTR_BASIC( zipsc ) +INSERT_GENTPROTR_BASIC0( zipsc ) // ----------------------------------------------------------------------------- diff --git a/frame/0/copysc/bli_copysc.h b/frame/0/copysc/bli_copysc.h index 1e72a2b51..dbddb5079 100644 --- a/frame/0/copysc/bli_copysc.h +++ b/frame/0/copysc/bli_copysc.h @@ -62,7 +62,7 @@ void PASTEMAC2(chx,chy,varname) \ void* psi \ ); -INSERT_GENTPROT2_BASIC( copysc ) -INSERT_GENTPROT2_MIX_D( copysc ) -INSERT_GENTPROT2_MIX_P( copysc ) +INSERT_GENTPROT2_BASIC0( copysc ) +INSERT_GENTPROT2_MIX_D0( copysc ) +INSERT_GENTPROT2_MIX_P0( copysc ) diff --git a/frame/1/bli_l1v.h b/frame/1/bli_l1v.h index bd4879247..69cbc0cc9 100644 --- a/frame/1/bli_l1v.h +++ b/frame/1/bli_l1v.h @@ -32,7 +32,6 @@ */ -#include "bli_l1v_cntx.h" #include "bli_l1v_check.h" #include "bli_l1v_ft.h" @@ -56,5 +55,5 @@ //#include "bli_scalv_int.h" // Reference kernel headers -#include "bli_l1v_ref.h" +//#include "bli_l1v_ref.h" diff --git a/frame/1/bli_l1v_ker.h b/frame/1/bli_l1v_ker.h index 8039905b7..a864e9390 100644 --- a/frame/1/bli_l1v_ker.h +++ b/frame/1/bli_l1v_ker.h @@ -38,161 +38,85 @@ // #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjx, \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ - ); +#define GENTPROT ADDV_KER_PROT -INSERT_GENTPROT_BASIC( addv_ker_name ) -INSERT_GENTPROT_BASIC( copyv_ker_name ) -INSERT_GENTPROT_BASIC( subv_ker_name ) +INSERT_GENTPROT_BASIC0( addv_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - dim_t* restrict index, \ - cntx_t* cntx \ - ); \ +#define GENTPROT AMAXV_KER_PROT -INSERT_GENTPROT_BASIC( amaxv_ker_name ) +INSERT_GENTPROT_BASIC0( amaxv_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjx, \ - dim_t n, \ - ctype* restrict alpha, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict beta, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ - ); \ +#define GENTPROT AXPBYV_KER_PROT -INSERT_GENTPROT_BASIC( axpbyv_ker_name ) +INSERT_GENTPROT_BASIC0( axpbyv_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjx, \ - dim_t n, \ - ctype* restrict alpha, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ - ); \ +#define GENTPROT AXPYV_KER_PROT -INSERT_GENTPROT_BASIC( axpyv_ker_name ) -INSERT_GENTPROT_BASIC( scal2v_ker_name ) +INSERT_GENTPROT_BASIC0( axpyv_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjx, \ - conj_t conjy, \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - ctype* restrict rho, \ - cntx_t* cntx \ - ); \ +#define GENTPROT COPYV_KER_PROT -INSERT_GENTPROT_BASIC( dotv_ker_name ) +INSERT_GENTPROT_BASIC0( copyv_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjx, \ - conj_t conjy, \ - dim_t n, \ - ctype* restrict alpha, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - ctype* restrict beta, \ - ctype* restrict rho, \ - cntx_t* cntx \ - ); \ +#define GENTPROT DOTV_KER_PROT -INSERT_GENTPROT_BASIC( dotxv_ker_name ) +INSERT_GENTPROT_BASIC0( dotv_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - cntx_t* cntx \ - ); \ +#define GENTPROT DOTXV_KER_PROT -INSERT_GENTPROT_BASIC( invertv_ker_name ) +INSERT_GENTPROT_BASIC0( dotxv_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjalpha, \ - dim_t n, \ - ctype* restrict alpha, \ - ctype* restrict x, inc_t incx, \ - cntx_t* cntx \ - ); \ +#define GENTPROT INVERTV_KER_PROT -INSERT_GENTPROT_BASIC( scalv_ker_name ) -INSERT_GENTPROT_BASIC( setv_ker_name ) +INSERT_GENTPROT_BASIC0( invertv_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ - ); \ +#define GENTPROT SCALV_KER_PROT -INSERT_GENTPROT_BASIC( swapv_ker_name ) +INSERT_GENTPROT_BASIC0( scalv_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjx, \ - dim_t n, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict beta, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ - ); \ +#define GENTPROT SCAL2V_KER_PROT -INSERT_GENTPROT_BASIC( xpbyv_ker_name ) +INSERT_GENTPROT_BASIC0( scal2v_ker_name ) + + +#undef GENTPROT +#define GENTPROT SETV_KER_PROT + +INSERT_GENTPROT_BASIC0( setv_ker_name ) + + +#undef GENTPROT +#define GENTPROT SUBV_KER_PROT + +INSERT_GENTPROT_BASIC0( subv_ker_name ) + + +#undef GENTPROT +#define GENTPROT SWAPV_KER_PROT + +INSERT_GENTPROT_BASIC0( swapv_ker_name ) + + +#undef GENTPROT +#define GENTPROT XPBYV_KER_PROT + +INSERT_GENTPROT_BASIC0( xpbyv_ker_name ) diff --git a/frame/1/bli_l1v_ker_prot.h b/frame/1/bli_l1v_ker_prot.h new file mode 100644 index 000000000..a79867f0a --- /dev/null +++ b/frame/1/bli_l1v_ker_prot.h @@ -0,0 +1,213 @@ +/* + + 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. + +*/ + + +// +// Define template prototypes for level-1v kernels. +// + +#define ADDV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + + +#define AMAXV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + dim_t* restrict index, \ + cntx_t* cntx \ + ); \ + + +#define AXPBYV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict beta, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); \ + + +#define AXPYV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); \ + + +#define COPYV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + + +#define DOTV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjx, \ + conj_t conjy, \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + ctype* restrict rho, \ + cntx_t* cntx \ + ); \ + + +#define DOTXV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjx, \ + conj_t conjy, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + ctype* restrict beta, \ + ctype* restrict rho, \ + cntx_t* cntx \ + ); \ + + +#define INVERTV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + cntx_t* cntx \ + ); \ + + +#define SCALV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjalpha, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + cntx_t* cntx \ + ); \ + + +#define SCAL2V_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); \ + + +#define SETV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjalpha, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + cntx_t* cntx \ + ); \ + + +#define SUBV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + + +#define SWAPV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); \ + + +#define XPBYV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjx, \ + dim_t n, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict beta, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); \ + diff --git a/frame/1/bli_l1v_tapi.c b/frame/1/bli_l1v_tapi.c index 6abf002f5..445b8520f 100644 --- a/frame/1/bli_l1v_tapi.c +++ b/frame/1/bli_l1v_tapi.c @@ -51,11 +51,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -63,10 +63,8 @@ void PASTEMAC(ch,opname) \ n, \ x, incx, \ y, incy, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( addv, BLIS_ADDV_KER ) @@ -86,21 +84,19 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ n, \ x, incx, \ index, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( amaxv, BLIS_AMAXV_KER ) @@ -121,11 +117,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -135,10 +131,8 @@ void PASTEMAC(ch,opname) \ x, incx, \ beta, \ y, incy, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( axpbyv, BLIS_AXPBYV_KER ) @@ -158,11 +152,12 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) \ + cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -171,10 +166,8 @@ void PASTEMAC(ch,opname) \ alpha, \ x, incx, \ y, incy, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( axpyv, BLIS_AXPYV_KER ) @@ -196,11 +189,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -210,10 +203,8 @@ void PASTEMAC(ch,opname) \ x, incx, \ y, incy, \ rho, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( dotv, BLIS_DOTV_KER ) @@ -236,11 +227,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -252,10 +243,8 @@ void PASTEMAC(ch,opname) \ y, incy, \ beta, \ rho, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( dotxv, BLIS_DOTXV_KER ) @@ -272,20 +261,18 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ n, \ x, incx, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( invertv, BLIS_INVERTV_KER ) @@ -304,11 +291,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -316,10 +303,8 @@ void PASTEMAC(ch,opname) \ n, \ alpha, \ x, incx, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( scalv, BLIS_SCALV_KER ) @@ -338,21 +323,19 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ n, \ x, incx, \ y, incy, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( swapv, BLIS_SWAPV_KER ) @@ -371,11 +354,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -384,10 +367,8 @@ void PASTEMAC(ch,opname) \ x, incx, \ beta, \ y, incy, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( xpbyv, BLIS_XPBYV_KER ) diff --git a/frame/1/kernels/old/bli_dotv_ref.h b/frame/1/kernels/old/bli_dotv_ref.h deleted file mode 100644 index 35a1eda5b..000000000 --- a/frame/1/kernels/old/bli_dotv_ref.h +++ /dev/null @@ -1,50 +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. - -*/ - - -#undef GENTPROT3 -#define GENTPROT3( ctype_x, ctype_y, ctype_r, chx, chy, chr, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjx, \ - conj_t conjy, \ - dim_t n, \ - ctype_x* x, inc_t incx, \ - ctype_y* y, inc_t incy, \ - ctype_r* rho \ - ); - -INSERT_GENTPROT3_BASIC( dotv_ref ) - diff --git a/frame/1/kernels/old/bli_dotxv_ref.h b/frame/1/kernels/old/bli_dotxv_ref.h deleted file mode 100644 index 676dcce8e..000000000 --- a/frame/1/kernels/old/bli_dotxv_ref.h +++ /dev/null @@ -1,52 +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. - -*/ - - -#undef GENTPROT3U12 -#define GENTPROT3U12( ctype_x, ctype_y, ctype_r, ctype_xy, chx, chy, chr, chxy, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjx, \ - conj_t conjy, \ - dim_t n, \ - ctype_xy* alpha, \ - ctype_x* x, inc_t incx, \ - ctype_y* y, inc_t incy, \ - ctype_r* beta, \ - ctype_r* rho \ - ); - -INSERT_GENTPROT3U12_BASIC( dotxv_ref ) - diff --git a/frame/1/kernels/old/bli_scal2v_ref.h b/frame/1/kernels/old/bli_scal2v_ref.h deleted file mode 100644 index b33fc94fb..000000000 --- a/frame/1/kernels/old/bli_scal2v_ref.h +++ /dev/null @@ -1,49 +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. - -*/ - - -#undef GENTPROT3 -#define GENTPROT3( ctype_b, ctype_x, ctype_y, chb, chx, chy, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjx, \ - dim_t n, \ - ctype_b* beta, \ - ctype_x* x, inc_t incx, \ - ctype_y* y, inc_t incy \ - ); - -INSERT_GENTPROT3_BASIC( scal2v_ref ) - diff --git a/frame/1/kernels/old/bli_scalv_ref.h b/frame/1/kernels/old/bli_scalv_ref.h deleted file mode 100644 index 43c79d65c..000000000 --- a/frame/1/kernels/old/bli_scalv_ref.h +++ /dev/null @@ -1,48 +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. - -*/ - - -#undef GENTPROT2 -#define GENTPROT2( ctype_a, ctype_x, cha, chx, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjalpha, \ - dim_t n, \ - ctype_a* alpha, \ - ctype_x* x, inc_t incx \ - ); - -INSERT_GENTPROT2_BASIC( scalv_ref ) - diff --git a/frame/1/kernels/old/bli_setv_ref.h b/frame/1/kernels/old/bli_setv_ref.h deleted file mode 100644 index 54f494307..000000000 --- a/frame/1/kernels/old/bli_setv_ref.h +++ /dev/null @@ -1,48 +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. - -*/ - - -#undef GENTPROT2 -#define GENTPROT2( ctype_a, ctype_x, cha, chx, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjalpha, \ - dim_t n, \ - ctype_a* alpha, \ - ctype_x* x, inc_t incx \ - ); - -INSERT_GENTPROT2_BASIC( setv_ref ) - diff --git a/frame/1/kernels/old/bli_subv_ref.h b/frame/1/kernels/old/bli_subv_ref.h deleted file mode 100644 index 6c24fda24..000000000 --- a/frame/1/kernels/old/bli_subv_ref.h +++ /dev/null @@ -1,48 +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. - -*/ - - -#undef GENTPROT2 -#define GENTPROT2( ctype_x, ctype_y, chx, chy, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjx, \ - dim_t n, \ - ctype_x* x, inc_t incx, \ - ctype_y* y, inc_t incy \ - ); - -INSERT_GENTPROT2_BASIC( subv_ref ) - diff --git a/frame/1/bli_l1v_cntx.c b/frame/1/old/bli_l1v_cntx.c similarity index 100% rename from frame/1/bli_l1v_cntx.c rename to frame/1/old/bli_l1v_cntx.c diff --git a/frame/1/bli_l1v_cntx.h b/frame/1/old/bli_l1v_cntx.h similarity index 100% rename from frame/1/bli_l1v_cntx.h rename to frame/1/old/bli_l1v_cntx.h diff --git a/frame/1/other/packv/bli_packv_cntl.c b/frame/1/other/packv/bli_packv_cntl.c index b81a6e5d1..6026c4255 100644 --- a/frame/1/other/packv/bli_packv_cntl.c +++ b/frame/1/other/packv/bli_packv_cntl.c @@ -34,52 +34,6 @@ #include "blis.h" -#if 0 -packv_t* packv_cntl = NULL; - -void bli_packv_cntl_init( void ) -{ - packv_cntl = bli_packv_cntl_obj_create( BLIS_UNBLOCKED, - BLIS_VARIANT1, - BLIS_VF, - BLIS_PACKED_VECTOR ); -} - -void bli_packv_cntl_finalize( void ) -{ - bli_cntl_free_node( packv_cntl ); -} - -packv_t* bli_packv_cntl_obj_create( impl_t impl_type, - varnum_t var_num, - bszid_t bmid, - pack_t pack_schema ) -{ - packv_t* cntl; - - cntl = ( packv_t* ) bli_malloc_intl( sizeof(packv_t) ); - - cntl->impl_type = impl_type; - cntl->var_num = var_num; - cntl->bmid = bmid; - cntl->pack_schema = pack_schema; - - return cntl; -} - -void bli_packv_cntl_obj_init( packv_t* cntl, - impl_t impl_type, - varnum_t var_num, - bszid_t bmid, - pack_t pack_schema ) -{ - cntl->impl_type = impl_type; - cntl->var_num = var_num; - cntl->bmid = bmid; - cntl->pack_schema = pack_schema; -} -#endif - cntl_t* bli_packv_cntl_obj_create ( void* var_func, diff --git a/frame/1d/bli_l1d.h b/frame/1d/bli_l1d.h index ee40cdf9a..1a38befd6 100644 --- a/frame/1d/bli_l1d.h +++ b/frame/1d/bli_l1d.h @@ -32,7 +32,6 @@ */ -#include "bli_l1d_cntx.h" #include "bli_l1d_check.h" // Prototype object APIs with and without contexts. diff --git a/frame/1d/bli_l1d_tapi.c b/frame/1d/bli_l1d_tapi.c index c8a67a138..8223223bf 100644 --- a/frame/1d/bli_l1d_tapi.c +++ b/frame/1d/bli_l1d_tapi.c @@ -54,7 +54,6 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ ctype* x1; \ ctype* y1; \ @@ -89,11 +88,11 @@ void PASTEMAC(ch,opname) \ y1 = y + offy; \ } \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ @@ -101,11 +100,8 @@ void PASTEMAC(ch,opname) \ n_elem, \ x1, incx, \ y1, incy, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC2( addd, addv, BLIS_ADDV_KER ) @@ -130,7 +126,6 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ ctype* x1; \ ctype* y1; \ @@ -165,11 +160,11 @@ void PASTEMAC(ch,opname) \ y1 = y + offy; \ } \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ @@ -178,11 +173,8 @@ void PASTEMAC(ch,opname) \ alpha, \ x1, incx, \ y1, incy, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC2( axpyd, axpyv, BLIS_AXPYV_KER ) @@ -202,7 +194,6 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ ctype* x1; \ dim_t n_elem; \ @@ -221,21 +212,18 @@ void PASTEMAC(ch,opname) \ \ x1 = x + offx; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ n_elem, \ x1, incx, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC2( invertd, invertv, BLIS_INVERTV_KER ) @@ -256,7 +244,6 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ ctype* x1; \ dim_t n_elem; \ @@ -275,11 +262,11 @@ void PASTEMAC(ch,opname) \ \ x1 = x + offx; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ - PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ @@ -287,11 +274,8 @@ void PASTEMAC(ch,opname) \ n_elem, \ alpha, \ x1, incx, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC2( scald, scalv, BLIS_SCALV_KER ) @@ -313,7 +297,6 @@ void PASTEMAC(ch,opname) \ { \ const num_t dt = PASTEMAC(ch,type); \ const num_t dt_r = PASTEMAC(chr,type); \ - cntx_t* cntx_p; \ \ ctype_r* x1; \ dim_t n_elem; \ @@ -348,11 +331,11 @@ void PASTEMAC(ch,opname) \ x1 = ( ctype_r* )( x + offx ) + 1; \ incx = 2*incx; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Query the context for the operation's kernel address. */ \ - PASTECH2(chr,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt_r, kerid, cntx_p ); \ + PASTECH2(chr,kername,_ft) f = bli_cntx_get_l1v_ker_dt( dt_r, kerid, cntx ); \ \ /* Invoke the kernel with the appropriate parameters. */ \ f( \ @@ -360,11 +343,8 @@ void PASTEMAC(ch,opname) \ n_elem, \ alpha, \ x1, incx, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNCR_BASIC2( setid, setv, BLIS_SETV_KER ) diff --git a/frame/1d/bli_l1d_tapi.h b/frame/1d/bli_l1d_tapi.h index be994a224..5c067bfab 100644 --- a/frame/1d/bli_l1d_tapi.h +++ b/frame/1d/bli_l1d_tapi.h @@ -52,9 +52,9 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( addd ) -INSERT_GENTPROT_BASIC( copyd ) -INSERT_GENTPROT_BASIC( subd ) +INSERT_GENTPROT_BASIC0( addd ) +INSERT_GENTPROT_BASIC0( copyd ) +INSERT_GENTPROT_BASIC0( subd ) #undef GENTPROT @@ -73,8 +73,8 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( axpyd ) -INSERT_GENTPROT_BASIC( scal2d ) +INSERT_GENTPROT_BASIC0( axpyd ) +INSERT_GENTPROT_BASIC0( scal2d ) #undef GENTPROT @@ -89,7 +89,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( invertd ) +INSERT_GENTPROT_BASIC0( invertd ) #undef GENTPROT @@ -106,8 +106,8 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( scald ) -INSERT_GENTPROT_BASIC( setd ) +INSERT_GENTPROT_BASIC0( scald ) +INSERT_GENTPROT_BASIC0( setd ) #undef GENTPROTR @@ -123,5 +123,5 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( setid ) +INSERT_GENTPROTR_BASIC0( setid ) diff --git a/frame/1d/bli_l1d_cntx.c b/frame/1d/old/bli_l1d_cntx.c similarity index 100% rename from frame/1d/bli_l1d_cntx.c rename to frame/1d/old/bli_l1d_cntx.c diff --git a/frame/1d/bli_l1d_cntx.h b/frame/1d/old/bli_l1d_cntx.h similarity index 100% rename from frame/1d/bli_l1d_cntx.h rename to frame/1d/old/bli_l1d_cntx.h diff --git a/frame/1f/bli_l1f.h b/frame/1f/bli_l1f.h index 6052a4b5c..9a98d8337 100644 --- a/frame/1f/bli_l1f.h +++ b/frame/1f/bli_l1f.h @@ -32,7 +32,6 @@ */ -#include "bli_l1f_cntx.h" #include "bli_l1f_check.h" #include "bli_l1f_ft.h" @@ -46,5 +45,5 @@ #include "bli_l1f_tapi.h" // Reference kernel headers -#include "bli_l1f_ref.h" +//#include "bli_l1f_ref.h" diff --git a/frame/1f/bli_l1f_ker.h b/frame/1f/bli_l1f_ker.h index 9c040490e..48eb84533 100644 --- a/frame/1f/bli_l1f_ker.h +++ b/frame/1f/bli_l1f_ker.h @@ -38,103 +38,31 @@ // #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjx, \ - conj_t conjy, \ - dim_t n, \ - ctype* restrict alphax, \ - ctype* restrict alphay, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - ctype* restrict z, inc_t incz, \ - cntx_t* cntx \ - ); +#define GENTPROT AXPY2V_KER_PROT -INSERT_GENTPROT_BASIC( axpy2v_ker_name ) +INSERT_GENTPROT_BASIC0( axpy2v_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conja, \ - conj_t conjx, \ - dim_t m, \ - dim_t b_n, \ - ctype* restrict alpha, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ - ); +#define GENTPROT AXPYF_KER_PROT -INSERT_GENTPROT_BASIC( axpyf_ker_name ) +INSERT_GENTPROT_BASIC0( axpyf_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjxt, \ - conj_t conjx, \ - conj_t conjy, \ - dim_t n, \ - ctype* restrict alpha, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict y, inc_t incy, \ - ctype* restrict rho, \ - ctype* restrict z, inc_t incz, \ - cntx_t* cntx \ - ); +#define GENTPROT DOTAXPYV_KER_PROT -INSERT_GENTPROT_BASIC( dotaxpyv_ker_name ) +INSERT_GENTPROT_BASIC0( dotaxpyv_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjat, \ - conj_t conja, \ - conj_t conjw, \ - conj_t conjx, \ - dim_t m, \ - dim_t b_n, \ - ctype* restrict alpha, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict w, inc_t incw, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict beta, \ - ctype* restrict y, inc_t incy, \ - ctype* restrict z, inc_t incz, \ - cntx_t* cntx \ - ); +#define GENTPROT DOTXAXPYF_KER_PROT -INSERT_GENTPROT_BASIC( dotxaxpyf_ker_name ) +INSERT_GENTPROT_BASIC0( dotxaxpyf_ker_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - conj_t conjat, \ - conj_t conjx, \ - dim_t m, \ - dim_t b_n, \ - ctype* restrict alpha, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict x, inc_t incx, \ - ctype* restrict beta, \ - ctype* restrict y, inc_t incy, \ - cntx_t* cntx \ - ); +#define GENTPROT DOTXF_KER_PROT -INSERT_GENTPROT_BASIC( dotxf_ker_name ) +INSERT_GENTPROT_BASIC0( dotxf_ker_name ) diff --git a/frame/1f/bli_l1f_ker_prot.h b/frame/1f/bli_l1f_ker_prot.h new file mode 100644 index 000000000..17bd62320 --- /dev/null +++ b/frame/1f/bli_l1f_ker_prot.h @@ -0,0 +1,125 @@ +/* + + 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. + +*/ + + +// +// Define template prototypes for level-1f kernels. +// + +#define AXPY2V_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjx, \ + conj_t conjy, \ + dim_t n, \ + ctype* restrict alphax, \ + ctype* restrict alphay, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + ctype* restrict z, inc_t incz, \ + cntx_t* cntx \ + ); + + +#define AXPYF_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conja, \ + conj_t conjx, \ + dim_t m, \ + dim_t b_n, \ + ctype* restrict alpha, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + + +#define DOTAXPYV_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjxt, \ + conj_t conjx, \ + conj_t conjy, \ + dim_t n, \ + ctype* restrict alpha, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict y, inc_t incy, \ + ctype* restrict rho, \ + ctype* restrict z, inc_t incz, \ + cntx_t* cntx \ + ); + + +#define DOTXAXPYF_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjat, \ + conj_t conja, \ + conj_t conjw, \ + conj_t conjx, \ + dim_t m, \ + dim_t b_n, \ + ctype* restrict alpha, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict w, inc_t incw, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict beta, \ + ctype* restrict y, inc_t incy, \ + ctype* restrict z, inc_t incz, \ + cntx_t* cntx \ + ); + + +#define DOTXF_KER_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + conj_t conjat, \ + conj_t conjx, \ + dim_t m, \ + dim_t b_n, \ + ctype* restrict alpha, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict x, inc_t incx, \ + ctype* restrict beta, \ + ctype* restrict y, inc_t incy, \ + cntx_t* cntx \ + ); + diff --git a/frame/1f/bli_l1f_tapi.c b/frame/1f/bli_l1f_tapi.c index 8c77a2465..9db3645c8 100644 --- a/frame/1f/bli_l1f_tapi.c +++ b/frame/1f/bli_l1f_tapi.c @@ -55,11 +55,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -71,10 +71,8 @@ void PASTEMAC(ch,opname) \ x, incx, \ y, incy, \ z, incz, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( axpy2v, BLIS_AXPY2V_KER ) @@ -97,11 +95,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -113,10 +111,8 @@ void PASTEMAC(ch,opname) \ a, inca, lda, \ x, incx, \ y, incy, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( axpyf, BLIS_AXPYF_KER ) @@ -140,11 +136,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -157,10 +153,8 @@ void PASTEMAC(ch,opname) \ y, incy, \ rho, \ z, incz, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( dotaxpyv, BLIS_DOTAXPYV_KER ) @@ -188,11 +182,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -209,10 +203,8 @@ void PASTEMAC(ch,opname) \ beta, \ y, incy, \ z, incz, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( dotxaxpyf, BLIS_DOTXAXPYF_KER ) @@ -236,11 +228,11 @@ void PASTEMAC(ch,opname) \ ) \ { \ const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ - PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx_p ); \ + PASTECH2(ch,opname,_ft) f = bli_cntx_get_l1f_ker_dt( dt, kerid, cntx ); \ \ f \ ( \ @@ -253,10 +245,8 @@ void PASTEMAC(ch,opname) \ x, incx, \ beta, \ y, incy, \ - cntx_p \ + cntx \ ); \ -\ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( dotxf, BLIS_DOTXF_KER ) diff --git a/frame/1f/kernels/old/bli_axpy2v_ref.h b/frame/1f/kernels/old/bli_axpy2v_ref.h deleted file mode 100644 index ad0d32374..000000000 --- a/frame/1f/kernels/old/bli_axpy2v_ref.h +++ /dev/null @@ -1,52 +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. - -*/ - - -#undef GENTPROT3U12 -#define GENTPROT3U12( ctype_x, ctype_y, ctype_z, ctype_xy, chx, chy, chz, chxy, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjx, \ - conj_t conjy, \ - dim_t n, \ - ctype_xy* alpha1, \ - ctype_xy* alpha2, \ - ctype_x* x, inc_t incx, \ - ctype_y* y, inc_t incy, \ - ctype_z* z, inc_t incz \ - ); - -INSERT_GENTPROT3U12_BASIC( axpy2v_ref ) - diff --git a/frame/1f/kernels/old/bli_axpyf_ref.h b/frame/1f/kernels/old/bli_axpyf_ref.h deleted file mode 100644 index bc5fbc0e4..000000000 --- a/frame/1f/kernels/old/bli_axpyf_ref.h +++ /dev/null @@ -1,52 +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. - -*/ - - -#undef GENTPROT3U12 -#define GENTPROT3U12( ctype_a, ctype_x, ctype_y, ctype_ax, cha, chx, chy, chax, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conja, \ - conj_t conjx, \ - dim_t m, \ - dim_t b_n, \ - ctype_ax* alpha, \ - ctype_a* a, inc_t inca, inc_t lda, \ - ctype_x* x, inc_t incx, \ - ctype_y* y, inc_t incy \ - ); - -INSERT_GENTPROT3U12_BASIC( axpyf_ref ) - diff --git a/frame/1f/kernels/old/bli_dotaxpyv_ref.h b/frame/1f/kernels/old/bli_dotaxpyv_ref.h deleted file mode 100644 index 4771d16c6..000000000 --- a/frame/1f/kernels/old/bli_dotaxpyv_ref.h +++ /dev/null @@ -1,53 +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. - -*/ - - -#undef GENTPROT3U12 -#define GENTPROT3U12( ctype_x, ctype_y, ctype_z, ctype_xy, chx, chy, chz, chxy, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjxt, \ - conj_t conjx, \ - conj_t conjy, \ - dim_t m, \ - ctype_x* alpha, \ - ctype_x* x, inc_t incx, \ - ctype_y* y, inc_t incy, \ - ctype_xy* rho, \ - ctype_z* z, inc_t incz \ - ); - -INSERT_GENTPROT3U12_BASIC( dotaxpyv_ref ) - diff --git a/frame/1f/kernels/old/bli_dotxaxpyf_ref_var1.h b/frame/1f/kernels/old/bli_dotxaxpyf_ref_var1.h deleted file mode 100644 index e080fa742..000000000 --- a/frame/1f/kernels/old/bli_dotxaxpyf_ref_var1.h +++ /dev/null @@ -1,57 +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. - -*/ - - -#undef GENTPROT3U12 -#define GENTPROT3U12( ctype_a, ctype_b, ctype_c, ctype_ab, cha, chb, chc, chab, varname ) \ -\ -void PASTEMAC(cha,varname) \ - ( \ - conj_t conjat, \ - conj_t conja, \ - conj_t conjw, \ - conj_t conjx, \ - dim_t m, \ - dim_t b_n, \ - ctype_ab* alpha, \ - ctype_a* a, inc_t inca, inc_t lda, \ - ctype_b* w, inc_t incw, \ - ctype_b* x, inc_t incx, \ - ctype_c* beta, \ - ctype_c* y, inc_t incy, \ - ctype_c* z, inc_t incz \ - ); - -INSERT_GENTPROT3U12_BASIC( dotxaxpyf_ref_var1 ) - diff --git a/frame/1f/kernels/old/bli_dotxaxpyf_ref_var2.h b/frame/1f/kernels/old/bli_dotxaxpyf_ref_var2.h deleted file mode 100644 index 744634963..000000000 --- a/frame/1f/kernels/old/bli_dotxaxpyf_ref_var2.h +++ /dev/null @@ -1,57 +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. - -*/ - - -#undef GENTPROT3U12 -#define GENTPROT3U12( ctype_a, ctype_b, ctype_c, ctype_ab, cha, chb, chc, chab, varname ) \ -\ -void PASTEMAC(cha,varname) \ - ( \ - conj_t conjat, \ - conj_t conja, \ - conj_t conjw, \ - conj_t conjx, \ - dim_t m, \ - dim_t b_n, \ - ctype_ab* alpha, \ - ctype_a* a, inc_t inca, inc_t lda, \ - ctype_b* w, inc_t incw, \ - ctype_b* x, inc_t incx, \ - ctype_c* beta, \ - ctype_c* y, inc_t incy, \ - ctype_c* z, inc_t incz \ - ); - -INSERT_GENTPROT3U12_BASIC( dotxaxpyf_ref_var2 ) - diff --git a/frame/1f/kernels/old/bli_dotxf_ref.h b/frame/1f/kernels/old/bli_dotxf_ref.h deleted file mode 100644 index e2ad196b8..000000000 --- a/frame/1f/kernels/old/bli_dotxf_ref.h +++ /dev/null @@ -1,53 +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. - -*/ - - -#undef GENTPROT3U12 -#define GENTPROT3U12( ctype_a, ctype_x, ctype_y, ctype_ax, cha, chx, chy, chax, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjat, \ - conj_t conjx, \ - dim_t m, \ - dim_t b_n, \ - ctype_ax* alpha, \ - ctype_a* a, inc_t inca, inc_t lda, \ - ctype_x* x, inc_t incx, \ - ctype_y* beta, \ - ctype_y* y, inc_t incy \ - ); - -INSERT_GENTPROT3U12_BASIC( dotxf_ref ) - diff --git a/frame/1f/bli_l1f_cntx.c b/frame/1f/old/bli_l1f_cntx.c similarity index 100% rename from frame/1f/bli_l1f_cntx.c rename to frame/1f/old/bli_l1f_cntx.c diff --git a/frame/1f/bli_l1f_cntx.h b/frame/1f/old/bli_l1f_cntx.h similarity index 100% rename from frame/1f/bli_l1f_cntx.h rename to frame/1f/old/bli_l1f_cntx.h diff --git a/frame/1m/bli_l1m.h b/frame/1m/bli_l1m.h index 5c55b97d3..a1a0f10e1 100644 --- a/frame/1m/bli_l1m.h +++ b/frame/1m/bli_l1m.h @@ -32,7 +32,6 @@ */ -#include "bli_l1m_cntx.h" #include "bli_l1m_check.h" #include "bli_l1m_ft.h" diff --git a/frame/1m/bli_l1m_ft.h b/frame/1m/bli_l1m_ft.h index 2790bd006..f15bc0c6d 100644 --- a/frame/1m/bli_l1m_ft.h +++ b/frame/1m/bli_l1m_ft.h @@ -42,6 +42,8 @@ // packm +// NOTE: This is the function type for the structure-aware "kernel". + #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ @@ -83,29 +85,47 @@ INSERT_GENTDEF( packm ) \ typedef void (*PASTECH2(ch,opname,tsuf)) \ ( \ - conj_t conja, \ - dim_t n, \ - ctype* restrict kappa, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + ctype* restrict kappa, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ); INSERT_GENTDEF( packm_cxk_ker ) -INSERT_GENTDEF( packm_cxk_1er_ker ) - -// packm_3mis_ker +// unpackm_ker #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ typedef void (*PASTECH2(ch,opname,tsuf)) \ ( \ - conj_t conja, \ - dim_t n, \ - ctype* restrict kappa, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict p, inc_t is_p, inc_t ldp \ + conj_t conjp, \ + dim_t n, \ + ctype* restrict kappa, \ + ctype* restrict p, inc_t ldp, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ + ); + +INSERT_GENTDEF( unpackm_cxk_ker ) + +// packm_3mis_ker +// packm_4mi_ker + +#undef GENTDEF +#define GENTDEF( ctype, ch, opname, tsuf ) \ +\ +typedef void (*PASTECH2(ch,opname,tsuf)) \ + ( \ + conj_t conja, \ + dim_t n, \ + ctype* restrict kappa, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ); INSERT_GENTDEF( packm_cxk_3mis_ker ) @@ -113,21 +133,26 @@ INSERT_GENTDEF( packm_cxk_4mi_ker ) // packm_rih_ker +// packm_1er_ker #undef GENTDEF #define GENTDEF( ctype, ch, opname, tsuf ) \ \ typedef void (*PASTECH2(ch,opname,tsuf)) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - ctype* restrict kappa, \ - ctype* restrict a, inc_t inca, inc_t lda, \ - ctype* restrict p, inc_t ldp \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + ctype* restrict kappa, \ + ctype* restrict a, inc_t inca, inc_t lda, \ + ctype* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ); INSERT_GENTDEF( packm_cxk_rih_ker ) +INSERT_GENTDEF( packm_cxk_1er_ker ) + + diff --git a/frame/1m/bli_l1m_ker.h b/frame/1m/bli_l1m_ker.h index 9e9dbbdb7..cf73cd390 100644 --- a/frame/1m/bli_l1m_ker.h +++ b/frame/1m/bli_l1m_ker.h @@ -40,103 +40,96 @@ // native packm kernels #undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ); +#define GENTPROT PACKM_KER_PROT -INSERT_GENTPROT_BASIC( packm_2xk_ker_name ) -INSERT_GENTPROT_BASIC( packm_3xk_ker_name ) -INSERT_GENTPROT_BASIC( packm_4xk_ker_name ) -INSERT_GENTPROT_BASIC( packm_6xk_ker_name ) -INSERT_GENTPROT_BASIC( packm_8xk_ker_name ) -INSERT_GENTPROT_BASIC( packm_10xk_ker_name ) -INSERT_GENTPROT_BASIC( packm_12xk_ker_name ) -INSERT_GENTPROT_BASIC( packm_14xk_ker_name ) -INSERT_GENTPROT_BASIC( packm_16xk_ker_name ) -INSERT_GENTPROT_BASIC( packm_24xk_ker_name ) -INSERT_GENTPROT_BASIC( packm_30xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_2xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_3xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_4xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_6xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_8xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_10xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_12xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_14xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_16xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_24xk_ker_name ) +INSERT_GENTPROT_BASIC0( packm_30xk_ker_name ) + + +// native unpackm kernels + +#undef GENTPROT +#define GENTPROT UNPACKM_KER_PROT + +INSERT_GENTPROT_BASIC0( unpackm_2xk_ker_name ) +INSERT_GENTPROT_BASIC0( unpackm_4xk_ker_name ) +INSERT_GENTPROT_BASIC0( unpackm_6xk_ker_name ) +INSERT_GENTPROT_BASIC0( unpackm_8xk_ker_name ) +INSERT_GENTPROT_BASIC0( unpackm_10xk_ker_name ) +INSERT_GENTPROT_BASIC0( unpackm_12xk_ker_name ) +INSERT_GENTPROT_BASIC0( unpackm_14xk_ker_name ) +INSERT_GENTPROT_BASIC0( unpackm_16xk_ker_name ) // 3mis packm kernels #undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ - ); +#define GENTPROT PACKM_3MIS_KER_PROT -INSERT_GENTPROT_BASIC( packm_2xk_3mis_ker_name ) -INSERT_GENTPROT_BASIC( packm_4xk_3mis_ker_name ) -INSERT_GENTPROT_BASIC( packm_6xk_3mis_ker_name ) -INSERT_GENTPROT_BASIC( packm_8xk_3mis_ker_name ) -INSERT_GENTPROT_BASIC( packm_10xk_3mis_ker_name ) -INSERT_GENTPROT_BASIC( packm_12xk_3mis_ker_name ) -INSERT_GENTPROT_BASIC( packm_14xk_3mis_ker_name ) -INSERT_GENTPROT_BASIC( packm_16xk_3mis_ker_name ) -INSERT_GENTPROT_BASIC( packm_30xk_3mis_ker_name ) +INSERT_GENTPROT_BASIC0( packm_2xk_3mis_ker_name ) +INSERT_GENTPROT_BASIC0( packm_4xk_3mis_ker_name ) +INSERT_GENTPROT_BASIC0( packm_6xk_3mis_ker_name ) +INSERT_GENTPROT_BASIC0( packm_8xk_3mis_ker_name ) +INSERT_GENTPROT_BASIC0( packm_10xk_3mis_ker_name ) +INSERT_GENTPROT_BASIC0( packm_12xk_3mis_ker_name ) +INSERT_GENTPROT_BASIC0( packm_14xk_3mis_ker_name ) +INSERT_GENTPROT_BASIC0( packm_16xk_3mis_ker_name ) +INSERT_GENTPROT_BASIC0( packm_30xk_3mis_ker_name ) // 4mi packm kernels #undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ - ); +#define GENTPROT PACKM_4MI_KER_PROT -INSERT_GENTPROT_BASIC( packm_2xk_4mi_ker_name ) -INSERT_GENTPROT_BASIC( packm_4xk_4mi_ker_name ) -INSERT_GENTPROT_BASIC( packm_6xk_4mi_ker_name ) -INSERT_GENTPROT_BASIC( packm_8xk_4mi_ker_name ) -INSERT_GENTPROT_BASIC( packm_10xk_4mi_ker_name ) -INSERT_GENTPROT_BASIC( packm_12xk_4mi_ker_name ) -INSERT_GENTPROT_BASIC( packm_14xk_4mi_ker_name ) -INSERT_GENTPROT_BASIC( packm_16xk_4mi_ker_name ) -INSERT_GENTPROT_BASIC( packm_30xk_4mi_ker_name ) +INSERT_GENTPROT_BASIC0( packm_2xk_4mi_ker_name ) +INSERT_GENTPROT_BASIC0( packm_4xk_4mi_ker_name ) +INSERT_GENTPROT_BASIC0( packm_6xk_4mi_ker_name ) +INSERT_GENTPROT_BASIC0( packm_8xk_4mi_ker_name ) +INSERT_GENTPROT_BASIC0( packm_10xk_4mi_ker_name ) +INSERT_GENTPROT_BASIC0( packm_12xk_4mi_ker_name ) +INSERT_GENTPROT_BASIC0( packm_14xk_4mi_ker_name ) +INSERT_GENTPROT_BASIC0( packm_16xk_4mi_ker_name ) +INSERT_GENTPROT_BASIC0( packm_30xk_4mi_ker_name ) // rih packm kernels #undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ); +#define GENTPROT PACKM_RIH_KER_PROT -INSERT_GENTPROT_BASIC( packm_2xk_rih_ker_name ) -INSERT_GENTPROT_BASIC( packm_3xk_rih_ker_name ) -INSERT_GENTPROT_BASIC( packm_4xk_rih_ker_name ) -INSERT_GENTPROT_BASIC( packm_6xk_rih_ker_name ) -INSERT_GENTPROT_BASIC( packm_8xk_rih_ker_name ) -INSERT_GENTPROT_BASIC( packm_10xk_rih_ker_name ) -INSERT_GENTPROT_BASIC( packm_12xk_rih_ker_name ) -INSERT_GENTPROT_BASIC( packm_14xk_rih_ker_name ) -INSERT_GENTPROT_BASIC( packm_16xk_rih_ker_name ) -INSERT_GENTPROT_BASIC( packm_30xk_rih_ker_name ) +INSERT_GENTPROT_BASIC0( packm_2xk_rih_ker_name ) +INSERT_GENTPROT_BASIC0( packm_4xk_rih_ker_name ) +INSERT_GENTPROT_BASIC0( packm_6xk_rih_ker_name ) +INSERT_GENTPROT_BASIC0( packm_8xk_rih_ker_name ) +INSERT_GENTPROT_BASIC0( packm_10xk_rih_ker_name ) +INSERT_GENTPROT_BASIC0( packm_12xk_rih_ker_name ) +INSERT_GENTPROT_BASIC0( packm_14xk_rih_ker_name ) +INSERT_GENTPROT_BASIC0( packm_16xk_rih_ker_name ) +INSERT_GENTPROT_BASIC0( packm_30xk_rih_ker_name ) + + +// 1e/1r packm kernels + +#undef GENTPROT +#define GENTPROT PACKM_1ER_KER_PROT + +INSERT_GENTPROT_BASIC0( packm_2xk_1er_ker_name ) +INSERT_GENTPROT_BASIC0( packm_4xk_1er_ker_name ) +INSERT_GENTPROT_BASIC0( packm_6xk_1er_ker_name ) +INSERT_GENTPROT_BASIC0( packm_8xk_1er_ker_name ) +INSERT_GENTPROT_BASIC0( packm_10xk_1er_ker_name ) +INSERT_GENTPROT_BASIC0( packm_12xk_1er_ker_name ) +INSERT_GENTPROT_BASIC0( packm_14xk_1er_ker_name ) +INSERT_GENTPROT_BASIC0( packm_16xk_1er_ker_name ) +INSERT_GENTPROT_BASIC0( packm_30xk_1er_ker_name ) diff --git a/frame/1m/bli_l1m_ker_prot.h b/frame/1m/bli_l1m_ker_prot.h new file mode 100644 index 000000000..84ff05dfa --- /dev/null +++ b/frame/1m/bli_l1m_ker_prot.h @@ -0,0 +1,130 @@ +/* + + 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. + +*/ + + +// +// Define template prototypes for level-1m kernels. +// + +// native packm kernels + +#define PACKM_KER_PROT( ctype, ch, varname ) \ +\ +void PASTEMAC(ch,varname) \ + ( \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ); + + +// native unpackm kernels + +#define UNPACKM_KER_PROT( ctype, ch, varname ) \ +\ +void PASTEMAC(ch,varname) \ + ( \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict p, inc_t ldp, \ + void* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ + ); + + +// 3mis packm kernels + +#define PACKM_3MIS_KER_PROT( ctype, ch, varname ) \ +\ +void PASTEMAC(ch,varname) \ + ( \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ + ); + + +// 4mi packm kernels + +#define PACKM_4MI_KER_PROT( ctype, ch, varname ) \ +\ +void PASTEMAC(ch,varname) \ + ( \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ + ); + + +// rih packm kernels + +#define PACKM_RIH_KER_PROT( ctype, ch, varname ) \ +\ +void PASTEMAC(ch,varname) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ); + + +// 1e/1r packm kernels + +#define PACKM_1ER_KER_PROT( ctype, ch, varname ) \ +\ +void PASTEMAC(ch,varname) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ); + diff --git a/frame/1m/bli_l1m_tapi.c b/frame/1m/bli_l1m_tapi.c index 13da24e59..bae3bb517 100644 --- a/frame/1m/bli_l1m_tapi.c +++ b/frame/1m/bli_l1m_tapi.c @@ -54,13 +54,10 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ -\ if ( bli_zero_dim2( m, n ) ) return; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Invoke the helper variant, which loops over the appropriate kernel to implement the current operation. */ \ @@ -74,7 +71,7 @@ void PASTEMAC(ch,opname) \ n, \ x, rs_x, cs_x, \ y, rs_y, cs_y, \ - cntx_p \ + cntx \ ); \ \ /* When the diagonal of an upper- or lower-stored matrix is unit, @@ -91,12 +88,9 @@ void PASTEMAC(ch,opname) \ n, \ x, rs_x, cs_x, \ y, rs_y, cs_y, \ - cntx_p \ + cntx \ ); \ } \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC( addm, addd ) @@ -119,13 +113,10 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ -\ if ( bli_zero_dim2( m, n ) ) return; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Invoke the helper variant, which loops over the appropriate kernel to implement the current operation. */ \ @@ -139,7 +130,7 @@ void PASTEMAC(ch,opname) \ n, \ x, rs_x, cs_x, \ y, rs_y, cs_y, \ - cntx_p \ + cntx \ ); \ \ /* When the diagonal of an upper- or lower-stored matrix is unit, @@ -161,12 +152,9 @@ void PASTEMAC(ch,opname) \ n, \ one, \ y, rs_y, cs_y, \ - cntx_p \ + cntx \ ); \ } \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC0( copym ) @@ -189,16 +177,13 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ -\ if ( bli_zero_dim2( m, n ) ) return; \ \ /* If alpha is zero, then the entire operation is a no-op. */ \ if ( PASTEMAC(ch,eq0)( *alpha ) ) return; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Invoke the helper variant, which loops over the appropriate kernel to implement the current operation. */ \ @@ -213,7 +198,7 @@ void PASTEMAC(ch,opname) \ alpha, \ x, rs_x, cs_x, \ y, rs_y, cs_y, \ - cntx_p \ + cntx \ ); \ \ /* When the diagonal of an upper- or lower-stored matrix is unit, @@ -231,12 +216,9 @@ void PASTEMAC(ch,opname) \ alpha, \ x, rs_x, cs_x, \ y, rs_y, cs_y, \ - cntx_p \ + cntx \ ); \ } \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC0( axpym ) @@ -259,19 +241,17 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ -\ if ( bli_zero_dim2( m, n ) ) return; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* If alpha is zero, then we set the output matrix to zero. This seemingly minor optimization is important because it will clear any NaNs and Infs in x that would otherwise propogate. */ \ if ( PASTEMAC(ch,eq0)( *alpha ) ) \ { \ +\ PASTEMAC(ch,setm) \ ( \ BLIS_NO_CONJUGATE, \ @@ -282,7 +262,7 @@ void PASTEMAC(ch,opname) \ n, \ alpha, \ y, rs_y, cs_y, \ - cntx_p \ + cntx \ ); \ return; \ } \ @@ -300,7 +280,7 @@ void PASTEMAC(ch,opname) \ alpha, \ x, rs_x, cs_x, \ y, rs_y, cs_y, \ - cntx_p \ + cntx \ ); \ \ /* When the diagonal of an upper- or lower-stored matrix is unit, @@ -321,12 +301,9 @@ void PASTEMAC(ch,opname) \ n, \ alpha, \ y, rs_y, cs_y, \ - cntx_p \ + cntx \ ); \ } \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC0( scal2m ) @@ -348,13 +325,10 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ -\ if ( bli_zero_dim2( m, n ) ) return; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Invoke the helper variant, which loops over the appropriate kernel to implement the current operation. */ \ @@ -368,11 +342,8 @@ void PASTEMAC(ch,opname) \ n, \ alpha, \ x, rs_x, cs_x, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC0( scalm ) diff --git a/frame/1m/bli_l1m_tapi.h b/frame/1m/bli_l1m_tapi.h index 4b0551995..147f0f8bb 100644 --- a/frame/1m/bli_l1m_tapi.h +++ b/frame/1m/bli_l1m_tapi.h @@ -53,9 +53,9 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( addm ) -INSERT_GENTPROT_BASIC( copym ) -INSERT_GENTPROT_BASIC( subm ) +INSERT_GENTPROT_BASIC0( addm ) +INSERT_GENTPROT_BASIC0( copym ) +INSERT_GENTPROT_BASIC0( subm ) #undef GENTPROT @@ -75,8 +75,8 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( axpym ) -INSERT_GENTPROT_BASIC( scal2m ) +INSERT_GENTPROT_BASIC0( axpym ) +INSERT_GENTPROT_BASIC0( scal2m ) #undef GENTPROT @@ -95,6 +95,6 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( scalm ) -INSERT_GENTPROT_BASIC( setm ) +INSERT_GENTPROT_BASIC0( scalm ) +INSERT_GENTPROT_BASIC0( setm ) diff --git a/frame/1m/bli_l1m_unb_var1.h b/frame/1m/bli_l1m_unb_var1.h index 7a20d23ed..0a1df29b4 100644 --- a/frame/1m/bli_l1m_unb_var1.h +++ b/frame/1m/bli_l1m_unb_var1.h @@ -53,9 +53,9 @@ void PASTEMAC2(ch,opname,_unb_var1) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( addm ) -INSERT_GENTPROT_BASIC( copym ) -INSERT_GENTPROT_BASIC( subm ) +INSERT_GENTPROT_BASIC0( addm ) +INSERT_GENTPROT_BASIC0( copym ) +INSERT_GENTPROT_BASIC0( subm ) #undef GENTPROT @@ -75,8 +75,8 @@ void PASTEMAC2(ch,opname,_unb_var1) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( axpym ) -INSERT_GENTPROT_BASIC( scal2m ) +INSERT_GENTPROT_BASIC0( axpym ) +INSERT_GENTPROT_BASIC0( scal2m ) #undef GENTPROT @@ -95,6 +95,6 @@ void PASTEMAC2(ch,opname,_unb_var1) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( scalm ) -INSERT_GENTPROT_BASIC( setm ) +INSERT_GENTPROT_BASIC0( scalm ) +INSERT_GENTPROT_BASIC0( setm ) diff --git a/frame/1m/bli_l1m_cntx.c b/frame/1m/old/bli_l1m_cntx.c similarity index 100% rename from frame/1m/bli_l1m_cntx.c rename to frame/1m/old/bli_l1m_cntx.c diff --git a/frame/1m/bli_l1m_cntx.h b/frame/1m/old/bli_l1m_cntx.h similarity index 100% rename from frame/1m/bli_l1m_cntx.h rename to frame/1m/old/bli_l1m_cntx.h diff --git a/frame/1m/packm/bli_packm.h b/frame/1m/packm/bli_packm.h index 991487dfd..51b3f0e9c 100644 --- a/frame/1m/packm/bli_packm.h +++ b/frame/1m/packm/bli_packm.h @@ -33,7 +33,6 @@ */ #include "bli_packm_cntl.h" -#include "bli_packm_cntx.h" #include "bli_packm_check.h" #include "bli_packm_init.h" #include "bli_packm_int.h" diff --git a/frame/1m/packm/bli_packm_blk_var1.h b/frame/1m/packm/bli_packm_blk_var1.h index 4e04f86f9..a3955d395 100644 --- a/frame/1m/packm/bli_packm_blk_var1.h +++ b/frame/1m/packm/bli_packm_blk_var1.h @@ -70,5 +70,5 @@ void PASTEMAC(ch,varname) \ thrinfo_t* thread \ ); -INSERT_GENTPROT_BASIC( packm_blk_var1 ) +INSERT_GENTPROT_BASIC0( packm_blk_var1 ) diff --git a/frame/1m/packm/bli_packm_cxk.c b/frame/1m/packm/bli_packm_cxk.c index 4f167c355..54ad56358 100644 --- a/frame/1m/packm/bli_packm_cxk.c +++ b/frame/1m/packm/bli_packm_cxk.c @@ -34,204 +34,31 @@ #include "blis.h" -#define FUNCPTR_T packm_cxk_ker_vft - -#undef FUNCPTR_ARRAY_LENGTH -#define FUNCPTR_ARRAY_LENGTH 32 - -static FUNCPTR_T ftypes[FUNCPTR_ARRAY_LENGTH][BLIS_NUM_FP_TYPES] = -{ - /* micro-panel width = 0 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 1 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 2 */ - { - BLIS_SPACKM_2XK_KERNEL, - BLIS_CPACKM_2XK_KERNEL, - BLIS_DPACKM_2XK_KERNEL, - BLIS_ZPACKM_2XK_KERNEL, - }, - /* micro-panel width = 3 */ - { - BLIS_SPACKM_3XK_KERNEL, - BLIS_CPACKM_3XK_KERNEL, - BLIS_DPACKM_3XK_KERNEL, - BLIS_ZPACKM_3XK_KERNEL, - }, - /* micro-panel width = 4 */ - { - BLIS_SPACKM_4XK_KERNEL, - BLIS_CPACKM_4XK_KERNEL, - BLIS_DPACKM_4XK_KERNEL, - BLIS_ZPACKM_4XK_KERNEL, - }, - /* micro-panel width = 5 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 6 */ - { - BLIS_SPACKM_6XK_KERNEL, - BLIS_CPACKM_6XK_KERNEL, - BLIS_DPACKM_6XK_KERNEL, - BLIS_ZPACKM_6XK_KERNEL, - }, - /* micro-panel width = 7 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 8 */ - { - BLIS_SPACKM_8XK_KERNEL, - BLIS_CPACKM_8XK_KERNEL, - BLIS_DPACKM_8XK_KERNEL, - BLIS_ZPACKM_8XK_KERNEL, - }, - /* micro-panel width = 9 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 10 */ - { - BLIS_SPACKM_10XK_KERNEL, - BLIS_CPACKM_10XK_KERNEL, - BLIS_DPACKM_10XK_KERNEL, - BLIS_ZPACKM_10XK_KERNEL, - }, - /* micro-panel width = 11 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 12 */ - { - BLIS_SPACKM_12XK_KERNEL, - BLIS_CPACKM_12XK_KERNEL, - BLIS_DPACKM_12XK_KERNEL, - BLIS_ZPACKM_12XK_KERNEL, - }, - /* micro-panel width = 13 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 14 */ - { - BLIS_SPACKM_14XK_KERNEL, - BLIS_CPACKM_14XK_KERNEL, - BLIS_DPACKM_14XK_KERNEL, - BLIS_ZPACKM_14XK_KERNEL, - }, - /* micro-panel width = 15 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 16 */ - { - BLIS_SPACKM_16XK_KERNEL, - BLIS_CPACKM_16XK_KERNEL, - BLIS_DPACKM_16XK_KERNEL, - BLIS_ZPACKM_16XK_KERNEL, - }, - /* micro-panel width = 17 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 18 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 19 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 20 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 21 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 22 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 23 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 24 */ - { - BLIS_SPACKM_24XK_KERNEL, - BLIS_CPACKM_24XK_KERNEL, - BLIS_DPACKM_24XK_KERNEL, - BLIS_ZPACKM_24XK_KERNEL, - }, - /* micro-panel width = 25 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 26 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 27 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 28 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 29 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 30 */ - { - BLIS_SPACKM_30XK_KERNEL, - BLIS_CPACKM_30XK_KERNEL, - BLIS_DPACKM_30XK_KERNEL, - BLIS_ZPACKM_30XK_KERNEL, - }, - /* micro-panel width = 31 */ - { - NULL, NULL, NULL, NULL, - }, -}; - - +#define FUNCPTR_T packm_cxk_ker_ft #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC(ch,opname) \ ( \ conj_t conja, \ dim_t panel_dim, \ dim_t panel_len, \ - void* kappa, \ - void* a, inc_t inca, inc_t lda, \ - void* p, inc_t ldp, \ + ctype* kappa, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* p, inc_t ldp, \ cntx_t* cntx \ ) \ { \ - num_t dt; \ - FUNCPTR_T f; \ + num_t dt = PASTEMAC(ch,type); \ + l1mkr_t ker_id = panel_dim; \ \ - /* Acquire the datatype for the current function. */ \ - dt = PASTEMAC(ch,type); \ + PASTECH2(ch,opname,_ker_ft) f; \ \ - /* Index into the array to extract the correct function pointer. - If the micro-panel dimension is too big to be within the array of - explicitly handled kernels, then we treat that kernel the same - as if it were in range but unimplemented. */ \ - if ( panel_dim < FUNCPTR_ARRAY_LENGTH ) f = ftypes[panel_dim][dt]; \ - else f = NULL; \ + /* Query the context for the packm kernel corresponding to the current + panel dimension, or kernel id. If the id is invalid, the function will + return NULL. */ \ + f = bli_cntx_get_packm_ker_dt( dt, ker_id, cntx ); \ \ /* If there exists a kernel implementation for the micro-panel dimension provided, we invoke the implementation. Otherwise, we use scal2m. */ \ @@ -243,7 +70,8 @@ void PASTEMAC(ch,varname) \ panel_len, \ kappa, \ a, inca, lda, \ - p, ldp \ + p, ldp, \ + cntx \ ); \ } \ else \ diff --git a/frame/1m/packm/bli_packm_cxk.h b/frame/1m/packm/bli_packm_cxk.h index 322eaa4ad..485c9a123 100644 --- a/frame/1m/packm/bli_packm_cxk.h +++ b/frame/1m/packm/bli_packm_cxk.h @@ -32,8 +32,6 @@ */ -#include "bli_packm_cxk_ref.h" - #undef GENTPROT #define GENTPROT( ctype, ch, varname ) \ @@ -43,11 +41,11 @@ void PASTEMAC(ch,varname) \ conj_t conja, \ dim_t panel_dim, \ dim_t panel_len, \ - void* kappa, \ - void* a, inc_t inca, inc_t lda, \ - void* p, inc_t ldp, \ + ctype* kappa, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* p, inc_t ldp, \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( packm_cxk ) +INSERT_GENTPROT_BASIC0( packm_cxk ) diff --git a/frame/1m/packm/bli_packm_cxk_1er.c b/frame/1m/packm/bli_packm_cxk_1er.c index 352ae8353..fbddf3afe 100644 --- a/frame/1m/packm/bli_packm_cxk_1er.c +++ b/frame/1m/packm/bli_packm_cxk_1er.c @@ -34,328 +34,30 @@ #include "blis.h" -#define FUNCPTR_T packm_cxk_1er_ker_vft - -#undef FUNCPTR_ARRAY_LENGTH -#define FUNCPTR_ARRAY_LENGTH 32 - -static FUNCPTR_T ftypes_e[FUNCPTR_ARRAY_LENGTH][BLIS_NUM_FP_TYPES] = -{ - /* micro-panel width = 0 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 1 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 2 */ - { - NULL, BLIS_CPACKM_2XK_1E_KERNEL, - NULL, BLIS_ZPACKM_2XK_1E_KERNEL, - }, - /* micro-panel width = 3 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 4 */ - { - NULL, BLIS_CPACKM_4XK_1E_KERNEL, - NULL, BLIS_ZPACKM_4XK_1E_KERNEL, - }, - /* micro-panel width = 5 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 6 */ - { - NULL, BLIS_CPACKM_6XK_1E_KERNEL, - NULL, BLIS_ZPACKM_6XK_1E_KERNEL, - }, - /* micro-panel width = 7 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 8 */ - { - NULL, BLIS_CPACKM_8XK_1E_KERNEL, - NULL, BLIS_ZPACKM_8XK_1E_KERNEL, - }, - /* micro-panel width = 9 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 10 */ - { - NULL, BLIS_CPACKM_10XK_1E_KERNEL, - NULL, BLIS_ZPACKM_10XK_1E_KERNEL, - }, - /* micro-panel width = 11 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 12 */ - { - NULL, BLIS_CPACKM_12XK_1E_KERNEL, - NULL, BLIS_ZPACKM_12XK_1E_KERNEL, - }, - /* micro-panel width = 13 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 14 */ - { - NULL, BLIS_CPACKM_14XK_1E_KERNEL, - NULL, BLIS_ZPACKM_14XK_1E_KERNEL, - }, - /* micro-panel width = 15 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 16 */ - { - NULL, BLIS_CPACKM_16XK_1E_KERNEL, - NULL, BLIS_ZPACKM_16XK_1E_KERNEL, - }, - /* micro-panel width = 17 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 18 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 19 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 20 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 21 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 22 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 23 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 24 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 25 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 26 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 27 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 28 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 29 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 30 */ - { - NULL, BLIS_CPACKM_30XK_1E_KERNEL, - NULL, BLIS_ZPACKM_30XK_1E_KERNEL, - }, - /* micro-panel width = 31 */ - { - NULL, NULL, NULL, NULL, - }, -}; - -static FUNCPTR_T ftypes_r[FUNCPTR_ARRAY_LENGTH][BLIS_NUM_FP_TYPES] = -{ - /* micro-panel width = 0 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 1 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 2 */ - { - NULL, BLIS_CPACKM_2XK_1R_KERNEL, - NULL, BLIS_ZPACKM_2XK_1R_KERNEL, - }, - /* micro-panel width = 3 */ - { - NULL, BLIS_CPACKM_3XK_1R_KERNEL, - NULL, BLIS_ZPACKM_3XK_1R_KERNEL, - }, - /* micro-panel width = 4 */ - { - NULL, BLIS_CPACKM_4XK_1R_KERNEL, - NULL, BLIS_ZPACKM_4XK_1R_KERNEL, - }, - /* micro-panel width = 5 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 6 */ - { - NULL, BLIS_CPACKM_6XK_1R_KERNEL, - NULL, BLIS_ZPACKM_6XK_1R_KERNEL, - }, - /* micro-panel width = 7 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 8 */ - { - NULL, BLIS_CPACKM_8XK_1R_KERNEL, - NULL, BLIS_ZPACKM_8XK_1R_KERNEL, - }, - /* micro-panel width = 9 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 10 */ - { - NULL, BLIS_CPACKM_10XK_1R_KERNEL, - NULL, BLIS_ZPACKM_10XK_1R_KERNEL, - }, - /* micro-panel width = 11 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 12 */ - { - NULL, BLIS_CPACKM_12XK_1R_KERNEL, - NULL, BLIS_ZPACKM_12XK_1R_KERNEL, - }, - /* micro-panel width = 13 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 14 */ - { - NULL, BLIS_CPACKM_14XK_1R_KERNEL, - NULL, BLIS_ZPACKM_14XK_1R_KERNEL, - }, - /* micro-panel width = 15 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 16 */ - { - NULL, BLIS_CPACKM_16XK_1R_KERNEL, - NULL, BLIS_ZPACKM_16XK_1R_KERNEL, - }, - /* micro-panel width = 17 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 18 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 19 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 20 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 21 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 22 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 23 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 24 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 25 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 26 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 27 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 28 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 29 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 30 */ - { - NULL, BLIS_CPACKM_30XK_1R_KERNEL, - NULL, BLIS_ZPACKM_30XK_1R_KERNEL, - }, - /* micro-panel width = 31 */ - { - NULL, NULL, NULL, NULL, - }, -}; - - - - #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC(ch,opname) \ ( \ conj_t conja, \ pack_t schema, \ dim_t panel_dim, \ dim_t panel_len, \ - void* kappa, \ - void* a, inc_t inca, inc_t lda, \ - void* p, inc_t ldp, \ + ctype* kappa, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* p, inc_t ldp, \ cntx_t* cntx \ ) \ { \ - num_t dt; \ - FUNCPTR_T f; \ + num_t dt = PASTEMAC(ch,type); \ + l1mkr_t ker_id = panel_dim; \ \ - /* Acquire the datatype for the current function. */ \ - dt = PASTEMAC(ch,type); \ + PASTECH2(ch,opname,_ker_ft) f; \ \ - /* Index into the array to extract the correct function pointer. - If the micro-panel dimension is too big to be within the array of - explicitly handled kernels, then we treat that kernel the same - as if it were in range but unimplemented. */ \ - if ( panel_dim < FUNCPTR_ARRAY_LENGTH ) \ - { \ - if ( bli_is_1e_packed( schema ) ) f = ftypes_e[panel_dim][dt]; \ - else /*( bli_is_1r_packed( schema ) )*/ f = ftypes_r[panel_dim][dt]; \ - } \ - else f = NULL; \ + /* Query the context for the packm kernel corresponding to the current + panel dimension, or kernel id. If the id is invalid, the function will + return NULL. */ \ + f = bli_cntx_get_packm_ker_dt( dt, ker_id, cntx ); \ \ /* If there exists a kernel implementation for the micro-panel dimension provided, we invoke the implementation. Otherwise, we use scal2m. */ \ @@ -364,10 +66,12 @@ void PASTEMAC(ch,varname) \ f \ ( \ conja, \ + schema, \ panel_len, \ kappa, \ a, inca, lda, \ - p, ldp \ + p, ldp, \ + cntx \ ); \ } \ else \ diff --git a/frame/1m/packm/bli_packm_cxk_1er.h b/frame/1m/packm/bli_packm_cxk_1er.h index bd87216d0..bb46c02c1 100644 --- a/frame/1m/packm/bli_packm_cxk_1er.h +++ b/frame/1m/packm/bli_packm_cxk_1er.h @@ -32,9 +32,6 @@ */ -#include "bli_packm_cxk_1e_ref.h" -#include "bli_packm_cxk_1r_ref.h" - #undef GENTPROTCO #define GENTPROTCO( ctype, ctype_r, ch, chr, varname ) \ @@ -45,11 +42,11 @@ void PASTEMAC(ch,varname) \ pack_t schema, \ dim_t panel_dim, \ dim_t panel_len, \ - void* kappa, \ - void* a, inc_t inca, inc_t lda, \ - void* p, inc_t ldp, \ + ctype* kappa, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* p, inc_t ldp, \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_cxk_1er ) +INSERT_GENTPROTCO_BASIC0( packm_cxk_1er ) diff --git a/frame/1m/packm/bli_packm_cxk_3mis.c b/frame/1m/packm/bli_packm_cxk_3mis.c index da1ee28ca..6c9fa2795 100644 --- a/frame/1m/packm/bli_packm_cxk_3mis.c +++ b/frame/1m/packm/bli_packm_cxk_3mis.c @@ -34,182 +34,29 @@ #include "blis.h" -#define FUNCPTR_T packm_cxk_3mis_ker_vft - -#undef FUNCPTR_ARRAY_LENGTH -#define FUNCPTR_ARRAY_LENGTH 32 - -static FUNCPTR_T ftypes[FUNCPTR_ARRAY_LENGTH][BLIS_NUM_FP_TYPES] = -{ - /* micro-panel width = 0 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 1 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 2 */ - { - NULL, BLIS_CPACKM_2XK_3MIS_KERNEL, - NULL, BLIS_ZPACKM_2XK_3MIS_KERNEL, - }, - /* micro-panel width = 3 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 4 */ - { - NULL, BLIS_CPACKM_4XK_3MIS_KERNEL, - NULL, BLIS_ZPACKM_4XK_3MIS_KERNEL, - }, - /* micro-panel width = 5 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 6 */ - { - NULL, BLIS_CPACKM_6XK_3MIS_KERNEL, - NULL, BLIS_ZPACKM_6XK_3MIS_KERNEL, - }, - /* micro-panel width = 7 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 8 */ - { - NULL, BLIS_CPACKM_8XK_3MIS_KERNEL, - NULL, BLIS_ZPACKM_8XK_3MIS_KERNEL, - }, - /* micro-panel width = 9 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 10 */ - { - NULL, BLIS_CPACKM_10XK_3MIS_KERNEL, - NULL, BLIS_ZPACKM_10XK_3MIS_KERNEL, - }, - /* micro-panel width = 11 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 12 */ - { - NULL, BLIS_CPACKM_12XK_3MIS_KERNEL, - NULL, BLIS_ZPACKM_12XK_3MIS_KERNEL, - }, - /* micro-panel width = 13 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 14 */ - { - NULL, BLIS_CPACKM_14XK_3MIS_KERNEL, - NULL, BLIS_ZPACKM_14XK_3MIS_KERNEL, - }, - /* micro-panel width = 15 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 16 */ - { - NULL, BLIS_CPACKM_16XK_3MIS_KERNEL, - NULL, BLIS_ZPACKM_16XK_3MIS_KERNEL, - }, - /* micro-panel width = 17 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 18 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 19 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 20 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 21 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 22 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 23 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 24 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 25 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 26 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 27 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 28 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 29 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 30 */ - { - NULL, - BLIS_CPACKM_30XK_3MIS_KERNEL, - NULL, - BLIS_ZPACKM_30XK_3MIS_KERNEL, - }, - /* micro-panel width = 31 */ - { - NULL, NULL, NULL, NULL, - }, -}; - - - #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC(ch,opname) \ ( \ conj_t conja, \ dim_t panel_dim, \ dim_t panel_len, \ - void* kappa, \ - void* a, inc_t inca, inc_t lda, \ - void* p, inc_t is_p, inc_t ldp, \ + ctype* kappa, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* p, inc_t is_p, inc_t ldp, \ cntx_t* cntx \ ) \ { \ - num_t dt; \ - FUNCPTR_T f; \ + num_t dt = PASTEMAC(ch,type); \ + l1mkr_t ker_id = panel_dim; \ \ - /* Acquire the datatype for the current function. */ \ - dt = PASTEMAC(ch,type); \ + PASTECH2(ch,opname,_ker_ft) f; \ \ - /* Index into the array to extract the correct function pointer. - If the micro-panel dimension is too big to be within the array of - explicitly handled kernels, then we treat that kernel the same - as if it were in range but unimplemented. */ \ - if ( panel_dim < FUNCPTR_ARRAY_LENGTH ) f = ftypes[panel_dim][dt]; \ - else f = NULL; \ + /* Query the context for the packm kernel corresponding to the current + panel dimension, or kernel id. If the id is invalid, the function will + return NULL. */ \ + f = bli_cntx_get_packm_ker_dt( dt, ker_id, cntx ); \ \ /* If there exists a kernel implementation for the micro-panel dimension provided, we invoke the implementation. Otherwise, we use scal2m. */ \ @@ -221,7 +68,8 @@ void PASTEMAC(ch,varname) \ panel_len, \ kappa, \ a, inca, lda, \ - p, is_p, ldp \ + p, is_p, ldp, \ + cntx \ ); \ } \ else \ diff --git a/frame/1m/packm/bli_packm_cxk_3mis.h b/frame/1m/packm/bli_packm_cxk_3mis.h index f60e78c9e..0e47baffe 100644 --- a/frame/1m/packm/bli_packm_cxk_3mis.h +++ b/frame/1m/packm/bli_packm_cxk_3mis.h @@ -32,8 +32,6 @@ */ -#include "bli_packm_cxk_3mis_ref.h" - #undef GENTPROTCO #define GENTPROTCO( ctype, ctype_r, ch, chr, varname ) \ @@ -43,11 +41,11 @@ void PASTEMAC(ch,varname) \ conj_t conja, \ dim_t panel_dim, \ dim_t panel_len, \ - void* kappa, \ - void* a, inc_t inca, inc_t lda, \ - void* p, inc_t is_p, inc_t ldp, \ + ctype* kappa, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* p, inc_t is_p, inc_t ldp, \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_cxk_3mis ) +INSERT_GENTPROTCO_BASIC0( packm_cxk_3mis ) diff --git a/frame/1m/packm/bli_packm_cxk_4mi.c b/frame/1m/packm/bli_packm_cxk_4mi.c index 2a906fac6..f920ee78d 100644 --- a/frame/1m/packm/bli_packm_cxk_4mi.c +++ b/frame/1m/packm/bli_packm_cxk_4mi.c @@ -34,182 +34,29 @@ #include "blis.h" -#define FUNCPTR_T packm_cxk_4mi_ker_vft - -#undef FUNCPTR_ARRAY_LENGTH -#define FUNCPTR_ARRAY_LENGTH 32 - -static FUNCPTR_T ftypes[FUNCPTR_ARRAY_LENGTH][BLIS_NUM_FP_TYPES] = -{ - /* micro-panel width = 0 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 1 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 2 */ - { - NULL, BLIS_CPACKM_2XK_4MI_KERNEL, - NULL, BLIS_ZPACKM_2XK_4MI_KERNEL, - }, - /* micro-panel width = 3 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 4 */ - { - NULL, BLIS_CPACKM_4XK_4MI_KERNEL, - NULL, BLIS_ZPACKM_4XK_4MI_KERNEL, - }, - /* micro-panel width = 5 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 6 */ - { - NULL, BLIS_CPACKM_6XK_4MI_KERNEL, - NULL, BLIS_ZPACKM_6XK_4MI_KERNEL, - }, - /* micro-panel width = 7 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 8 */ - { - NULL, BLIS_CPACKM_8XK_4MI_KERNEL, - NULL, BLIS_ZPACKM_8XK_4MI_KERNEL, - }, - /* micro-panel width = 9 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 10 */ - { - NULL, BLIS_CPACKM_10XK_4MI_KERNEL, - NULL, BLIS_ZPACKM_10XK_4MI_KERNEL, - }, - /* micro-panel width = 11 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 12 */ - { - NULL, BLIS_CPACKM_12XK_4MI_KERNEL, - NULL, BLIS_ZPACKM_12XK_4MI_KERNEL, - }, - /* micro-panel width = 13 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 14 */ - { - NULL, BLIS_CPACKM_14XK_4MI_KERNEL, - NULL, BLIS_ZPACKM_14XK_4MI_KERNEL, - }, - /* micro-panel width = 15 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 16 */ - { - NULL, BLIS_CPACKM_16XK_4MI_KERNEL, - NULL, BLIS_ZPACKM_16XK_4MI_KERNEL, - }, - /* micro-panel width = 17 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 18 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 19 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 20 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 21 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 22 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 23 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 24 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 25 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 26 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 27 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 28 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 29 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 30 */ - { - NULL, - BLIS_CPACKM_30XK_4MI_KERNEL, - NULL, - BLIS_ZPACKM_30XK_4MI_KERNEL, - }, - /* micro-panel width = 31 */ - { - NULL, NULL, NULL, NULL, - }, -}; - - - #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC(ch,opname) \ ( \ conj_t conja, \ dim_t panel_dim, \ dim_t panel_len, \ - void* kappa, \ - void* a, inc_t inca, inc_t lda, \ - void* p, inc_t is_p, inc_t ldp, \ + ctype* kappa, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* p, inc_t is_p, inc_t ldp, \ cntx_t* cntx \ ) \ { \ - num_t dt; \ - FUNCPTR_T f; \ + num_t dt = PASTEMAC(ch,type); \ + l1mkr_t ker_id = panel_dim; \ \ - /* Acquire the datatype for the current function. */ \ - dt = PASTEMAC(ch,type); \ + PASTECH2(ch,opname,_ker_ft) f; \ \ - /* Index into the array to extract the correct function pointer. - If the micro-panel dimension is too big to be within the array of - explicitly handled kernels, then we treat that kernel the same - as if it were in range but unimplemented. */ \ - if ( panel_dim < FUNCPTR_ARRAY_LENGTH ) f = ftypes[panel_dim][dt]; \ - else f = NULL; \ + /* Query the context for the packm kernel corresponding to the current + panel dimension, or kernel id. If the id is invalid, the function will + return NULL. */ \ + f = bli_cntx_get_packm_ker_dt( dt, ker_id, cntx ); \ \ /* If there exists a kernel implementation for the micro-panel dimension provided, we invoke the implementation. Otherwise, we use scal2m. */ \ @@ -221,7 +68,8 @@ void PASTEMAC(ch,varname) \ panel_len, \ kappa, \ a, inca, lda, \ - p, is_p, ldp \ + p, is_p, ldp, \ + cntx \ ); \ } \ else \ diff --git a/frame/1m/packm/bli_packm_cxk_4mi.h b/frame/1m/packm/bli_packm_cxk_4mi.h index dd9520d6d..e8e19c7f7 100644 --- a/frame/1m/packm/bli_packm_cxk_4mi.h +++ b/frame/1m/packm/bli_packm_cxk_4mi.h @@ -32,8 +32,6 @@ */ -#include "bli_packm_cxk_4mi_ref.h" - #undef GENTPROTCO #define GENTPROTCO( ctype, ctype_r, ch, chr, varname ) \ @@ -43,11 +41,11 @@ void PASTEMAC(ch,varname) \ conj_t conja, \ dim_t panel_dim, \ dim_t panel_len, \ - void* kappa, \ - void* a, inc_t inca, inc_t lda, \ - void* p, inc_t is_p, inc_t ldp, \ + ctype* kappa, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* p, inc_t is_p, inc_t ldp, \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_cxk_4mi ) +INSERT_GENTPROTCO_BASIC0( packm_cxk_4mi ) diff --git a/frame/1m/packm/bli_packm_cxk_rih.c b/frame/1m/packm/bli_packm_cxk_rih.c index f019eed0b..2ebb167d9 100644 --- a/frame/1m/packm/bli_packm_cxk_rih.c +++ b/frame/1m/packm/bli_packm_cxk_rih.c @@ -34,181 +34,30 @@ #include "blis.h" -#define FUNCPTR_T packm_cxk_rih_ker_vft - -#undef FUNCPTR_ARRAY_LENGTH -#define FUNCPTR_ARRAY_LENGTH 32 - -static FUNCPTR_T ftypes_rih[FUNCPTR_ARRAY_LENGTH][BLIS_NUM_FP_TYPES] = -{ - /* micro-panel width = 0 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 1 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 2 */ - { - NULL, BLIS_CPACKM_2XK_RIH_KERNEL, - NULL, BLIS_ZPACKM_2XK_RIH_KERNEL, - }, - /* micro-panel width = 3 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 4 */ - { - NULL, BLIS_CPACKM_4XK_RIH_KERNEL, - NULL, BLIS_ZPACKM_4XK_RIH_KERNEL, - }, - /* micro-panel width = 5 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 6 */ - { - NULL, BLIS_CPACKM_6XK_RIH_KERNEL, - NULL, BLIS_ZPACKM_6XK_RIH_KERNEL, - }, - /* micro-panel width = 7 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 8 */ - { - NULL, BLIS_CPACKM_8XK_RIH_KERNEL, - NULL, BLIS_ZPACKM_8XK_RIH_KERNEL, - }, - /* micro-panel width = 9 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 10 */ - { - NULL, BLIS_CPACKM_10XK_RIH_KERNEL, - NULL, BLIS_ZPACKM_10XK_RIH_KERNEL, - }, - /* micro-panel width = 11 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 12 */ - { - NULL, BLIS_CPACKM_12XK_RIH_KERNEL, - NULL, BLIS_ZPACKM_12XK_RIH_KERNEL, - }, - /* micro-panel width = 13 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 14 */ - { - NULL, BLIS_CPACKM_14XK_RIH_KERNEL, - NULL, BLIS_ZPACKM_14XK_RIH_KERNEL, - }, - /* micro-panel width = 15 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 16 */ - { - NULL, BLIS_CPACKM_16XK_RIH_KERNEL, - NULL, BLIS_ZPACKM_16XK_RIH_KERNEL, - }, - /* micro-panel width = 17 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 18 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 19 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 20 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 21 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 22 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 23 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 24 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 25 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 26 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 27 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 28 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 29 */ - { - NULL, NULL, NULL, NULL, - }, - /* micro-panel width = 30 */ - { - NULL, BLIS_CPACKM_30XK_RIH_KERNEL, - NULL, BLIS_ZPACKM_30XK_RIH_KERNEL, - }, - /* micro-panel width = 31 */ - { - NULL, NULL, NULL, NULL, - }, -}; - - - #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC(ch,opname) \ ( \ conj_t conja, \ pack_t schema, \ dim_t panel_dim, \ dim_t panel_len, \ - void* kappa, \ - void* a, inc_t inca, inc_t lda, \ - void* p, inc_t ldp, \ + ctype* kappa, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* p, inc_t ldp, \ cntx_t* cntx \ ) \ { \ - num_t dt; \ - FUNCPTR_T f; \ + num_t dt = PASTEMAC(ch,type); \ + l1mkr_t ker_id = panel_dim; \ \ - /* Acquire the datatype for the current function. */ \ - dt = PASTEMAC(ch,type); \ + PASTECH2(ch,opname,_ker_ft) f; \ \ - /* Index into the array to extract the correct function pointer. - If the micro-panel dimension is too big to be within the array of - explicitly handled kernels, then we treat that kernel the same - as if it were in range but unimplemented. */ \ - if ( panel_dim < FUNCPTR_ARRAY_LENGTH ) f = ftypes_rih[panel_dim][dt]; \ - else f = NULL; \ + /* Query the context for the packm kernel corresponding to the current + panel dimension, or kernel id. If the id is invalid, the function will + return NULL. */ \ + f = bli_cntx_get_packm_ker_dt( dt, ker_id, cntx ); \ \ /* If there exists a kernel implementation for the micro-panel dimension provided, we invoke the implementation. Otherwise, we use scal2m. */ \ @@ -221,7 +70,8 @@ void PASTEMAC(ch,varname) \ panel_len, \ kappa, \ a, inca, lda, \ - p, ldp \ + p, ldp, \ + cntx \ ); \ } \ else \ diff --git a/frame/1m/packm/bli_packm_cxk_rih.h b/frame/1m/packm/bli_packm_cxk_rih.h index 23462da6f..bb4f0191e 100644 --- a/frame/1m/packm/bli_packm_cxk_rih.h +++ b/frame/1m/packm/bli_packm_cxk_rih.h @@ -32,8 +32,6 @@ */ -#include "bli_packm_cxk_rih_ref.h" - #undef GENTPROTCO #define GENTPROTCO( ctype, ctype_r, ch, chr, varname ) \ @@ -44,11 +42,11 @@ void PASTEMAC(ch,varname) \ pack_t schema, \ dim_t panel_dim, \ dim_t panel_len, \ - void* kappa, \ - void* a, inc_t inca, inc_t lda, \ - void* p, inc_t ldp, \ + ctype* kappa, \ + ctype* a, inc_t inca, inc_t lda, \ + ctype* p, inc_t ldp, \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_cxk_rih ) +INSERT_GENTPROTCO_BASIC0( packm_cxk_rih ) diff --git a/frame/1m/packm/bli_packm_init.c b/frame/1m/packm/bli_packm_init.c index d828f698d..6e51231f1 100644 --- a/frame/1m/packm/bli_packm_init.c +++ b/frame/1m/packm/bli_packm_init.c @@ -121,11 +121,11 @@ siz_t bli_packm_init if ( pack_buf_type == BLIS_BUFFER_FOR_A_BLOCK ) { - schema = bli_cntx_get_pack_schema_a_block( cntx ); + schema = bli_cntx_schema_a_block( cntx ); } else if ( pack_buf_type == BLIS_BUFFER_FOR_B_PANEL ) { - schema = bli_cntx_get_pack_schema_b_panel( cntx ); + schema = bli_cntx_schema_b_panel( cntx ); } else // if ( pack_buf_type == BLIS_BUFFER_FOR_C_PANEL ) { diff --git a/frame/1m/packm/bli_packm_struc_cxk.h b/frame/1m/packm/bli_packm_struc_cxk.h index 506cdb881..4ba251d3a 100644 --- a/frame/1m/packm/bli_packm_struc_cxk.h +++ b/frame/1m/packm/bli_packm_struc_cxk.h @@ -55,7 +55,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( packm_struc_cxk ) +INSERT_GENTPROT_BASIC0( packm_struc_cxk ) @@ -83,7 +83,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( packm_herm_cxk ) +INSERT_GENTPROT_BASIC0( packm_herm_cxk ) @@ -113,5 +113,5 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( packm_tri_cxk ) +INSERT_GENTPROT_BASIC0( packm_tri_cxk ) diff --git a/frame/1m/packm/bli_packm_struc_cxk_1er.h b/frame/1m/packm/bli_packm_struc_cxk_1er.h index b0b1d0a2f..ab1cad135 100644 --- a/frame/1m/packm/bli_packm_struc_cxk_1er.h +++ b/frame/1m/packm/bli_packm_struc_cxk_1er.h @@ -55,7 +55,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_struc_cxk_1er ) +INSERT_GENTPROTCO_BASIC0( packm_struc_cxk_1er ) @@ -83,7 +83,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_herm_cxk_1er ) +INSERT_GENTPROTCO_BASIC0( packm_herm_cxk_1er ) @@ -113,5 +113,5 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_tri_cxk_1er ) +INSERT_GENTPROTCO_BASIC0( packm_tri_cxk_1er ) diff --git a/frame/1m/packm/bli_packm_struc_cxk_3mis.c b/frame/1m/packm/bli_packm_struc_cxk_3mis.c index 97c232e47..325ea5941 100644 --- a/frame/1m/packm/bli_packm_struc_cxk_3mis.c +++ b/frame/1m/packm/bli_packm_struc_cxk_3mis.c @@ -473,8 +473,8 @@ void PASTEMAC(ch,varname) \ p10_dim, \ p10_len, \ kappa, \ - c10, incc10, ldc10, \ - p10, is_p, ldp, \ + c10, incc10, ldc10, \ + ( ctype* )p10, is_p, ldp, \ cntx \ ); \ \ @@ -486,8 +486,8 @@ void PASTEMAC(ch,varname) \ p12_dim, \ p12_len, \ kappa, \ - c12, incc12, ldc12, \ - p12, is_p, ldp, \ + c12, incc12, ldc12, \ + ( ctype* )p12, is_p, ldp, \ cntx \ ); \ \ diff --git a/frame/1m/packm/bli_packm_struc_cxk_3mis.h b/frame/1m/packm/bli_packm_struc_cxk_3mis.h index e3419faeb..60b9ae9d8 100644 --- a/frame/1m/packm/bli_packm_struc_cxk_3mis.h +++ b/frame/1m/packm/bli_packm_struc_cxk_3mis.h @@ -55,7 +55,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_struc_cxk_3mis ) +INSERT_GENTPROTCO_BASIC0( packm_struc_cxk_3mis ) @@ -83,7 +83,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_herm_cxk_3mis ) +INSERT_GENTPROTCO_BASIC0( packm_herm_cxk_3mis ) @@ -113,5 +113,5 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_tri_cxk_3mis ) +INSERT_GENTPROTCO_BASIC0( packm_tri_cxk_3mis ) diff --git a/frame/1m/packm/bli_packm_struc_cxk_4mi.c b/frame/1m/packm/bli_packm_struc_cxk_4mi.c index ae9f24fd9..f6b002d18 100644 --- a/frame/1m/packm/bli_packm_struc_cxk_4mi.c +++ b/frame/1m/packm/bli_packm_struc_cxk_4mi.c @@ -447,8 +447,8 @@ void PASTEMAC(ch,varname) \ p10_dim, \ p10_len, \ kappa, \ - c10, incc10, ldc10, \ - p10, is_p, ldp, \ + c10, incc10, ldc10, \ + ( ctype* )p10, is_p, ldp, \ cntx \ ); \ \ @@ -460,8 +460,8 @@ void PASTEMAC(ch,varname) \ p12_dim, \ p12_len, \ kappa, \ - c12, incc12, ldc12, \ - p12, is_p, ldp, \ + c12, incc12, ldc12, \ + ( ctype* )p12, is_p, ldp, \ cntx \ ); \ \ diff --git a/frame/1m/packm/bli_packm_struc_cxk_4mi.h b/frame/1m/packm/bli_packm_struc_cxk_4mi.h index ddc420420..5d7b5b43e 100644 --- a/frame/1m/packm/bli_packm_struc_cxk_4mi.h +++ b/frame/1m/packm/bli_packm_struc_cxk_4mi.h @@ -55,7 +55,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_struc_cxk_4mi ) +INSERT_GENTPROTCO_BASIC0( packm_struc_cxk_4mi ) @@ -83,7 +83,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_herm_cxk_4mi ) +INSERT_GENTPROTCO_BASIC0( packm_herm_cxk_4mi ) @@ -113,5 +113,5 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_tri_cxk_4mi ) +INSERT_GENTPROTCO_BASIC0( packm_tri_cxk_4mi ) diff --git a/frame/1m/packm/bli_packm_struc_cxk_rih.c b/frame/1m/packm/bli_packm_struc_cxk_rih.c index 96985f335..34176f01e 100644 --- a/frame/1m/packm/bli_packm_struc_cxk_rih.c +++ b/frame/1m/packm/bli_packm_struc_cxk_rih.c @@ -414,8 +414,8 @@ void PASTEMAC(ch,varname) \ p10_dim, \ p10_len, \ kappa, \ - c10, incc10, ldc10, \ - p10, ldp, \ + c10, incc10, ldc10, \ + ( ctype* )p10, ldp, \ cntx \ ); \ \ @@ -428,8 +428,8 @@ void PASTEMAC(ch,varname) \ p12_dim, \ p12_len, \ kappa, \ - c12, incc12, ldc12, \ - p12, ldp, \ + c12, incc12, ldc12, \ + ( ctype* )p12, ldp, \ cntx \ ); \ \ diff --git a/frame/1m/packm/bli_packm_struc_cxk_rih.h b/frame/1m/packm/bli_packm_struc_cxk_rih.h index 490d1935a..c3ba89520 100644 --- a/frame/1m/packm/bli_packm_struc_cxk_rih.h +++ b/frame/1m/packm/bli_packm_struc_cxk_rih.h @@ -55,7 +55,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_struc_cxk_rih ) +INSERT_GENTPROTCO_BASIC0( packm_struc_cxk_rih ) @@ -83,7 +83,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_herm_cxk_rih ) +INSERT_GENTPROTCO_BASIC0( packm_herm_cxk_rih ) @@ -113,5 +113,5 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTCO_BASIC( packm_tri_cxk_rih ) +INSERT_GENTPROTCO_BASIC0( packm_tri_cxk_rih ) diff --git a/frame/1m/packm/bli_packm_unb_var1.h b/frame/1m/packm/bli_packm_unb_var1.h index cefd4de94..338e2c586 100644 --- a/frame/1m/packm/bli_packm_unb_var1.h +++ b/frame/1m/packm/bli_packm_unb_var1.h @@ -62,5 +62,5 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( packm_unb_var1 ) +INSERT_GENTPROT_BASIC0( packm_unb_var1 ) diff --git a/frame/1m/packm/bli_packm_cntx.c b/frame/1m/packm/old/bli_packm_cntx.c similarity index 100% rename from frame/1m/packm/bli_packm_cntx.c rename to frame/1m/packm/old/bli_packm_cntx.c diff --git a/frame/1m/packm/bli_packm_cntx.h b/frame/1m/packm/old/bli_packm_cntx.h similarity index 100% rename from frame/1m/packm/bli_packm_cntx.h rename to frame/1m/packm/old/bli_packm_cntx.h diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_1e_ref.c b/frame/1m/packm/ukernels/bli_packm_cxk_1e_ref.c deleted file mode 100644 index 9f2acdce8..000000000 --- a/frame/1m/packm/ukernels/bli_packm_cxk_1e_ref.c +++ /dev/null @@ -1,1099 +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. - -*/ - -#include "blis.h" - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca1 = inca; \ - const inc_t lda1 = lda; \ - const inc_t ldp1 = ldp; \ -\ - ctype* restrict kappa_cast = ( ctype* )kappa; \ - ctype* restrict alpha1_ri = ( ctype* )a; \ - ctype* restrict pi1_ri = ( ctype* )p; \ - ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_2xk_1e_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca1 = inca; \ - const inc_t lda1 = lda; \ - const inc_t ldp1 = ldp; \ -\ - ctype* restrict kappa_cast = ( ctype* )kappa; \ - ctype* restrict alpha1_ri = ( ctype* )a; \ - ctype* restrict pi1_ri = ( ctype* )p; \ - ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_4xk_1e_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca1 = inca; \ - const inc_t lda1 = lda; \ - const inc_t ldp1 = ldp; \ -\ - ctype* restrict kappa_cast = ( ctype* )kappa; \ - ctype* restrict alpha1_ri = ( ctype* )a; \ - ctype* restrict pi1_ri = ( ctype* )p; \ - ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_6xk_1e_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca1 = inca; \ - const inc_t lda1 = lda; \ - const inc_t ldp1 = ldp; \ -\ - ctype* restrict kappa_cast = ( ctype* )kappa; \ - ctype* restrict alpha1_ri = ( ctype* )a; \ - ctype* restrict pi1_ri = ( ctype* )p; \ - ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_8xk_1e_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca1 = inca; \ - const inc_t lda1 = lda; \ - const inc_t ldp1 = ldp; \ -\ - ctype* restrict kappa_cast = ( ctype* )kappa; \ - ctype* restrict alpha1_ri = ( ctype* )a; \ - ctype* restrict pi1_ri = ( ctype* )p; \ - ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_10xk_1e_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca1 = inca; \ - const inc_t lda1 = lda; \ - const inc_t ldp1 = ldp; \ -\ - ctype* restrict kappa_cast = ( ctype* )kappa; \ - ctype* restrict alpha1_ri = ( ctype* )a; \ - ctype* restrict pi1_ri = ( ctype* )p; \ - ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_12xk_1e_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca1 = inca; \ - const inc_t lda1 = lda; \ - const inc_t ldp1 = ldp; \ -\ - ctype* restrict kappa_cast = ( ctype* )kappa; \ - ctype* restrict alpha1_ri = ( ctype* )a; \ - ctype* restrict pi1_ri = ( ctype* )p; \ - ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_14xk_1e_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca1 = inca; \ - const inc_t lda1 = lda; \ - const inc_t ldp1 = ldp; \ -\ - ctype* restrict kappa_cast = ( ctype* )kappa; \ - ctype* restrict alpha1_ri = ( ctype* )a; \ - ctype* restrict pi1_ri = ( ctype* )p; \ - ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_16xk_1e_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca1 = inca; \ - const inc_t lda1 = lda; \ - const inc_t ldp1 = ldp; \ -\ - ctype* restrict kappa_cast = ( ctype* )kappa; \ - ctype* restrict alpha1_ri = ( ctype* )a; \ - ctype* restrict pi1_ri = ( ctype* )p; \ - ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +16*inca1), *(pi1_ri +16), *(pi1_ir +16) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +17*inca1), *(pi1_ri +17), *(pi1_ir +17) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +18*inca1), *(pi1_ri +18), *(pi1_ir +18) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +19*inca1), *(pi1_ri +19), *(pi1_ir +19) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +20*inca1), *(pi1_ri +20), *(pi1_ir +20) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +21*inca1), *(pi1_ri +21), *(pi1_ir +21) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +22*inca1), *(pi1_ri +22), *(pi1_ir +22) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +23*inca1), *(pi1_ri +23), *(pi1_ir +23) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +24*inca1), *(pi1_ri +24), *(pi1_ir +24) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +25*inca1), *(pi1_ri +25), *(pi1_ir +25) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +26*inca1), *(pi1_ri +26), *(pi1_ir +26) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +27*inca1), *(pi1_ri +27), *(pi1_ir +27) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +28*inca1), *(pi1_ri +28), *(pi1_ir +28) ); \ - PASTEMAC(ch,copyj1es)( *(alpha1_ri +29*inca1), *(pi1_ri +29), *(pi1_ir +29) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +16*inca1), *(pi1_ri +16), *(pi1_ir +16) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +17*inca1), *(pi1_ri +17), *(pi1_ir +17) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +18*inca1), *(pi1_ri +18), *(pi1_ir +18) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +19*inca1), *(pi1_ri +19), *(pi1_ir +19) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +20*inca1), *(pi1_ri +20), *(pi1_ir +20) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +21*inca1), *(pi1_ri +21), *(pi1_ir +21) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +22*inca1), *(pi1_ri +22), *(pi1_ir +22) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +23*inca1), *(pi1_ri +23), *(pi1_ir +23) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +24*inca1), *(pi1_ri +24), *(pi1_ir +24) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +25*inca1), *(pi1_ri +25), *(pi1_ir +25) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +26*inca1), *(pi1_ri +26), *(pi1_ir +26) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +27*inca1), *(pi1_ri +27), *(pi1_ir +27) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +28*inca1), *(pi1_ri +28), *(pi1_ir +28) ); \ - PASTEMAC(ch,copy1es)( *(alpha1_ri +29*inca1), *(pi1_ri +29), *(pi1_ir +29) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +16*inca1), *(pi1_ri +16), *(pi1_ir +16) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +17*inca1), *(pi1_ri +17), *(pi1_ir +17) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +18*inca1), *(pi1_ri +18), *(pi1_ir +18) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +19*inca1), *(pi1_ri +19), *(pi1_ir +19) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +20*inca1), *(pi1_ri +20), *(pi1_ir +20) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +21*inca1), *(pi1_ri +21), *(pi1_ir +21) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +22*inca1), *(pi1_ri +22), *(pi1_ir +22) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +23*inca1), *(pi1_ri +23), *(pi1_ir +23) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +24*inca1), *(pi1_ri +24), *(pi1_ir +24) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +25*inca1), *(pi1_ri +25), *(pi1_ir +25) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +26*inca1), *(pi1_ri +26), *(pi1_ir +26) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +27*inca1), *(pi1_ri +27), *(pi1_ir +27) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +28*inca1), *(pi1_ri +28), *(pi1_ir +28) ); \ - PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +29*inca1), *(pi1_ri +29), *(pi1_ir +29) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +16*inca1), *(pi1_ri +16), *(pi1_ir +16) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +17*inca1), *(pi1_ri +17), *(pi1_ir +17) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +18*inca1), *(pi1_ri +18), *(pi1_ir +18) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +19*inca1), *(pi1_ri +19), *(pi1_ir +19) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +20*inca1), *(pi1_ri +20), *(pi1_ir +20) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +21*inca1), *(pi1_ri +21), *(pi1_ir +21) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +22*inca1), *(pi1_ri +22), *(pi1_ir +22) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +23*inca1), *(pi1_ri +23), *(pi1_ir +23) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +24*inca1), *(pi1_ri +24), *(pi1_ir +24) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +25*inca1), *(pi1_ri +25), *(pi1_ir +25) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +26*inca1), *(pi1_ri +26), *(pi1_ir +26) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +27*inca1), *(pi1_ri +27), *(pi1_ir +27) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +28*inca1), *(pi1_ri +28), *(pi1_ir +28) ); \ - PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +29*inca1), *(pi1_ri +29), *(pi1_ir +29) ); \ -\ - alpha1_ri += lda1; \ - pi1_ri += ldp1; \ - pi1_ir += ldp1; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_30xk_1e_ref ) - diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_1r_ref.c b/frame/1m/packm/ukernels/bli_packm_cxk_1r_ref.c deleted file mode 100644 index 6e30ca5bc..000000000 --- a/frame/1m/packm/ukernels/bli_packm_cxk_1r_ref.c +++ /dev/null @@ -1,1254 +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. - -*/ - -#include "blis.h" - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca2 = 2 * inca; \ - const inc_t lda2 = 2 * lda; \ - const inc_t ldp2 = 2 * ldp; \ -\ - ctype* kappa_cast = kappa; \ - ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ - ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ - ctype_r* restrict alpha1_r = ( ctype_r* )a; \ - ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ - ctype_r* restrict pi1_r = ( ctype_r* )p; \ - ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_2xk_1r_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca2 = 2 * inca; \ - const inc_t lda2 = 2 * lda; \ - const inc_t ldp2 = 2 * ldp; \ -\ - ctype* kappa_cast = kappa; \ - ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ - ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ - ctype_r* restrict alpha1_r = ( ctype_r* )a; \ - ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ - ctype_r* restrict pi1_r = ( ctype_r* )p; \ - ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_3xk_1r_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca2 = 2 * inca; \ - const inc_t lda2 = 2 * lda; \ - const inc_t ldp2 = 2 * ldp; \ -\ - ctype* kappa_cast = kappa; \ - ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ - ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ - ctype_r* restrict alpha1_r = ( ctype_r* )a; \ - ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ - ctype_r* restrict pi1_r = ( ctype_r* )p; \ - ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_4xk_1r_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca2 = 2 * inca; \ - const inc_t lda2 = 2 * lda; \ - const inc_t ldp2 = 2 * ldp; \ -\ - ctype* kappa_cast = kappa; \ - ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ - ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ - ctype_r* restrict alpha1_r = ( ctype_r* )a; \ - ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ - ctype_r* restrict pi1_r = ( ctype_r* )p; \ - ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_6xk_1r_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca2 = 2 * inca; \ - const inc_t lda2 = 2 * lda; \ - const inc_t ldp2 = 2 * ldp; \ -\ - ctype* kappa_cast = kappa; \ - ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ - ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ - ctype_r* restrict alpha1_r = ( ctype_r* )a; \ - ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ - ctype_r* restrict pi1_r = ( ctype_r* )p; \ - ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_8xk_1r_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca2 = 2 * inca; \ - const inc_t lda2 = 2 * lda; \ - const inc_t ldp2 = 2 * ldp; \ -\ - ctype* kappa_cast = kappa; \ - ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ - ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ - ctype_r* restrict alpha1_r = ( ctype_r* )a; \ - ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ - ctype_r* restrict pi1_r = ( ctype_r* )p; \ - ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_10xk_1r_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca2 = 2 * inca; \ - const inc_t lda2 = 2 * lda; \ - const inc_t ldp2 = 2 * ldp; \ -\ - ctype* kappa_cast = kappa; \ - ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ - ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ - ctype_r* restrict alpha1_r = ( ctype_r* )a; \ - ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ - ctype_r* restrict pi1_r = ( ctype_r* )p; \ - ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_12xk_1r_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca2 = 2 * inca; \ - const inc_t lda2 = 2 * lda; \ - const inc_t ldp2 = 2 * ldp; \ -\ - ctype* kappa_cast = kappa; \ - ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ - ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ - ctype_r* restrict alpha1_r = ( ctype_r* )a; \ - ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ - ctype_r* restrict pi1_r = ( ctype_r* )p; \ - ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_14xk_1r_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca2 = 2 * inca; \ - const inc_t lda2 = 2 * lda; \ - const inc_t ldp2 = 2 * ldp; \ -\ - ctype* kappa_cast = kappa; \ - ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ - ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ - ctype_r* restrict alpha1_r = ( ctype_r* )a; \ - ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ - ctype_r* restrict pi1_r = ( ctype_r* )p; \ - ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_16xk_1r_ref ) - - - -#undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ - ) \ -{ \ - const inc_t inca2 = 2 * inca; \ - const inc_t lda2 = 2 * lda; \ - const inc_t ldp2 = 2 * ldp; \ -\ - ctype* kappa_cast = kappa; \ - ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ - ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ - ctype_r* restrict alpha1_r = ( ctype_r* )a; \ - ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ - ctype_r* restrict pi1_r = ( ctype_r* )p; \ - ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ -\ - if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \ - PASTEMAC(ch,copyjris)( *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \ - PASTEMAC(ch,copyris)( *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ - else \ - { \ - if ( bli_is_conj( conja ) ) \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \ - PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - else \ - { \ - for ( ; n != 0; --n ) \ - { \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \ - PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \ -\ - alpha1_r += lda2; \ - alpha1_i += lda2; \ - pi1_r += ldp2; \ - pi1_i += ldp2; \ - } \ - } \ - } \ -} - -INSERT_GENTFUNCCO_BASIC0( packm_30xk_1r_ref ) - diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_1r_ref.h b/frame/1m/packm/ukernels/bli_packm_cxk_1r_ref.h deleted file mode 100644 index a6e3f0aef..000000000 --- a/frame/1m/packm/ukernels/bli_packm_cxk_1r_ref.h +++ /dev/null @@ -1,61 +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. - -*/ - -// Redefine level-1m kernel API names to induce prototypes. - -#undef packm_2xk_ker_name -#define packm_2xk_ker_name packm_2xk_1r_ref -#undef packm_3xk_ker_name -#define packm_3xk_ker_name packm_3xk_1r_ref -#undef packm_4xk_ker_name -#define packm_4xk_ker_name packm_4xk_1r_ref -#undef packm_6xk_ker_name -#define packm_6xk_ker_name packm_6xk_1r_ref -#undef packm_8xk_ker_name -#define packm_8xk_ker_name packm_8xk_1r_ref -#undef packm_10xk_ker_name -#define packm_10xk_ker_name packm_10xk_1r_ref -#undef packm_12xk_ker_name -#define packm_12xk_ker_name packm_12xk_1r_ref -#undef packm_14xk_ker_name -#define packm_14xk_ker_name packm_14xk_1r_ref -#undef packm_16xk_ker_name -#define packm_16xk_ker_name packm_16xk_1r_ref -#undef packm_30xk_ker_name -#define packm_30xk_ker_name packm_30xk_1r_ref - -// Include the level-1m kernel API template. - -#include "bli_l1m_ker.h" - diff --git a/frame/1m/unpackm/bli_unpackm_blk_var1.h b/frame/1m/unpackm/bli_unpackm_blk_var1.h index 330e9b089..2c93b5116 100644 --- a/frame/1m/unpackm/bli_unpackm_blk_var1.h +++ b/frame/1m/unpackm/bli_unpackm_blk_var1.h @@ -62,5 +62,5 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( unpackm_blk_var1 ) +INSERT_GENTPROT_BASIC0( unpackm_blk_var1 ) diff --git a/frame/1m/unpackm/bli_unpackm_cxk.c b/frame/1m/unpackm/bli_unpackm_cxk.c index 0ffaa78e5..60e25c0cb 100644 --- a/frame/1m/unpackm/bli_unpackm_cxk.c +++ b/frame/1m/unpackm/bli_unpackm_cxk.c @@ -34,195 +34,57 @@ #include "blis.h" -#define FUNCPTR_T unpackm_cxk_fp - -typedef void (*FUNCPTR_T)( - conj_t conjp, - dim_t n, - void* beta, - void* p, - void* a, inc_t inca, inc_t lda - ); - -#undef FUNCPTR_ARRAY_LENGTH -#define FUNCPTR_ARRAY_LENGTH 18 - -static FUNCPTR_T ftypes[FUNCPTR_ARRAY_LENGTH][BLIS_NUM_FP_TYPES] = -{ - /* panel width = 0 */ - { - NULL, NULL, NULL, NULL, - }, - /* panel width = 1 */ - { - NULL, NULL, NULL, NULL, - }, - /* panel width = 2 */ - { - BLIS_SUNPACKM_2XK_KERNEL, - BLIS_CUNPACKM_2XK_KERNEL, - BLIS_DUNPACKM_2XK_KERNEL, - BLIS_ZUNPACKM_2XK_KERNEL, - }, - /* panel width = 3 */ - { - NULL, NULL, NULL, NULL, - }, - /* panel width = 4 */ - { - BLIS_SUNPACKM_4XK_KERNEL, - BLIS_CUNPACKM_4XK_KERNEL, - BLIS_DUNPACKM_4XK_KERNEL, - BLIS_ZUNPACKM_4XK_KERNEL, - }, - /* panel width = 5 */ - { - NULL, NULL, NULL, NULL, - }, - /* panel width = 6 */ - { - BLIS_SUNPACKM_6XK_KERNEL, - BLIS_CUNPACKM_6XK_KERNEL, - BLIS_DUNPACKM_6XK_KERNEL, - BLIS_ZUNPACKM_6XK_KERNEL, - }, - /* panel width = 7 */ - { - NULL, NULL, NULL, NULL, - }, - /* panel width = 8 */ - { - BLIS_SUNPACKM_8XK_KERNEL, - BLIS_CUNPACKM_8XK_KERNEL, - BLIS_DUNPACKM_8XK_KERNEL, - BLIS_ZUNPACKM_8XK_KERNEL, - }, - /* panel width = 9 */ - { - NULL, NULL, NULL, NULL, - }, - /* panel width = 10 */ - { - BLIS_SUNPACKM_10XK_KERNEL, - BLIS_CUNPACKM_10XK_KERNEL, - BLIS_DUNPACKM_10XK_KERNEL, - BLIS_ZUNPACKM_10XK_KERNEL, - }, - /* panel width = 11 */ - { - NULL, NULL, NULL, NULL, - }, - /* panel width = 12 */ - { - BLIS_SUNPACKM_12XK_KERNEL, - BLIS_CUNPACKM_12XK_KERNEL, - BLIS_DUNPACKM_12XK_KERNEL, - BLIS_ZUNPACKM_12XK_KERNEL, - }, - /* panel width = 13 */ - { - NULL, NULL, NULL, NULL, - }, - /* panel width = 14 */ - { - BLIS_SUNPACKM_14XK_KERNEL, - BLIS_CUNPACKM_14XK_KERNEL, - BLIS_DUNPACKM_14XK_KERNEL, - BLIS_ZUNPACKM_14XK_KERNEL, - }, - /* panel width = 15 */ - { - NULL, NULL, NULL, NULL, - }, - /* panel width = 16 */ - { - BLIS_SUNPACKM_16XK_KERNEL, - BLIS_CUNPACKM_16XK_KERNEL, - BLIS_DUNPACKM_16XK_KERNEL, - BLIS_ZUNPACKM_16XK_KERNEL, - }, - /* panel width = 17 */ - { - NULL, NULL, NULL, NULL, - }, -}; - - - #undef GENTFUNC #define GENTFUNC( ctype, ch, opname ) \ \ void PASTEMAC(ch,opname) \ ( \ conj_t conjp, \ - dim_t m, \ - dim_t n, \ - void* beta, \ - void* p, inc_t ldp, \ - void* a, inc_t inca, inc_t lda, \ + dim_t panel_dim, \ + dim_t panel_len, \ + ctype* kappa, \ + ctype* p, inc_t ldp, \ + ctype* a, inc_t inca, inc_t lda, \ cntx_t* cntx \ ) \ { \ - dim_t panel_dim; \ - num_t dt; \ - FUNCPTR_T f; \ + num_t dt = PASTEMAC(ch,type); \ + l1mkr_t ker_id = panel_dim; \ \ - /* If the panel dimension is unit, then we recognize that this allows - the kernel to reduce to a copyv, so we call that directly. */ \ - if ( m == 1 ) \ - { \ - PASTEMAC(ch,copyv) \ - ( \ - conjp, \ - n, \ - p, 1, \ - a, lda, \ - cntx \ - ); \ - return; \ - } \ + PASTECH2(ch,opname,_ker_ft) f; \ \ - /* The panel dimension is always equal to the leading dimension of p. */ \ - panel_dim = ldp; \ + /* Query the context for the unpackm kernel corresponding to the current + panel dimension, or kernel id. If the id is invalid, the function will + return NULL. */ \ + f = bli_cntx_get_unpackm_ker_dt( dt, ker_id, cntx ); \ \ - /* Acquire the datatype for the current function. */ \ - dt = PASTEMAC(ch,type); \ -\ - /* Index into the array to extract the correct function pointer. - If the panel dimension is too big to be within the array of - explicitly handled kernels, then we treat that kernel the same - as if it were in range but unimplemented. */ \ - if ( panel_dim < FUNCPTR_ARRAY_LENGTH ) f = ftypes[panel_dim][dt]; \ - else f = NULL; \ -\ - /* If there exists a kernel implementation for the panel dimension - provided, and the "width" of the panel is equal to the leading - dimension, we invoke the implementation. Otherwise, we use scal2m. - By using scal2m to handle edge cases (where m < panel_dim), we - allow the kernel implementations to remain very simple. */ \ - if ( f != NULL && m == panel_dim ) \ + /* If there exists a kernel implementation for the micro-panel dimension + provided, we invoke the implementation. Otherwise, we use scal2m. */ \ + if ( f != NULL ) \ { \ f \ ( \ conjp, \ - n, \ - beta, \ - p, \ - a, inca, lda \ + panel_len, \ + kappa, \ + p, ldp, \ + a, inca, lda, \ + cntx \ ); \ } \ else \ { \ - /* Treat the panel as m x n and column-stored (unit row stride). */ \ + /* Treat the micro-panel as panel_dim x panel_len and column-stored + (unit row stride). */ \ PASTEMAC(ch,scal2m) \ ( \ 0, \ BLIS_NONUNIT_DIAG, \ BLIS_DENSE, \ conjp, \ - m, \ - n, \ - beta, \ + panel_dim, \ + panel_len, \ + kappa, \ p, 1, ldp, \ a, inca, lda, \ cntx \ diff --git a/frame/1m/unpackm/bli_unpackm_cxk.h b/frame/1m/unpackm/bli_unpackm_cxk.h index 89473913e..d6ef0da5d 100644 --- a/frame/1m/unpackm/bli_unpackm_cxk.h +++ b/frame/1m/unpackm/bli_unpackm_cxk.h @@ -32,8 +32,6 @@ */ -#include "bli_unpackm_cxk_ref.h" - #undef GENTPROT #define GENTPROT( ctype, ch, varname ) \ @@ -41,13 +39,13 @@ void PASTEMAC(ch,varname) \ ( \ conj_t conjp, \ - dim_t m, \ - dim_t n, \ - void* beta, \ - void* p, inc_t ldp, \ - void* a, inc_t inca, inc_t lda, \ + dim_t panel_dim, \ + dim_t panel_len, \ + ctype* kappa, \ + ctype* p, inc_t ldp, \ + ctype* a, inc_t inca, inc_t lda, \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( unpackm_cxk ) +INSERT_GENTPROT_BASIC0( unpackm_cxk ) diff --git a/frame/1m/unpackm/bli_unpackm_unb_var1.h b/frame/1m/unpackm/bli_unpackm_unb_var1.h index 40c921522..a4d2cb252 100644 --- a/frame/1m/unpackm/bli_unpackm_unb_var1.h +++ b/frame/1m/unpackm/bli_unpackm_unb_var1.h @@ -56,5 +56,5 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( unpackm_unb_var1 ) +INSERT_GENTPROT_BASIC0( unpackm_unb_var1 ) diff --git a/frame/2/bli_l2.h b/frame/2/bli_l2.h index f251844cd..93e569b24 100644 --- a/frame/2/bli_l2.h +++ b/frame/2/bli_l2.h @@ -32,7 +32,6 @@ */ -#include "bli_l2_cntx.h" #include "bli_l2_check.h" #include "bli_l2_ft.h" diff --git a/frame/2/bli_l2_tapi.c b/frame/2/bli_l2_tapi.c index f2681d7d8..a64808212 100644 --- a/frame/2/bli_l2_tapi.c +++ b/frame/2/bli_l2_tapi.c @@ -55,9 +55,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ - dim_t m_y, n_x; \ + dim_t m_y, n_x; \ \ /* Determine the dimensions of y and x. */ \ bli_set_dims_with_trans( transa, m, n, m_y, n_x ); \ @@ -65,8 +63,8 @@ void PASTEMAC(ch,opname) \ /* If y has zero elements, return early. */ \ if ( bli_zero_dim1( m_y ) ) return; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* If x has zero elements, or if alpha is zero, scale y by beta and return early. */ \ @@ -78,7 +76,7 @@ void PASTEMAC(ch,opname) \ m_y, \ beta, \ y, incy, \ - cntx_p \ + cntx \ ); \ return; \ } \ @@ -110,11 +108,8 @@ void PASTEMAC(ch,opname) \ x, incx, \ beta, \ y, incy, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC3( gemv, gemv, gemv_unf_var1, gemv_unf_var2 ) @@ -136,14 +131,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ -\ /* If x or y has zero elements, or if alpha is zero, return early. */ \ if ( bli_zero_dim2( m, n ) || PASTEMAC(ch,eq0)( *alpha ) ) return; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Declare a void function pointer for the current operation. */ \ PASTECH2(ch,ftname,_ft) f; \ @@ -163,11 +155,8 @@ void PASTEMAC(ch,opname) \ x, incx, \ y, incy, \ a, rs_a, cs_a, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC3( ger, ger, ger_unb_var1, ger_unb_var2 ) @@ -190,11 +179,8 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ -\ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* If x has zero elements, or if alpha is zero, scale y by beta and return early. */ \ @@ -206,7 +192,7 @@ void PASTEMAC(ch,opname) \ m, \ beta, \ y, incy, \ - cntx_p \ + cntx \ ); \ return; \ } \ @@ -239,11 +225,8 @@ void PASTEMAC(ch,opname) \ x, incx, \ beta, \ y, incy, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC4( hemv, hemv, BLIS_CONJUGATE, hemv_unf_var1, hemv_unf_var3 ) @@ -264,9 +247,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ - ctype alpha_local; \ + ctype alpha_local; \ \ /* If x has zero elements, or if alpha is zero, return early. */ \ if ( bli_zero_dim1( m ) || PASTEMAC(chr,eq0)( *alpha ) ) return; \ @@ -276,8 +257,8 @@ void PASTEMAC(ch,opname) \ both her and syr operations. */ \ PASTEMAC2(chr,ch,copys)( *alpha, alpha_local ); \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Declare a void function pointer for the current operation. */ \ PASTECH2(ch,ftname,_ft) f; \ @@ -304,11 +285,8 @@ void PASTEMAC(ch,opname) \ &alpha_local, \ x, incx, \ a, rs_a, cs_a, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNCR_BASIC4( her, her, BLIS_CONJUGATE, her_unb_var1, her_unb_var2 ) @@ -328,14 +306,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ -\ /* If x has zero elements, or if alpha is zero, return early. */ \ if ( bli_zero_dim1( m ) || PASTEMAC(ch,eq0)( *alpha ) ) return; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Declare a void function pointer for the current operation. */ \ PASTECH2(ch,ftname,_ft) f; \ @@ -362,11 +337,8 @@ void PASTEMAC(ch,opname) \ alpha, \ x, incx, \ a, rs_a, cs_a, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC4( syr, her, BLIS_NO_CONJUGATE, her_unb_var1, her_unb_var2 ) @@ -388,14 +360,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ -\ /* If x has zero elements, or if alpha is zero, return early. */ \ if ( bli_zero_dim1( m ) || PASTEMAC(ch,eq0)( *alpha ) ) return; \ \ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Declare a void function pointer for the current operation. */ \ PASTECH2(ch,ftname,_ft) f; \ @@ -424,11 +393,8 @@ void PASTEMAC(ch,opname) \ x, incx, \ y, incy, \ a, rs_a, cs_a, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC4( her2, her2, BLIS_CONJUGATE, her2_unf_var1, her2_unf_var4 ) @@ -450,14 +416,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ) \ { \ - const num_t dt = PASTEMAC(ch,type); \ - cntx_t* cntx_p; \ -\ - /* Initialize a local context if the given context is NULL. */ \ - bli_cntx_init_local_if( opname, dt, cntx, cntx_p ); \ -\ /* If x has zero elements, return early. */ \ if ( bli_zero_dim1( m ) ) return; \ +\ + /* Obtain a valid context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* If alpha is zero, set x to zero and return early. */ \ if ( PASTEMAC(ch,eq0)( *alpha ) ) \ @@ -468,7 +431,7 @@ void PASTEMAC(ch,opname) \ m, \ alpha, \ x, incx, \ - cntx_p \ + cntx \ ); \ return; \ } \ @@ -498,11 +461,8 @@ void PASTEMAC(ch,opname) \ alpha, \ a, rs_a, cs_a, \ x, incx, \ - cntx_p \ + cntx \ ); \ -\ - /* Finalize the context if it was initialized locally. */ \ - bli_cntx_finalize_local_if( opname, cntx ); \ } INSERT_GENTFUNC_BASIC3( trmv, trmv, trmv_unf_var1, trmv_unf_var2 ) diff --git a/frame/2/bli_l2_tapi.h b/frame/2/bli_l2_tapi.h index 8c4575815..5c81d5bab 100644 --- a/frame/2/bli_l2_tapi.h +++ b/frame/2/bli_l2_tapi.h @@ -54,7 +54,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( gemv ) +INSERT_GENTPROT_BASIC0( gemv ) #undef GENTPROT @@ -73,7 +73,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( ger ) +INSERT_GENTPROT_BASIC0( ger ) #undef GENTPROT @@ -93,8 +93,8 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( hemv ) -INSERT_GENTPROT_BASIC( symv ) +INSERT_GENTPROT_BASIC0( hemv ) +INSERT_GENTPROT_BASIC0( symv ) #undef GENTPROTR @@ -111,7 +111,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( her ) +INSERT_GENTPROTR_BASIC0( her ) #undef GENTPROT @@ -128,7 +128,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( syr ) +INSERT_GENTPROT_BASIC0( syr ) #undef GENTPROT @@ -147,8 +147,8 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( her2 ) -INSERT_GENTPROT_BASIC( syr2 ) +INSERT_GENTPROT_BASIC0( her2 ) +INSERT_GENTPROT_BASIC0( syr2 ) #undef GENTPROT @@ -166,5 +166,5 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( trmv ) -INSERT_GENTPROT_BASIC( trsv ) +INSERT_GENTPROT_BASIC0( trmv ) +INSERT_GENTPROT_BASIC0( trsv ) diff --git a/frame/2/gemv/bli_gemv_var.h b/frame/2/gemv/bli_gemv_var.h index 4e2a03908..aa2298ff1 100644 --- a/frame/2/gemv/bli_gemv_var.h +++ b/frame/2/gemv/bli_gemv_var.h @@ -82,9 +82,9 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( gemv_unb_var1 ) -INSERT_GENTPROT_BASIC( gemv_unb_var2 ) +INSERT_GENTPROT_BASIC0( gemv_unb_var1 ) +INSERT_GENTPROT_BASIC0( gemv_unb_var2 ) -INSERT_GENTPROT_BASIC( gemv_unf_var1 ) -INSERT_GENTPROT_BASIC( gemv_unf_var2 ) +INSERT_GENTPROT_BASIC0( gemv_unf_var1 ) +INSERT_GENTPROT_BASIC0( gemv_unf_var2 ) diff --git a/frame/2/ger/bli_ger_var.h b/frame/2/ger/bli_ger_var.h index 98451dcae..f29326a0d 100644 --- a/frame/2/ger/bli_ger_var.h +++ b/frame/2/ger/bli_ger_var.h @@ -77,6 +77,6 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( ger_unb_var1 ) -INSERT_GENTPROT_BASIC( ger_unb_var2 ) +INSERT_GENTPROT_BASIC0( ger_unb_var1 ) +INSERT_GENTPROT_BASIC0( ger_unb_var2 ) diff --git a/frame/2/hemv/bli_hemv_var.h b/frame/2/hemv/bli_hemv_var.h index db00df441..9099cc1f1 100644 --- a/frame/2/hemv/bli_hemv_var.h +++ b/frame/2/hemv/bli_hemv_var.h @@ -90,13 +90,13 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( hemv_unb_var1 ) -INSERT_GENTPROT_BASIC( hemv_unb_var2 ) -INSERT_GENTPROT_BASIC( hemv_unb_var3 ) -INSERT_GENTPROT_BASIC( hemv_unb_var4 ) +INSERT_GENTPROT_BASIC0( hemv_unb_var1 ) +INSERT_GENTPROT_BASIC0( hemv_unb_var2 ) +INSERT_GENTPROT_BASIC0( hemv_unb_var3 ) +INSERT_GENTPROT_BASIC0( hemv_unb_var4 ) -INSERT_GENTPROT_BASIC( hemv_unf_var1 ) -INSERT_GENTPROT_BASIC( hemv_unf_var3 ) -INSERT_GENTPROT_BASIC( hemv_unf_var1a ) -INSERT_GENTPROT_BASIC( hemv_unf_var3a ) +INSERT_GENTPROT_BASIC0( hemv_unf_var1 ) +INSERT_GENTPROT_BASIC0( hemv_unf_var3 ) +INSERT_GENTPROT_BASIC0( hemv_unf_var1a ) +INSERT_GENTPROT_BASIC0( hemv_unf_var3a ) diff --git a/frame/2/her/bli_her_var.h b/frame/2/her/bli_her_var.h index d4c11a0b5..912a935e0 100644 --- a/frame/2/her/bli_her_var.h +++ b/frame/2/her/bli_her_var.h @@ -76,6 +76,6 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( her_unb_var1 ) -INSERT_GENTPROTR_BASIC( her_unb_var2 ) +INSERT_GENTPROTR_BASIC0( her_unb_var1 ) +INSERT_GENTPROTR_BASIC0( her_unb_var2 ) diff --git a/frame/2/her2/bli_her2_var.h b/frame/2/her2/bli_her2_var.h index 5df14c9d1..f49076649 100644 --- a/frame/2/her2/bli_her2_var.h +++ b/frame/2/her2/bli_her2_var.h @@ -87,11 +87,11 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( her2_unb_var1 ) -INSERT_GENTPROT_BASIC( her2_unb_var2 ) -INSERT_GENTPROT_BASIC( her2_unb_var3 ) -INSERT_GENTPROT_BASIC( her2_unb_var4 ) +INSERT_GENTPROT_BASIC0( her2_unb_var1 ) +INSERT_GENTPROT_BASIC0( her2_unb_var2 ) +INSERT_GENTPROT_BASIC0( her2_unb_var3 ) +INSERT_GENTPROT_BASIC0( her2_unb_var4 ) -INSERT_GENTPROT_BASIC( her2_unf_var1 ) -INSERT_GENTPROT_BASIC( her2_unf_var4 ) +INSERT_GENTPROT_BASIC0( her2_unf_var1 ) +INSERT_GENTPROT_BASIC0( her2_unf_var4 ) diff --git a/frame/2/bli_l2_cntx.c b/frame/2/old/bli_l2_cntx.c similarity index 100% rename from frame/2/bli_l2_cntx.c rename to frame/2/old/bli_l2_cntx.c diff --git a/frame/2/bli_l2_cntx.h b/frame/2/old/bli_l2_cntx.h similarity index 100% rename from frame/2/bli_l2_cntx.h rename to frame/2/old/bli_l2_cntx.h diff --git a/frame/2/trmv/bli_trmv_var.h b/frame/2/trmv/bli_trmv_var.h index 23680469e..37b0857e7 100644 --- a/frame/2/trmv/bli_trmv_var.h +++ b/frame/2/trmv/bli_trmv_var.h @@ -80,9 +80,9 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( trmv_unb_var1 ) -INSERT_GENTPROT_BASIC( trmv_unb_var2 ) +INSERT_GENTPROT_BASIC0( trmv_unb_var1 ) +INSERT_GENTPROT_BASIC0( trmv_unb_var2 ) -INSERT_GENTPROT_BASIC( trmv_unf_var1 ) -INSERT_GENTPROT_BASIC( trmv_unf_var2 ) +INSERT_GENTPROT_BASIC0( trmv_unf_var1 ) +INSERT_GENTPROT_BASIC0( trmv_unf_var2 ) diff --git a/frame/2/trsv/bli_trsv_var.h b/frame/2/trsv/bli_trsv_var.h index 395d89d5d..7465e79d5 100644 --- a/frame/2/trsv/bli_trsv_var.h +++ b/frame/2/trsv/bli_trsv_var.h @@ -80,9 +80,9 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( trsv_unb_var1 ) -INSERT_GENTPROT_BASIC( trsv_unb_var2 ) +INSERT_GENTPROT_BASIC0( trsv_unb_var1 ) +INSERT_GENTPROT_BASIC0( trsv_unb_var2 ) -INSERT_GENTPROT_BASIC( trsv_unf_var1 ) -INSERT_GENTPROT_BASIC( trsv_unf_var2 ) +INSERT_GENTPROT_BASIC0( trsv_unf_var1 ) +INSERT_GENTPROT_BASIC0( trsv_unf_var2 ) diff --git a/frame/3/bli_l3.h b/frame/3/bli_l3.h index ea7926d32..65170fa94 100644 --- a/frame/3/bli_l3.h +++ b/frame/3/bli_l3.h @@ -32,7 +32,6 @@ */ -#include "bli_l3_cntx.h" #include "bli_l3_cntl.h" #include "bli_l3_check.h" @@ -57,7 +56,7 @@ #include "bli_l3_ukr_tapi.h" // Prototype reference micro-kernels. -#include "bli_l3_ukr_ref.h" +//#include "bli_l3_ref.h" // Operation-specific headers #include "bli_gemm.h" diff --git a/frame/3/bli_l3_packm.h b/frame/3/bli_l3_packm.h index 7dc5dfb46..27d0be04d 100644 --- a/frame/3/bli_l3_packm.h +++ b/frame/3/bli_l3_packm.h @@ -32,8 +32,6 @@ */ -#include "blis.h" - void bli_l3_packm ( obj_t* x, diff --git a/frame/3/bli_l3_tapi.h b/frame/3/bli_l3_tapi.h index 05a346063..9c8d295ad 100644 --- a/frame/3/bli_l3_tapi.h +++ b/frame/3/bli_l3_tapi.h @@ -55,7 +55,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( gemm ) +INSERT_GENTPROT_BASIC0( gemm ) #undef GENTPROT @@ -77,8 +77,8 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( hemm ) -INSERT_GENTPROT_BASIC( symm ) +INSERT_GENTPROT_BASIC0( hemm ) +INSERT_GENTPROT_BASIC0( symm ) #undef GENTPROTR @@ -97,7 +97,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( herk ) +INSERT_GENTPROTR_BASIC0( herk ) #undef GENTPROTR @@ -118,7 +118,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( her2k ) +INSERT_GENTPROTR_BASIC0( her2k ) #undef GENTPROT @@ -137,7 +137,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( syrk ) +INSERT_GENTPROT_BASIC0( syrk ) #undef GENTPROT @@ -158,7 +158,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( syr2k ) +INSERT_GENTPROT_BASIC0( syr2k ) #undef GENTPROT @@ -181,7 +181,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( trmm3 ) +INSERT_GENTPROT_BASIC0( trmm3 ) #undef GENTPROT @@ -201,6 +201,6 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( trmm ) -INSERT_GENTPROT_BASIC( trsm ) +INSERT_GENTPROT_BASIC0( trmm ) +INSERT_GENTPROT_BASIC0( trsm ) diff --git a/frame/3/bli_l3_ukr.h b/frame/3/bli_l3_ukr.h index 9af83b781..6de50f427 100644 --- a/frame/3/bli_l3_ukr.h +++ b/frame/3/bli_l3_ukr.h @@ -37,55 +37,21 @@ // #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - dim_t k, \ - ctype* restrict alpha, \ - ctype* restrict a, \ - ctype* restrict b, \ - ctype* restrict beta, \ - ctype* restrict c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* restrict data, \ - cntx_t* restrict cntx \ - ); +#define GENTPROT GEMM_UKR_PROT -INSERT_GENTPROT_BASIC( gemm_ukr_name ) +INSERT_GENTPROT_BASIC0( gemm_ukr_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - dim_t k, \ - ctype* restrict alpha, \ - ctype* restrict a1x, \ - ctype* restrict a11, \ - ctype* restrict bx1, \ - ctype* restrict b11, \ - ctype* restrict c11, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* restrict data, \ - cntx_t* restrict cntx \ - ); +#define GENTPROT GEMMTRSM_UKR_PROT -INSERT_GENTPROT_BASIC( gemmtrsm_l_ukr_name ) -INSERT_GENTPROT_BASIC( gemmtrsm_u_ukr_name ) +INSERT_GENTPROT_BASIC0( gemmtrsm_l_ukr_name ) +INSERT_GENTPROT_BASIC0( gemmtrsm_u_ukr_name ) #undef GENTPROT -#define GENTPROT( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname) \ - ( \ - ctype* restrict a, \ - ctype* restrict b, \ - ctype* restrict c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* restrict data, \ - cntx_t* restrict cntx \ - ); +#define GENTPROT TRSM_UKR_PROT -INSERT_GENTPROT_BASIC( trsm_l_ukr_name ) -INSERT_GENTPROT_BASIC( trsm_u_ukr_name ) +INSERT_GENTPROT_BASIC0( trsm_l_ukr_name ) +INSERT_GENTPROT_BASIC0( trsm_u_ukr_name ) diff --git a/frame/3/bli_l3_ukr_prot.h b/frame/3/bli_l3_ukr_prot.h new file mode 100644 index 000000000..f8b1f3e78 --- /dev/null +++ b/frame/3/bli_l3_ukr_prot.h @@ -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. + +*/ + +// +// Define template prototypes for level-3 micro-kernels. +// + +#define GEMM_UKR_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + dim_t k, \ + ctype* restrict alpha, \ + ctype* restrict a, \ + ctype* restrict b, \ + ctype* restrict beta, \ + ctype* restrict c, inc_t rs_c, inc_t cs_c, \ + auxinfo_t* restrict data, \ + cntx_t* restrict cntx \ + ); + + +#define GEMMTRSM_UKR_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + dim_t k, \ + ctype* restrict alpha, \ + ctype* restrict a1x, \ + ctype* restrict a11, \ + ctype* restrict bx1, \ + ctype* restrict b11, \ + ctype* restrict c11, inc_t rs_c, inc_t cs_c, \ + auxinfo_t* restrict data, \ + cntx_t* restrict cntx \ + ); + + +#define TRSM_UKR_PROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + ctype* restrict a, \ + ctype* restrict b, \ + ctype* restrict c, inc_t rs_c, inc_t cs_c, \ + auxinfo_t* restrict data, \ + cntx_t* restrict cntx \ + ); + diff --git a/frame/3/gemm/bli_gemm_int.c b/frame/3/gemm/bli_gemm_int.c index b24f2a25d..89e1cd79b 100644 --- a/frame/3/gemm/bli_gemm_int.c +++ b/frame/3/gemm/bli_gemm_int.c @@ -107,15 +107,13 @@ void bli_gemm_int // Extract the function pointer from the current control tree node. f = bli_cntl_var_func( cntl ); - // Somewhat hackish support for 3m3, 3m2, and 4m1b method implementations. + // Somewhat hackish support for 4m1b method implementation. { - ind_t im = bli_cntx_get_ind_method( cntx ); + ind_t im = bli_cntx_method( cntx ); if ( im != BLIS_NAT ) { - if ( im == BLIS_3M3 && f == bli_gemm_packa ) f = bli_gemm3m3_packa; - else if ( im == BLIS_3M2 && f == bli_gemm_ker_var2 ) f = bli_gemm3m2_ker_var2; - else if ( im == BLIS_4M1B && f == bli_gemm_ker_var2 ) f = bli_gemm4mb_ker_var2; + if ( im == BLIS_4M1B && f == bli_gemm_ker_var2 ) f = bli_gemm4mb_ker_var2; } } diff --git a/frame/3/gemm/bli_gemm_var.h b/frame/3/gemm/bli_gemm_var.h index 88412c3d8..b3f2757ed 100644 --- a/frame/3/gemm/bli_gemm_var.h +++ b/frame/3/gemm/bli_gemm_var.h @@ -60,9 +60,7 @@ GENPROT( gemm_ker_var1 ) GENPROT( gemm_ker_var2 ) // Headers for induced algorithms: -GENPROT( gemm3m3_packa ) // 3m3 GENPROT( gemm4mb_ker_var2 ) // 4m1b -GENPROT( gemm3m2_ker_var2 ) // 3m2 // @@ -90,9 +88,8 @@ void PASTEMAC(ch,varname) \ thrinfo_t* thread \ ); -INSERT_GENTPROT_BASIC( gemm_ker_var2 ) +INSERT_GENTPROT_BASIC0( gemm_ker_var2 ) // Headers for induced algorithms: -INSERT_GENTPROT_BASIC( gemm4mb_ker_var2 ) // 4m1b -INSERT_GENTPROT_BASIC( gemm3m2_ker_var2 ) // 3m2 +INSERT_GENTPROT_BASIC0( gemm4mb_ker_var2 ) // 4m1b diff --git a/frame/3/gemm/ind/bli_gemm3m2_ker_var2.c b/frame/3/gemm/ind/old/bli_gemm3m2_ker_var2.c similarity index 100% rename from frame/3/gemm/ind/bli_gemm3m2_ker_var2.c rename to frame/3/gemm/ind/old/bli_gemm3m2_ker_var2.c diff --git a/frame/3/gemm/ind/bli_gemm3m3_packa.c b/frame/3/gemm/ind/old/bli_gemm3m3_packa.c similarity index 100% rename from frame/3/gemm/ind/bli_gemm3m3_packa.c rename to frame/3/gemm/ind/old/bli_gemm3m3_packa.c diff --git a/frame/3/herk/bli_herk_var.h b/frame/3/herk/bli_herk_var.h index a18c9ab49..8005bc7c1 100644 --- a/frame/3/herk/bli_herk_var.h +++ b/frame/3/herk/bli_herk_var.h @@ -87,6 +87,6 @@ void PASTEMAC(ch,varname) \ thrinfo_t* thread \ ); -INSERT_GENTPROT_BASIC( herk_l_ker_var2 ) -INSERT_GENTPROT_BASIC( herk_u_ker_var2 ) +INSERT_GENTPROT_BASIC0( herk_l_ker_var2 ) +INSERT_GENTPROT_BASIC0( herk_u_ker_var2 ) diff --git a/frame/3/old/bli_gemm.c b/frame/3/old/bli_gemm.c deleted file mode 100644 index c612cf865..000000000 --- a/frame/3/old/bli_gemm.c +++ /dev/null @@ -1,95 +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. - -*/ - -#include "blis.h" - -void bli_gemm( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - // The operation's "ind" function--its induced method front-end--will - // call native execution for real domain problems. For complex problems, - // it calls the highest priority induced method that is available (ie: - // implemented and enabled), and otherwise calls native execution. - bli_gemmind( alpha, a, b, beta, c ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname)( \ - trans_t transa, \ - trans_t transb, \ - dim_t m, \ - dim_t n, \ - dim_t k, \ - ctype* alpha, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype* b, inc_t rs_b, inc_t cs_b, \ - ctype* beta, \ - ctype* c, inc_t rs_c, inc_t cs_c \ - ) \ -{ \ - const num_t dt = PASTEMAC(ch,type); \ -\ - obj_t alphao, ao, bo, betao, co; \ -\ - dim_t m_a, n_a; \ - dim_t m_b, n_b; \ -\ - bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \ - bli_set_dims_with_trans( transb, k, n, m_b, n_b ); \ -\ - bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \ - bli_obj_create_1x1_with_attached_buffer( dt, beta, &betao ); \ -\ - bli_obj_create_with_attached_buffer( dt, m_a, n_a, a, rs_a, cs_a, &ao ); \ - bli_obj_create_with_attached_buffer( dt, m_b, n_b, b, rs_b, cs_b, &bo ); \ - bli_obj_create_with_attached_buffer( dt, m, n, c, rs_c, cs_c, &co ); \ -\ - bli_obj_set_conjtrans( transa, ao ); \ - bli_obj_set_conjtrans( transb, bo ); \ -\ - PASTEMAC0(opname)( &alphao, \ - &ao, \ - &bo, \ - &betao, \ - &co ); \ -} - -INSERT_GENTFUNC_BASIC0( gemm ) - diff --git a/frame/3/old/bli_gemm_blocksize.c b/frame/3/old/bli_gemm_blocksize.c deleted file mode 100644 index 606e68ef3..000000000 --- a/frame/3/old/bli_gemm_blocksize.c +++ /dev/null @@ -1,129 +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. - -*/ - -#include "blis.h" - -dim_t bli_gemm_determine_kc_f( dim_t i, - dim_t dim, - obj_t* a, - obj_t* b, - bszid_t bszid, - cntx_t* cntx ) -{ - num_t dt; - blksz_t* bsize; - dim_t mnr; - dim_t b_alg, b_max; - dim_t b_use; - - // We assume that this function is being called from an algorithm that - // is moving "forward" (ie: top to bottom, left to right, top-left - // to bottom-right). - - // Extract the execution datatype and use it to query the corresponding - // blocksize and blocksize maximum values from the blksz_t object. - dt = bli_obj_execution_datatype( *a ); - bsize = bli_cntx_get_blksz( bszid, cntx ); - b_alg = bli_blksz_get_def( dt, bsize ); - b_max = bli_blksz_get_max( dt, bsize ); - - // Nudge the default and maximum kc blocksizes up to the nearest - // multiple of MR if A is Hermitian or symmetric, or NR if B is - // Hermitian or symmetric. If neither case applies, then we leave - // the blocksizes unchanged. - if ( bli_obj_root_is_herm_or_symm( *a ) ) - { - mnr = bli_cntx_get_blksz_def_dt( dt, BLIS_MR, cntx ); - b_alg = bli_align_dim_to_mult( b_alg, mnr ); - b_max = bli_align_dim_to_mult( b_max, mnr ); - } - else if ( bli_obj_root_is_herm_or_symm( *b ) ) - { - mnr = bli_cntx_get_blksz_def_dt( dt, BLIS_NR, cntx ); - b_alg = bli_align_dim_to_mult( b_alg, mnr ); - b_max = bli_align_dim_to_mult( b_max, mnr ); - } - - b_use = bli_determine_blocksize_f_sub( i, dim, b_alg, b_max ); - - return b_use; -} - - -dim_t bli_gemm_determine_kc_b( dim_t i, - dim_t dim, - obj_t* a, - obj_t* b, - bszid_t bszid, - cntx_t* cntx ) -{ - num_t dt; - blksz_t* bsize; - dim_t mnr; - dim_t b_alg, b_max; - dim_t b_use; - - // We assume that this function is being called from an algorithm that - // is moving "backward" (ie: bottom to top, right to left, bottom-right - // to top-left). - - // Extract the execution datatype and use it to query the corresponding - // blocksize and blocksize maximum values from the blksz_t object. - dt = bli_obj_execution_datatype( *a ); - bsize = bli_cntx_get_blksz( bszid, cntx ); - b_alg = bli_blksz_get_def( dt, bsize ); - b_max = bli_blksz_get_max( dt, bsize ); - - // Nudge the default and maximum kc blocksizes up to the nearest - // multiple of MR if A is Hermitian or symmetric, or NR if B is - // Hermitian or symmetric. If neither case applies, then we leave - // the blocksizes unchanged. - if ( bli_obj_root_is_herm_or_symm( *a ) ) - { - mnr = bli_cntx_get_blksz_def_dt( dt, BLIS_MR, cntx ); - b_alg = bli_align_dim_to_mult( b_alg, mnr ); - b_max = bli_align_dim_to_mult( b_max, mnr ); - } - else if ( bli_obj_root_is_herm_or_symm( *b ) ) - { - mnr = bli_cntx_get_blksz_def_dt( dt, BLIS_NR, cntx ); - b_alg = bli_align_dim_to_mult( b_alg, mnr ); - b_max = bli_align_dim_to_mult( b_max, mnr ); - } - - b_use = bli_determine_blocksize_b_sub( i, dim, b_alg, b_max ); - - return b_use; -} - diff --git a/frame/3/old/bli_gemm_blocksize.h b/frame/3/old/bli_gemm_blocksize.h deleted file mode 100644 index 4762c123b..000000000 --- a/frame/3/old/bli_gemm_blocksize.h +++ /dev/null @@ -1,46 +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. - -*/ - -dim_t bli_gemm_determine_kc_f( dim_t i, - dim_t dim, - obj_t* a, - obj_t* b, - bszid_t bszid, - cntx_t* cntx ); -dim_t bli_gemm_determine_kc_b( dim_t i, - dim_t dim, - obj_t* a, - obj_t* b, - bszid_t bszid, - cntx_t* cntx ); diff --git a/frame/3/old/bli_gemm_check.c b/frame/3/old/bli_gemm_check.c deleted file mode 100644 index 8b052bc5d..000000000 --- a/frame/3/old/bli_gemm_check.c +++ /dev/null @@ -1,149 +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. - -*/ - -#include "blis.h" - -void bli_gemm_basic_check( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - err_t e_val; - - // Check object datatypes. - - e_val = bli_check_noninteger_object( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_noninteger_object( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( c ); - bli_check_error_code( e_val ); - - // 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 ); - - e_val = bli_check_level3_dims( a, b, c ); - bli_check_error_code( e_val ); - - // Check matrix structure. - - // We don't enforce general structure in matrices A or B so we can use - // gemm to implement hemm/symm. Instead, we only check this from the - // front-end. - - e_val = bli_check_general_object( c ); - bli_check_error_code( e_val ); -} - -void bli_gemm_check( 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_gemm_basic_check( alpha, a, b, beta, c ); - - // Check matrix structure. - - e_val = bli_check_general_object( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_general_object( b ); - bli_check_error_code( e_val ); -} - -void bli_gemm_int_check( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c, - cntx_t* cntx, - gemm_t* cntl ) -{ - err_t e_val; - - // Check object buffers (for non-NULLness). - - e_val = bli_check_object_buffer( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( c ); - bli_check_error_code( e_val ); - - // Check basic properties of the operation. - - bli_gemm_basic_check( alpha, a, b, beta, c ); - - // Check control tree pointer. - - e_val = bli_check_valid_cntl( ( void* )cntl ); - bli_check_error_code( e_val ); -} - diff --git a/frame/3/old/bli_gemm_check.h b/frame/3/old/bli_gemm_check.h deleted file mode 100644 index 0469e3c09..000000000 --- a/frame/3/old/bli_gemm_check.h +++ /dev/null @@ -1,54 +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. - -*/ - -void bli_gemm_basic_check( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ); - -void bli_gemm_check( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ); - -void bli_gemm_int_check( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c, - cntx_t* cntx, - gemm_t* cntl ); - diff --git a/frame/3/old/bli_gemm_ukernel.c b/frame/3/old/bli_gemm_ukernel.c deleted file mode 100644 index 681eba569..000000000 --- a/frame/3/old/bli_gemm_ukernel.c +++ /dev/null @@ -1,137 +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. - -*/ - -#include "blis.h" - -#define FUNCPTR_T gemm_ukr_fp - -typedef void (*FUNCPTR_T)( - dim_t k, - void* alpha, - void* a, - void* b, - void* beta, - void* c, inc_t rs_c, inc_t cs_c, - auxinfo_t* data, - cntx_t* cntx, - void* ukr - ); - -static FUNCPTR_T GENARRAY(ftypes,gemm_ukernel_void); - -void bli_gemm_ukernel( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c, - cntx_t* cntx ) -{ - num_t dt = bli_obj_datatype( *c ); - - dim_t k = bli_obj_width( *a ); - - void* buf_a = bli_obj_buffer_at_off( *a ); - - void* buf_b = bli_obj_buffer_at_off( *b ); - - void* buf_c = bli_obj_buffer_at_off( *c ); - inc_t rs_c = bli_obj_row_stride( *c ); - inc_t cs_c = bli_obj_col_stride( *c ); - - void* buf_alpha = bli_obj_buffer_for_1x1( dt, *alpha ); - - void* buf_beta = bli_obj_buffer_for_1x1( dt, *beta ); - - auxinfo_t data; - - FUNCPTR_T f; - - void* gemm_ukr; - - - // Fill the auxinfo_t struct in case the micro-kernel uses it. - bli_auxinfo_set_next_a( buf_a, data ); - bli_auxinfo_set_next_b( buf_b, data ); - - bli_auxinfo_set_is_a( 1, data ); - bli_auxinfo_set_is_b( 1, data ); - - // Query the function address from the micro-kernel func_t object. - gemm_ukrs = bli_cntx_get_l3_ukr( BLIS_GEMM_UKR, cntx ); - gemm_ukr = bli_func_obj_query( dt, gemm_ukrs ); - - // Index into the type combination array to extract the correct - // function pointer. - f = ftypes[dt]; - - // Invoke the function. - f( k, - buf_alpha, - buf_a, - buf_b, - buf_beta, - buf_c, rs_c, cs_c, - &data, - gemm_ukr ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, varname, ukrtype ) \ -\ -void PASTEMAC(ch,varname)( \ - dim_t k, \ - void* alpha, \ - void* a, \ - void* b, \ - void* beta, \ - void* c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data, \ - void* ukr \ - ) \ -{ \ - /* Cast the micro-kernel address to its function pointer type. */ \ - PASTECH(ch,ukrtype) ukr_cast = ukr; \ -\ - ukr_cast( k, \ - alpha, \ - a, \ - b, \ - beta, \ - c, rs_c, cs_c, \ - data ); \ -} - -INSERT_GENTFUNC_BASIC( gemm_ukernel_void, gemm_ukr_t ) - diff --git a/frame/3/old/bli_gemm_ukernel.h b/frame/3/old/bli_gemm_ukernel.h deleted file mode 100644 index 6eafa6187..000000000 --- a/frame/3/old/bli_gemm_ukernel.h +++ /dev/null @@ -1,63 +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. - -*/ - -void bli_gemm_ukernel( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c, - cntx_t* cntx ); - - -// -// Prototype the void pointer kernel wrappers. -// - -#undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname)( \ - dim_t k, \ - void* alpha, \ - void* a, \ - void* b, \ - void* beta, \ - void* c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data, \ - cntx_t* cntx, \ - void* ukr \ - ); - -INSERT_GENTPROT_BASIC( gemm_ukernel_void ) - diff --git a/frame/3/old/bli_gemm_ukr_ref.h b/frame/3/old/bli_gemm_ukr_ref.h deleted file mode 100644 index b1f936191..000000000 --- a/frame/3/old/bli_gemm_ukr_ref.h +++ /dev/null @@ -1,53 +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. - -*/ - - -// -// Prototype micro-kernel interfaces. -// -#undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname)( \ - dim_t k, \ - ctype* restrict alpha, \ - ctype* restrict a, \ - ctype* restrict b, \ - ctype* restrict beta, \ - ctype* restrict c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data \ - ); - -INSERT_GENTPROT_BASIC( gemm_ukr_ref ) - diff --git a/frame/3/old/bli_gemmtrsm_l_ukr_ref.h b/frame/3/old/bli_gemmtrsm_l_ukr_ref.h deleted file mode 100644 index 307dec440..000000000 --- a/frame/3/old/bli_gemmtrsm_l_ukr_ref.h +++ /dev/null @@ -1,54 +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. - -*/ - - -// -// Prototype micro-kernel interfaces. -// -#undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname)( \ - dim_t k, \ - ctype* restrict alpha, \ - ctype* restrict a10, \ - ctype* restrict a11, \ - ctype* restrict b01, \ - ctype* restrict b11, \ - ctype* restrict c11, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data \ - ); - -INSERT_GENTPROT_BASIC( gemmtrsm_l_ukr_ref ) - diff --git a/frame/3/old/bli_gemmtrsm_u_ukr_ref.h b/frame/3/old/bli_gemmtrsm_u_ukr_ref.h deleted file mode 100644 index a90608040..000000000 --- a/frame/3/old/bli_gemmtrsm_u_ukr_ref.h +++ /dev/null @@ -1,54 +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. - -*/ - - -// -// Prototype micro-kernel interfaces. -// -#undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname)( \ - dim_t k, \ - ctype* restrict alpha, \ - ctype* restrict a12, \ - ctype* restrict a11, \ - ctype* restrict b21, \ - ctype* restrict b11, \ - ctype* restrict c11, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data \ - ); - -INSERT_GENTPROT_BASIC( gemmtrsm_u_ukr_ref ) - diff --git a/frame/3/old/bli_gemmtrsm_ukernel.c b/frame/3/old/bli_gemmtrsm_ukernel.c deleted file mode 100644 index 7d9f28d53..000000000 --- a/frame/3/old/bli_gemmtrsm_ukernel.c +++ /dev/null @@ -1,157 +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. - -*/ - -#include "blis.h" - -#undef FUNCPTR_T -#define FUNCPTR_T gemmtrsm_ukr_fp - -typedef void (*FUNCPTR_T)( - dim_t k, - void* alpha, - void* a1x, - void* a11, - void* bx1, - void* b11, - void* c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* data, - cntx_t* cntx, - void* ukr - ); - -static FUNCPTR_T GENARRAY(ftypes_l,gemmtrsm_l_ukernel_void); -static FUNCPTR_T GENARRAY(ftypes_u,gemmtrsm_u_ukernel_void); - -void bli_gemmtrsm_ukernel( obj_t* alpha, - obj_t* a1x, - obj_t* a11, - obj_t* bx1, - obj_t* b11, - obj_t* c11, - cntx_t* cntx ) -{ - dim_t k = bli_obj_width( *a1x ); - - num_t dt = bli_obj_datatype( *c11 ); - - void* buf_a1x = bli_obj_buffer_at_off( *a1x ); - - void* buf_a11 = bli_obj_buffer_at_off( *a11 ); - - void* buf_bx1 = bli_obj_buffer_at_off( *bx1 ); - - void* buf_b11 = bli_obj_buffer_at_off( *b11 ); - - void* buf_c11 = bli_obj_buffer_at_off( *c11 ); - inc_t rs_c = bli_obj_row_stride( *c11 ); - inc_t cs_c = bli_obj_col_stride( *c11 ); - - void* buf_alpha = bli_obj_buffer_for_1x1( dt, *alpha ); - - auxinfo_t data; - - FUNCPTR_T f; - - func_t* gemmtrsm_ukrs; - void* gemmtrsm_ukr; - - - // Fill the auxinfo_t struct in case the micro-kernel uses it. - if ( bli_obj_is_lower( *a11 ) ) - { bli_auxinfo_set_next_a( buf_a1x, data ); } - else - { bli_auxinfo_set_next_a( buf_a11, data ); } - bli_auxinfo_set_next_b( buf_bx1, data ); - - // Query the function address from the micro-kernel func_t object. - if ( bli_obj_is_lower( *a11 ) ) - { - gemmtrsm_ukrs = bli_cntx_get_l3_ukr( BLIS_GEMMTRSM_L_UKR, cntx ); - gemmtrsm_ukr = bli_func_obj_query( dt, gemmtrsm_ukrs ); - } - else - { - gemmtrsm_ukrs = bli_cntx_get_l3_ukr( BLIS_GEMMTRSM_U_UKR, cntx ); - gemmtrsm_ukr = bli_func_obj_query( dt, gemmtrsm_ukrs ); - } - - // Index into the type combination array to extract the correct - // function pointer. - if ( bli_obj_is_lower( *a11 ) ) f = ftypes_l[dt]; - else f = ftypes_u[dt]; - - // Invoke the function. - f( k, - buf_alpha, - buf_a1x, - buf_a11, - buf_bx1, - buf_b11, - buf_c11, rs_c, cs_c, - &data, - gemmtrsm_ukr ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, varname, ukrtype ) \ -\ -void PASTEMAC(ch,varname)( \ - dim_t k, \ - void* alpha, \ - void* a1x, \ - void* a11, \ - void* bx1, \ - void* b11, \ - void* c11, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data, \ - void* ukr \ - ) \ -{ \ - /* Cast the micro-kernel address to its function pointer type. */ \ - PASTECH(ch,ukrtype) ukr_cast = ukr; \ -\ - ukr_cast( k, \ - alpha, \ - a1x, \ - a11, \ - bx1, \ - b11, \ - c11, rs_c, cs_c, \ - data ); \ -} - -INSERT_GENTFUNC_BASIC( gemmtrsm_l_ukernel_void, gemmtrsm_ukr_t ) -INSERT_GENTFUNC_BASIC( gemmtrsm_u_ukernel_void, gemmtrsm_ukr_t ) - diff --git a/frame/3/old/bli_gemmtrsm_ukernel.h b/frame/3/old/bli_gemmtrsm_ukernel.h deleted file mode 100644 index 074c25c84..000000000 --- a/frame/3/old/bli_gemmtrsm_ukernel.h +++ /dev/null @@ -1,66 +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. - -*/ - -void bli_gemmtrsm_ukernel( obj_t* alpha, - obj_t* a1x, - obj_t* a11, - obj_t* bx1, - obj_t* b11, - obj_t* c11, - cntx_t* cntx ); - - -// -// Prototype the void pointer kernel wrappers. -// - -#undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname)( \ - dim_t k, \ - void* alpha, \ - void* a1x, \ - void* a11, \ - void* bx1, \ - void* b11, \ - void* c11, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data, \ - cntx_t* cntx, \ - void* ukr \ - ); - -INSERT_GENTPROT_BASIC( gemmtrsm_l_ukernel_void ) -INSERT_GENTPROT_BASIC( gemmtrsm_u_ukernel_void ) - diff --git a/frame/3/old/bli_hemm.c b/frame/3/old/bli_hemm.c deleted file mode 100644 index 119c85043..000000000 --- a/frame/3/old/bli_hemm.c +++ /dev/null @@ -1,101 +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. - -*/ - -#include "blis.h" - -void bli_hemm( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - // The operation's "ind" function--its induced method front-end--will - // call native execution for real domain problems. For complex problems, - // it calls the highest priority induced method that is available (ie: - // implemented and enabled), and otherwise calls native execution. - bli_hemmind( side, alpha, a, b, beta, c ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname)( \ - side_t side, \ - uplo_t uploa, \ - conj_t conja, \ - trans_t transb, \ - dim_t m, \ - dim_t n, \ - ctype* alpha, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype* b, inc_t rs_b, inc_t cs_b, \ - ctype* beta, \ - ctype* c, inc_t rs_c, inc_t cs_c \ - ) \ -{ \ - const num_t dt = PASTEMAC(ch,type); \ -\ - obj_t alphao, ao, bo, betao, co; \ -\ - dim_t mn_a; \ - dim_t m_b, n_b; \ -\ - bli_set_dim_with_side( side, m, n, mn_a ); \ - bli_set_dims_with_trans( transb, m, n, m_b, n_b ); \ -\ - bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \ - bli_obj_create_1x1_with_attached_buffer( dt, beta, &betao ); \ -\ - bli_obj_create_with_attached_buffer( dt, mn_a, mn_a, a, rs_a, cs_a, &ao ); \ - bli_obj_create_with_attached_buffer( dt, m_b, n_b, b, rs_b, cs_b, &bo ); \ - bli_obj_create_with_attached_buffer( dt, m, n, c, rs_c, cs_c, &co ); \ -\ - bli_obj_set_uplo( uploa, ao ); \ - bli_obj_set_conj( conja, ao ); \ - bli_obj_set_conjtrans( transb, bo ); \ -\ - bli_obj_set_struc( BLIS_HERMITIAN, ao ); \ -\ - PASTEMAC0(opname)( side, \ - &alphao, \ - &ao, \ - &bo, \ - &betao, \ - &co ); \ -} - -INSERT_GENTFUNC_BASIC0( hemm ) - diff --git a/frame/3/old/bli_hemm_check.c b/frame/3/old/bli_hemm_check.c deleted file mode 100644 index 1479c7496..000000000 --- a/frame/3/old/bli_hemm_check.c +++ /dev/null @@ -1,166 +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. - -*/ - -#include "blis.h" - -void bli_hemm_basic_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - err_t e_val; - - // Check operation parameters. - - e_val = bli_check_valid_side( side ); - bli_check_error_code( e_val ); - - // Check object datatypes. - - e_val = bli_check_noninteger_object( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_noninteger_object( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( c ); - bli_check_error_code( e_val ); - - // 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 ); - } - - // Check matrix structure. - - e_val = bli_check_general_object( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_general_object( c ); - bli_check_error_code( e_val ); -} - -void bli_hemm_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - err_t e_val; - - // Check object pointers. - - e_val = bli_check_null_pointer( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_null_pointer( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_null_pointer( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_null_pointer( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_null_pointer( c ); - bli_check_error_code( e_val ); - - // Check basic properties of the operation. - - bli_hemm_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_hermitian_object( a ); - bli_check_error_code( e_val ); -} - -void bli_hemm_int_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c, - cntx_t* cntx, - gemm_t* cntl ) -{ - err_t e_val; - - // Check basic properties of the operation. - - bli_hemm_basic_check( side, alpha, a, b, beta, c ); - - // Check control tree pointer. - - e_val = bli_check_valid_cntl( ( void* )cntl ); - bli_check_error_code( e_val ); -} - diff --git a/frame/3/old/bli_hemm_check.h b/frame/3/old/bli_hemm_check.h deleted file mode 100644 index 45e21d3df..000000000 --- a/frame/3/old/bli_hemm_check.h +++ /dev/null @@ -1,57 +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. - -*/ - -void bli_hemm_basic_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ); - -void bli_hemm_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ); - -void bli_hemm_int_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c, - cntx_t* cntx, - gemm_t* cntl ); - diff --git a/frame/3/old/bli_her2k.c b/frame/3/old/bli_her2k.c deleted file mode 100644 index 5abce4385..000000000 --- a/frame/3/old/bli_her2k.c +++ /dev/null @@ -1,99 +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. - -*/ - -#include "blis.h" - -void bli_her2k( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - // The operation's "ind" function--its induced method front-end--will - // call native execution for real domain problems. For complex problems, - // it calls the highest priority induced method that is available (ie: - // implemented and enabled), and otherwise calls native execution. - bli_her2kind( alpha, a, b, beta, c ); -} - - -#undef GENTFUNCR -#define GENTFUNCR( ctype, ctype_r, ch, chr, opname ) \ -\ -void PASTEMAC(ch,opname)( \ - uplo_t uploc, \ - trans_t transa, \ - trans_t transb, \ - dim_t m, \ - dim_t k, \ - ctype* alpha, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype* b, inc_t rs_b, inc_t cs_b, \ - ctype_r* beta, \ - ctype* c, inc_t rs_c, inc_t cs_c \ - ) \ -{ \ - const num_t dt_r = PASTEMAC(chr,type); \ - const num_t dt = PASTEMAC(ch,type); \ -\ - obj_t alphao, ao, bo, betao, co; \ -\ - dim_t m_a, n_a; \ - dim_t m_b, n_b; \ -\ - bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \ - bli_set_dims_with_trans( transb, m, k, m_b, n_b ); \ -\ - bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \ - bli_obj_create_1x1_with_attached_buffer( dt_r, beta, &betao ); \ -\ - bli_obj_create_with_attached_buffer( dt, m_a, n_a, a, rs_a, cs_a, &ao ); \ - bli_obj_create_with_attached_buffer( dt, m_b, n_b, b, rs_b, cs_b, &bo ); \ - bli_obj_create_with_attached_buffer( dt, m, m, c, rs_c, cs_c, &co ); \ -\ - bli_obj_set_uplo( uploc, co ); \ - bli_obj_set_conjtrans( transa, ao ); \ - bli_obj_set_conjtrans( transb, bo ); \ -\ - bli_obj_set_struc( BLIS_HERMITIAN, co ); \ -\ - PASTEMAC0(opname)( &alphao, \ - &ao, \ - &bo, \ - &betao, \ - &co ); \ -} - -INSERT_GENTFUNCR_BASIC0( her2k ) - diff --git a/frame/3/old/bli_her2k_check.c b/frame/3/old/bli_her2k_check.c deleted file mode 100644 index 51dae2964..000000000 --- a/frame/3/old/bli_her2k_check.c +++ /dev/null @@ -1,202 +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. - -*/ - -#include "blis.h" - -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 ) -{ - err_t e_val; - - // Check object datatypes. - - e_val = bli_check_noninteger_object( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_noninteger_object( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( bh ); - bli_check_error_code( e_val ); - - e_val = bli_check_noninteger_object( alpha_conj ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( ah ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( c ); - bli_check_error_code( e_val ); - - // 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( ah ); - 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( bh ); - bli_check_error_code( e_val ); - - e_val = bli_check_matrix_object( c ); - bli_check_error_code( e_val ); - - e_val = bli_check_level3_dims( a, bh, c ); - bli_check_error_code( e_val ); - - e_val = bli_check_scalar_object( alpha_conj ); - bli_check_error_code( e_val ); - - e_val = bli_check_level3_dims( b, ah, c ); - bli_check_error_code( e_val ); - - // Check matrix structure. - - e_val = bli_check_general_object( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_general_object( bh ); - bli_check_error_code( e_val ); - - e_val = bli_check_general_object( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_general_object( ah ); - bli_check_error_code( e_val ); -} - -void bli_her2k_check( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - err_t e_val; - obj_t ah, bh; - - // Alias A and B to A^H and B^H so we can perform dimension checks. - bli_obj_alias_with_trans( BLIS_CONJ_TRANSPOSE, *a, ah ); - bli_obj_alias_with_trans( BLIS_CONJ_TRANSPOSE, *b, bh ); - - // Check basic properties of the operation. - - bli_her2k_basic_check( alpha, a, &bh, alpha, b, &ah, beta, c ); - - // Check for real-valued beta. - - e_val = bli_check_real_valued_object( beta ); - bli_check_error_code( e_val ); - - // Check matrix squareness. - - e_val = bli_check_square_object( c ); - bli_check_error_code( e_val ); - - // Check matrix structure. - - e_val = bli_check_hermitian_object( c ); - bli_check_error_code( e_val ); -} - -#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 ) -{ - err_t e_val; - - // Check object buffers (for non-NULLness). - - e_val = bli_check_object_buffer( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( bh ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( alpha_conj ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( ah ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( c ); - bli_check_error_code( e_val ); - - // Check basic properties of the operation. - - bli_her2k_basic_check( alpha, a, bh, alpha_conj, b, ah, beta, c ); - - // Check control tree pointer - - e_val = bli_check_valid_cntl( ( void* )cntl ); - bli_check_error_code( e_val ); -} -#endif diff --git a/frame/3/old/bli_herk.c b/frame/3/old/bli_herk.c deleted file mode 100644 index 4a93c2e12..000000000 --- a/frame/3/old/bli_herk.c +++ /dev/null @@ -1,91 +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. - -*/ - -#include "blis.h" - -void bli_herk( obj_t* alpha, - obj_t* a, - obj_t* beta, - obj_t* c ) -{ - // The operation's "ind" function--its induced method front-end--will - // call native execution for real domain problems. For complex problems, - // it calls the highest priority induced method that is available (ie: - // implemented and enabled), and otherwise calls native execution. - bli_herkind( alpha, a, beta, c ); -} - - -#undef GENTFUNCR -#define GENTFUNCR( ctype, ctype_r, ch, chr, opname ) \ -\ -void PASTEMAC(ch,opname)( \ - uplo_t uploc, \ - trans_t transa, \ - dim_t m, \ - dim_t k, \ - ctype_r* alpha, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype_r* beta, \ - ctype* c, inc_t rs_c, inc_t cs_c \ - ) \ -{ \ - const num_t dt_r = PASTEMAC(chr,type); \ - const num_t dt = PASTEMAC(ch,type); \ -\ - obj_t alphao, ao, betao, co; \ -\ - dim_t m_a, n_a; \ -\ - bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \ -\ - bli_obj_create_1x1_with_attached_buffer( dt_r, alpha, &alphao ); \ - bli_obj_create_1x1_with_attached_buffer( dt_r, beta, &betao ); \ -\ - bli_obj_create_with_attached_buffer( dt, m_a, n_a, a, rs_a, cs_a, &ao ); \ - bli_obj_create_with_attached_buffer( dt, m, m, c, rs_c, cs_c, &co ); \ -\ - bli_obj_set_uplo( uploc, co ); \ - bli_obj_set_conjtrans( transa, ao ); \ -\ - bli_obj_set_struc( BLIS_HERMITIAN, co ); \ -\ - PASTEMAC0(opname)( &alphao, \ - &ao, \ - &betao, \ - &co ); \ -} - -INSERT_GENTFUNCR_BASIC0( herk ) - diff --git a/frame/3/old/bli_herk_check.c b/frame/3/old/bli_herk_check.c deleted file mode 100644 index 0ebc7dbcd..000000000 --- a/frame/3/old/bli_herk_check.c +++ /dev/null @@ -1,161 +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. - -*/ - -#include "blis.h" - -void bli_herk_basic_check( obj_t* alpha, - obj_t* a, - obj_t* ah, - obj_t* beta, - obj_t* c ) -{ - err_t e_val; - - // Check object datatypes. - - e_val = bli_check_noninteger_object( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_noninteger_object( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( ah ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( c ); - bli_check_error_code( e_val ); - - // 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( ah ); - bli_check_error_code( e_val ); - - e_val = bli_check_matrix_object( c ); - bli_check_error_code( e_val ); - - e_val = bli_check_level3_dims( a, ah, c ); - bli_check_error_code( e_val ); - - // Check matrix structure. - - e_val = bli_check_general_object( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_general_object( ah ); - bli_check_error_code( e_val ); -} - -void bli_herk_check( obj_t* alpha, - obj_t* a, - obj_t* beta, - obj_t* c ) -{ - err_t e_val; - obj_t ah; - - // Alias A to A^H so we can perform dimension checks. - bli_obj_alias_with_trans( BLIS_CONJ_TRANSPOSE, *a, ah ); - - // Check basic properties of the operation. - - bli_herk_basic_check( alpha, a, &ah, beta, c ); - - // Check for real-valued alpha and beta. - - e_val = bli_check_real_valued_object( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_real_valued_object( beta ); - bli_check_error_code( e_val ); - - // Check matrix squareness. - - e_val = bli_check_square_object( c ); - bli_check_error_code( e_val ); - - // Check matrix structure. - - e_val = bli_check_hermitian_object( c ); - bli_check_error_code( e_val ); -} - -void bli_herk_int_check( obj_t* alpha, - obj_t* a, - obj_t* ah, - obj_t* beta, - obj_t* c, - cntx_t* cntx, - gemm_t* cntl ) -{ - err_t e_val; - - // Check object buffers (for non-NULLness). - - e_val = bli_check_object_buffer( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( ah ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( c ); - bli_check_error_code( e_val ); - - // Check basic properties of the operation. - - bli_herk_basic_check( alpha, a, ah, beta, c ); - - // Check control tree pointer. - - e_val = bli_check_valid_cntl( ( void* )cntl ); - bli_check_error_code( e_val ); -} - diff --git a/frame/3/old/bli_herk_check.h b/frame/3/old/bli_herk_check.h deleted file mode 100644 index ceb215ea5..000000000 --- a/frame/3/old/bli_herk_check.h +++ /dev/null @@ -1,53 +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. - -*/ - -void bli_herk_basic_check( obj_t* alpha, - obj_t* a, - obj_t* ah, - obj_t* beta, - obj_t* c ); - -void bli_herk_check( obj_t* alpha, - obj_t* a, - obj_t* beta, - obj_t* c ); - -void bli_herk_int_check( obj_t* alpha, - obj_t* a, - obj_t* ah, - obj_t* beta, - obj_t* c, - cntx_t* cntx, - gemm_t* cntl ); - diff --git a/frame/3/old/bli_herk_prune.c b/frame/3/old/bli_herk_prune.c deleted file mode 100644 index a02c50a34..000000000 --- a/frame/3/old/bli_herk_prune.c +++ /dev/null @@ -1,64 +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. - -*/ - -#include "blis.h" - -void bli_herk_prune_unref_mparts_m( obj_t* a, - obj_t* ah, - obj_t* c ) -{ - // Prune any unreferenced part from the subpartition of C (that would - // be encountered from partitioning in the m dimension) and adjust the - // subpartition of A accordingly. - bli_prune_unref_mparts( c, BLIS_M, a, BLIS_M ); -} - -void bli_herk_prune_unref_mparts_n( obj_t* a, - obj_t* ah, - obj_t* c ) -{ - // Prune any unreferenced part from the subpartition of C (that would - // be encountered from partitioning in the n dimension) and adjust the - // subpartition of Ah accordingly. - bli_prune_unref_mparts( c, BLIS_N, ah, BLIS_N ); -} - -void bli_herk_prune_unref_mparts_k( obj_t* a, - obj_t* ah, - obj_t* c ) -{ - // As long as A and Ah are general in structure, no pruning should be - // for the k dimension. -} - diff --git a/frame/3/bli_l3_cntx.c b/frame/3/old/bli_l3_cntx.c similarity index 100% rename from frame/3/bli_l3_cntx.c rename to frame/3/old/bli_l3_cntx.c diff --git a/frame/3/bli_l3_cntx.h b/frame/3/old/bli_l3_cntx.h similarity index 100% rename from frame/3/bli_l3_cntx.h rename to frame/3/old/bli_l3_cntx.h diff --git a/frame/3/old/bli_symm.c b/frame/3/old/bli_symm.c deleted file mode 100644 index 33fc56dc6..000000000 --- a/frame/3/old/bli_symm.c +++ /dev/null @@ -1,101 +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. - -*/ - -#include "blis.h" - -void bli_symm( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - // The operation's "ind" function--its induced method front-end--will - // call native execution for real domain problems. For complex problems, - // it calls the highest priority induced method that is available (ie: - // implemented and enabled), and otherwise calls native execution. - bli_symmind( side, alpha, a, b, beta, c ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname)( \ - side_t side, \ - uplo_t uploa, \ - conj_t conja, \ - trans_t transb, \ - dim_t m, \ - dim_t n, \ - ctype* alpha, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype* b, inc_t rs_b, inc_t cs_b, \ - ctype* beta, \ - ctype* c, inc_t rs_c, inc_t cs_c \ - ) \ -{ \ - const num_t dt = PASTEMAC(ch,type); \ -\ - obj_t alphao, ao, bo, betao, co; \ -\ - dim_t mn_a; \ - dim_t m_b, n_b; \ -\ - bli_set_dim_with_side( side, m, n, mn_a ); \ - bli_set_dims_with_trans( transb, m, n, m_b, n_b ); \ -\ - bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \ - bli_obj_create_1x1_with_attached_buffer( dt, beta, &betao ); \ -\ - bli_obj_create_with_attached_buffer( dt, mn_a, mn_a, a, rs_a, cs_a, &ao ); \ - bli_obj_create_with_attached_buffer( dt, m_b, n_b, b, rs_b, cs_b, &bo ); \ - bli_obj_create_with_attached_buffer( dt, m, n, c, rs_c, cs_c, &co ); \ -\ - bli_obj_set_uplo( uploa, ao ); \ - bli_obj_set_conj( conja, ao ); \ - bli_obj_set_conjtrans( transb, bo ); \ -\ - bli_obj_set_struc( BLIS_SYMMETRIC, ao ); \ -\ - PASTEMAC0(opname)( side, \ - &alphao, \ - &ao, \ - &bo, \ - &betao, \ - &co ); \ -} - -INSERT_GENTFUNC_BASIC0( symm ) - diff --git a/frame/3/old/bli_symm_check.h b/frame/3/old/bli_symm_check.h deleted file mode 100644 index 4c3abb9f7..000000000 --- a/frame/3/old/bli_symm_check.h +++ /dev/null @@ -1,48 +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. - -*/ - -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_symm_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ); - diff --git a/frame/3/old/bli_syr2k.c b/frame/3/old/bli_syr2k.c deleted file mode 100644 index 8f8469926..000000000 --- a/frame/3/old/bli_syr2k.c +++ /dev/null @@ -1,98 +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. - -*/ - -#include "blis.h" - -void bli_syr2k( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - // The operation's "ind" function--its induced method front-end--will - // call native execution for real domain problems. For complex problems, - // it calls the highest priority induced method that is available (ie: - // implemented and enabled), and otherwise calls native execution. - bli_syr2kind( alpha, a, b, beta, c ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname)( \ - uplo_t uploc, \ - trans_t transa, \ - trans_t transb, \ - dim_t m, \ - dim_t k, \ - ctype* alpha, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype* b, inc_t rs_b, inc_t cs_b, \ - ctype* beta, \ - ctype* c, inc_t rs_c, inc_t cs_c \ - ) \ -{ \ - const num_t dt = PASTEMAC(ch,type); \ -\ - obj_t alphao, ao, bo, betao, co; \ -\ - dim_t m_a, n_a; \ - dim_t m_b, n_b; \ -\ - bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \ - bli_set_dims_with_trans( transb, m, k, m_b, n_b ); \ -\ - bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \ - bli_obj_create_1x1_with_attached_buffer( dt, beta, &betao ); \ -\ - bli_obj_create_with_attached_buffer( dt, m_a, n_a, a, rs_a, cs_a, &ao ); \ - bli_obj_create_with_attached_buffer( dt, m_b, n_b, b, rs_b, cs_b, &bo ); \ - bli_obj_create_with_attached_buffer( dt, m, m, c, rs_c, cs_c, &co ); \ -\ - bli_obj_set_uplo( uploc, co ); \ - bli_obj_set_conjtrans( transa, ao ); \ - bli_obj_set_conjtrans( transb, bo ); \ -\ - bli_obj_set_struc( BLIS_SYMMETRIC, co ); \ -\ - PASTEMAC0(opname)( &alphao, \ - &ao, \ - &bo, \ - &betao, \ - &co ); \ -} - -INSERT_GENTFUNC_BASIC0( syr2k ) - diff --git a/frame/3/old/bli_syr2k_check.h b/frame/3/old/bli_syr2k_check.h deleted file mode 100644 index e3bf98127..000000000 --- a/frame/3/old/bli_syr2k_check.h +++ /dev/null @@ -1,48 +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. - -*/ - -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_syr2k_check( obj_t* alpha, - obj_t* a, - obj_t* bt, - obj_t* beta, - obj_t* c ); - diff --git a/frame/3/old/bli_syrk.c b/frame/3/old/bli_syrk.c deleted file mode 100644 index 8e4b72315..000000000 --- a/frame/3/old/bli_syrk.c +++ /dev/null @@ -1,90 +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. - -*/ - -#include "blis.h" - -void bli_syrk( obj_t* alpha, - obj_t* a, - obj_t* beta, - obj_t* c ) -{ - // The operation's "ind" function--its induced method front-end--will - // call native execution for real domain problems. For complex problems, - // it calls the highest priority induced method that is available (ie: - // implemented and enabled), and otherwise calls native execution. - bli_syrkind( alpha, a, beta, c ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname)( \ - uplo_t uploc, \ - trans_t transa, \ - dim_t m, \ - dim_t k, \ - ctype* alpha, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype* beta, \ - ctype* c, inc_t rs_c, inc_t cs_c \ - ) \ -{ \ - const num_t dt = PASTEMAC(ch,type); \ -\ - obj_t alphao, ao, betao, co; \ -\ - dim_t m_a, n_a; \ -\ - bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \ -\ - bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \ - bli_obj_create_1x1_with_attached_buffer( dt, beta, &betao ); \ -\ - bli_obj_create_with_attached_buffer( dt, m_a, n_a, a, rs_a, cs_a, &ao ); \ - bli_obj_create_with_attached_buffer( dt, m, m, c, rs_c, cs_c, &co ); \ -\ - bli_obj_set_uplo( uploc, co ); \ - bli_obj_set_conjtrans( transa, ao ); \ -\ - bli_obj_set_struc( BLIS_SYMMETRIC, co ); \ -\ - PASTEMAC0(opname)( &alphao, \ - &ao, \ - &betao, \ - &co ); \ -} - -INSERT_GENTFUNC_BASIC0( syrk ) - diff --git a/frame/3/old/bli_syrk_check.h b/frame/3/old/bli_syrk_check.h deleted file mode 100644 index 3995f5199..000000000 --- a/frame/3/old/bli_syrk_check.h +++ /dev/null @@ -1,45 +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. - -*/ - -void bli_syrk_basic_check( obj_t* alpha, - obj_t* a, - obj_t* at, - obj_t* beta, - obj_t* c ); - -void bli_syrk_check( obj_t* alpha, - obj_t* a, - obj_t* beta, - obj_t* c ); - diff --git a/frame/3/old/bli_trmm.c b/frame/3/old/bli_trmm.c deleted file mode 100644 index 28dd60889..000000000 --- a/frame/3/old/bli_trmm.c +++ /dev/null @@ -1,91 +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. - -*/ - -#include "blis.h" - -void bli_trmm( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b ) -{ - // The operation's "ind" function--its induced method front-end--will - // call native execution for real domain problems. For complex problems, - // it calls the highest priority induced method that is available (ie: - // implemented and enabled), and otherwise calls native execution. - bli_trmmind( side, alpha, a, b ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname)( \ - side_t side, \ - uplo_t uploa, \ - trans_t transa, \ - diag_t diaga, \ - dim_t m, \ - dim_t n, \ - ctype* alpha, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype* b, inc_t rs_b, inc_t cs_b \ - ) \ -{ \ - const num_t dt = PASTEMAC(ch,type); \ -\ - obj_t alphao, ao, bo; \ -\ - dim_t mn_a; \ -\ - bli_set_dim_with_side( side, m, n, mn_a ); \ -\ - bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \ -\ - bli_obj_create_with_attached_buffer( dt, mn_a, mn_a, a, rs_a, cs_a, &ao ); \ - bli_obj_create_with_attached_buffer( dt, m, n, b, rs_b, cs_b, &bo ); \ -\ - bli_obj_set_uplo( uploa, ao ); \ - bli_obj_set_diag( diaga, ao ); \ - bli_obj_set_conjtrans( transa, ao ); \ -\ - bli_obj_set_struc( BLIS_TRIANGULAR, ao ); \ -\ - PASTEMAC0(opname)( side, \ - &alphao, \ - &ao, \ - &bo ); \ -} - -INSERT_GENTFUNC_BASIC0( trmm ) - diff --git a/frame/3/old/bli_trmm3.c b/frame/3/old/bli_trmm3.c deleted file mode 100644 index 57011692c..000000000 --- a/frame/3/old/bli_trmm3.c +++ /dev/null @@ -1,103 +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. - -*/ - -#include "blis.h" - -void bli_trmm3( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - // The operation's "ind" function--its induced method front-end--will - // call native execution for real domain problems. For complex problems, - // it calls the highest priority induced method that is available (ie: - // implemented and enabled), and otherwise calls native execution. - bli_trmm3ind( side, alpha, a, b, beta, c ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname)( \ - side_t side, \ - uplo_t uploa, \ - trans_t transa, \ - diag_t diaga, \ - trans_t transb, \ - dim_t m, \ - dim_t n, \ - ctype* alpha, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype* b, inc_t rs_b, inc_t cs_b, \ - ctype* beta, \ - ctype* c, inc_t rs_c, inc_t cs_c \ - ) \ -{ \ - const num_t dt = PASTEMAC(ch,type); \ -\ - obj_t alphao, ao, bo, betao, co; \ -\ - dim_t mn_a; \ - dim_t m_b, n_b; \ -\ - bli_set_dim_with_side( side, m, n, mn_a ); \ - bli_set_dims_with_trans( transb, m, n, m_b, n_b ); \ -\ - bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \ - bli_obj_create_1x1_with_attached_buffer( dt, beta, &betao ); \ -\ - bli_obj_create_with_attached_buffer( dt, mn_a, mn_a, a, rs_a, cs_a, &ao ); \ - bli_obj_create_with_attached_buffer( dt, m_b, n_b, b, rs_b, cs_b, &bo ); \ - bli_obj_create_with_attached_buffer( dt, m, n, c, rs_c, cs_c, &co ); \ -\ - bli_obj_set_uplo( uploa, ao ); \ - bli_obj_set_diag( diaga, ao ); \ - bli_obj_set_conjtrans( transa, ao ); \ - bli_obj_set_conjtrans( transb, bo ); \ -\ - bli_obj_set_struc( BLIS_TRIANGULAR, ao ); \ -\ - PASTEMAC0(opname)( side, \ - &alphao, \ - &ao, \ - &bo, \ - &betao, \ - &co ); \ -} - -INSERT_GENTFUNC_BASIC0( trmm3 ) - diff --git a/frame/3/old/bli_trmm3_check.h b/frame/3/old/bli_trmm3_check.h deleted file mode 100644 index 4dd7316ed..000000000 --- a/frame/3/old/bli_trmm3_check.h +++ /dev/null @@ -1,47 +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. - -*/ - -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_trmm3_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ); diff --git a/frame/3/old/bli_trmm_blocksize.c b/frame/3/old/bli_trmm_blocksize.c deleted file mode 100644 index dfe07bddf..000000000 --- a/frame/3/old/bli_trmm_blocksize.c +++ /dev/null @@ -1,117 +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. - -*/ - -#include "blis.h" - -dim_t bli_trmm_determine_kc_f( dim_t i, - dim_t dim, - obj_t* a, - obj_t* b, - bszid_t bszid, - cntx_t* cntx ) -{ - num_t dt; - blksz_t* bsize; - dim_t mnr; - dim_t b_alg, b_max; - dim_t b_use; - - // We assume that this function is being called from an algorithm that - // is moving "forward" (ie: top to bottom, left to right, top-left - // to bottom-right). - - // Extract the execution datatype and use it to query the corresponding - // blocksize and blocksize maximum values from the blksz_t object. - dt = bli_obj_execution_datatype( *a ); - bsize = bli_cntx_get_blksz( bszid, cntx ); - b_alg = bli_blksz_get_def( dt, bsize ); - b_max = bli_blksz_get_max( dt, bsize ); - - // Nudge the default and maximum kc blocksizes up to the nearest - // multiple of MR if the triangular matrix is on the left, or NR - // if the triangular matrix is one the right. - if ( bli_obj_root_is_triangular( *a ) ) - mnr = bli_cntx_get_blksz_def_dt( dt, BLIS_MR, cntx ); - else - mnr = bli_cntx_get_blksz_def_dt( dt, BLIS_NR, cntx ); - - b_alg = bli_align_dim_to_mult( b_alg, mnr ); - b_max = bli_align_dim_to_mult( b_max, mnr ); - - b_use = bli_determine_blocksize_f_sub( i, dim, b_alg, b_max ); - - return b_use; -} - - -dim_t bli_trmm_determine_kc_b( dim_t i, - dim_t dim, - obj_t* a, - obj_t* b, - bszid_t bszid, - cntx_t* cntx ) -{ - num_t dt; - blksz_t* bsize; - dim_t mnr; - dim_t b_alg, b_max; - dim_t b_use; - - // We assume that this function is being called from an algorithm that - // is moving "backward" (ie: bottom to top, right to left, bottom-right - // to top-left). - - // Extract the execution datatype and use it to query the corresponding - // blocksize and blocksize maximum values from the blksz_t object. - dt = bli_obj_execution_datatype( *a ); - bsize = bli_cntx_get_blksz( bszid, cntx ); - b_alg = bli_blksz_get_def( dt, bsize ); - b_max = bli_blksz_get_max( dt, bsize ); - - // Nudge the default and maximum kc blocksizes up to the nearest - // multiple of MR if the triangular matrix is on the left, or NR - // if the triangular matrix is one the right. - if ( bli_obj_root_is_triangular( *a ) ) - mnr = bli_cntx_get_blksz_def_dt( dt, BLIS_MR, cntx ); - else - mnr = bli_cntx_get_blksz_def_dt( dt, BLIS_NR, cntx ); - - b_alg = bli_align_dim_to_mult( b_alg, mnr ); - b_max = bli_align_dim_to_mult( b_max, mnr ); - - b_use = bli_determine_blocksize_b_sub( i, dim, b_alg, b_max ); - - return b_use; -} - diff --git a/frame/3/old/bli_trmm_blocksize.h b/frame/3/old/bli_trmm_blocksize.h deleted file mode 100644 index 886b4d954..000000000 --- a/frame/3/old/bli_trmm_blocksize.h +++ /dev/null @@ -1,46 +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. - -*/ - -dim_t bli_trmm_determine_kc_f( dim_t i, - dim_t dim, - obj_t* a, - obj_t* b, - bszid_t bszid, - cntx_t* cntx ); -dim_t bli_trmm_determine_kc_b( dim_t i, - dim_t dim, - obj_t* a, - obj_t* b, - bszid_t bszid, - cntx_t* cntx ); diff --git a/frame/3/old/bli_trmm_check.c b/frame/3/old/bli_trmm_check.c deleted file mode 100644 index 39366829e..000000000 --- a/frame/3/old/bli_trmm_check.c +++ /dev/null @@ -1,150 +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. - -*/ - -#include "blis.h" - -void bli_trmm_basic_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - err_t e_val; - - // Check object datatypes. - - 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 ); - - e_val = bli_check_floating_object( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_noninteger_object( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( c ); - bli_check_error_code( e_val ); - - // 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_trmm_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b ) -{ - err_t e_val; - - // Check basic properties of the operation. - - bli_trmm_basic_check( side, alpha, a, b, &BLIS_ZERO, b ); - - // Check matrix squareness. - - e_val = bli_check_square_object( a ); - bli_check_error_code( e_val ); - - // Check matrix structure. - - e_val = bli_check_triangular_object( a ); - bli_check_error_code( e_val ); -} - -void bli_trmm_int_check( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c, - cntx_t* cntx, - gemm_t* cntl ) -{ - err_t e_val; - - // Check object buffers (for non-NULLness). - - e_val = bli_check_object_buffer( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( c ); - bli_check_error_code( e_val ); - - // Check basic properties of the operation. - - bli_trmm_basic_check( BLIS_LEFT, alpha, a, b, beta, c ); - - // Check control tree pointer - - e_val = bli_check_valid_cntl( ( void* )cntl ); - bli_check_error_code( e_val ); -} - diff --git a/frame/3/old/bli_trmm_check.h b/frame/3/old/bli_trmm_check.h deleted file mode 100644 index 97e4714eb..000000000 --- a/frame/3/old/bli_trmm_check.h +++ /dev/null @@ -1,54 +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. - -*/ - -void bli_trmm_basic_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ); - -void bli_trmm_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b ); - -void bli_trmm_int_check( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c, - cntx_t* cntx, - gemm_t* cntl ); - diff --git a/frame/3/old/bli_trmm_prune.h b/frame/3/old/bli_trmm_prune.h deleted file mode 100644 index 1d065a58e..000000000 --- a/frame/3/old/bli_trmm_prune.h +++ /dev/null @@ -1,38 +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. - -*/ - -void bli_trmm_prune_unref_mparts_m( obj_t* a, obj_t* b, obj_t* c ); -void bli_trmm_prune_unref_mparts_n( obj_t* a, obj_t* b, obj_t* c ); -void bli_trmm_prune_unref_mparts_k( obj_t* a, obj_t* b, obj_t* c ); - diff --git a/frame/3/old/bli_trsm.c b/frame/3/old/bli_trsm.c deleted file mode 100644 index 58a21c398..000000000 --- a/frame/3/old/bli_trsm.c +++ /dev/null @@ -1,91 +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. - -*/ - -#include "blis.h" - -void bli_trsm( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b ) -{ - // The operation's "ind" function--its induced method front-end--will - // call native execution for real domain problems. For complex problems, - // it calls the highest priority induced method that is available (ie: - // implemented and enabled), and otherwise calls native execution. - bli_trsmind( side, alpha, a, b ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, opname ) \ -\ -void PASTEMAC(ch,opname)( \ - side_t side, \ - uplo_t uploa, \ - trans_t transa, \ - diag_t diaga, \ - dim_t m, \ - dim_t n, \ - ctype* alpha, \ - ctype* a, inc_t rs_a, inc_t cs_a, \ - ctype* b, inc_t rs_b, inc_t cs_b \ - ) \ -{ \ - const num_t dt = PASTEMAC(ch,type); \ -\ - obj_t alphao, ao, bo; \ -\ - dim_t mn_a; \ -\ - bli_set_dim_with_side( side, m, n, mn_a ); \ -\ - bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \ -\ - bli_obj_create_with_attached_buffer( dt, mn_a, mn_a, a, rs_a, cs_a, &ao ); \ - bli_obj_create_with_attached_buffer( dt, m, n, b, rs_b, cs_b, &bo ); \ -\ - bli_obj_set_uplo( uploa, ao ); \ - bli_obj_set_diag( diaga, ao ); \ - bli_obj_set_conjtrans( transa, ao ); \ -\ - bli_obj_set_struc( BLIS_TRIANGULAR, ao ); \ -\ - PASTEMAC0(opname)( side, \ - &alphao, \ - &ao, \ - &bo ); \ -} - -INSERT_GENTFUNC_BASIC0( trsm ) - diff --git a/frame/3/old/bli_trsm_blocksize.c b/frame/3/old/bli_trsm_blocksize.c deleted file mode 100644 index 71401bbab..000000000 --- a/frame/3/old/bli_trsm_blocksize.c +++ /dev/null @@ -1,111 +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. - -*/ - -#include "blis.h" - -dim_t bli_trsm_determine_kc_f( dim_t i, - dim_t dim, - obj_t* obj, - bszid_t bszid, - cntx_t* cntx ) -{ - num_t dt; - blksz_t* bsize; - dim_t mnr; - dim_t b_alg, b_max; - dim_t b_use; - - // We assume that this function is being called from an algorithm that - // is moving "forward" (ie: top to bottom, left to right, top-left - // to bottom-right). - - // Extract the execution datatype and use it to query the corresponding - // blocksize and blocksize maximum values from the blksz_t object. - dt = bli_obj_execution_datatype( *obj ); - bsize = bli_cntx_get_blksz( bszid, cntx ); - b_alg = bli_blksz_get_def( dt, bsize ); - b_max = bli_blksz_get_max( dt, bsize ); - - // Nudge the default and maximum kc blocksizes up to the nearest - // multiple of MR. We always use MR (rather than sometimes using NR) - // because even when the triangle is on the right, packing of that - // matrix uses MR, since only left-side trsm micro-kernels are - // supported. - mr = bli_cntx_get_blksz_def_dt( dt, BLIS_MR, cntx ); - b_alg = bli_align_dim_to_mult( b_alg, mr ); - b_max = bli_align_dim_to_mult( b_max, mr ); - - b_use = bli_determine_blocksize_f_sub( i, dim, b_alg, b_max ); - - return b_use; -} - - -dim_t bli_trsm_determine_kc_b( dim_t i, - dim_t dim, - obj_t* obj, - bszid_t bszid, - cntx_t* cntx ) -{ - num_t dt; - blksz_t* bsize; - dim_t mnr; - dim_t b_alg, b_max; - dim_t b_use; - - // We assume that this function is being called from an algorithm that - // is moving "backward" (ie: bottom to top, right to left, bottom-right - // to top-left). - - // Extract the execution datatype and use it to query the corresponding - // blocksize and blocksize maximum values from the blksz_t object. - dt = bli_obj_execution_datatype( *obj ); - bsize = bli_cntx_get_blksz( bszid, cntx ); - b_alg = bli_blksz_get_def( dt, bsize ); - b_max = bli_blksz_get_max( dt, bsize ); - - // Nudge the default and maximum kc blocksizes up to the nearest - // multiple of MR. We always use MR (rather than sometimes using NR) - // because even when the triangle is on the right, packing of that - // matrix uses MR, since only left-side trsm micro-kernels are - // supported. - mr = bli_cntx_get_blksz_def_dt( dt, BLIS_MR, cntx ); - b_alg = bli_align_dim_to_mult( b_alg, mr ); - b_max = bli_align_dim_to_mult( b_max, mr ); - - b_use = bli_determine_blocksize_b_sub( i, dim, b_alg, b_max ); - - return b_use; -} - diff --git a/frame/3/old/bli_trsm_blocksize.h b/frame/3/old/bli_trsm_blocksize.h deleted file mode 100644 index 411e78a11..000000000 --- a/frame/3/old/bli_trsm_blocksize.h +++ /dev/null @@ -1,44 +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. - -*/ - -dim_t bli_trsm_determine_kc_f( dim_t i, - dim_t dim, - obj_t* obj, - bszid_t bszid, - cntx_t* cntx ); -dim_t bli_trsm_determine_kc_b( dim_t i, - dim_t dim, - obj_t* obj, - bszid_t bszid, - cntx_t* cntx ); diff --git a/frame/3/old/bli_trsm_check.c b/frame/3/old/bli_trsm_check.c deleted file mode 100644 index 7abd33f2c..000000000 --- a/frame/3/old/bli_trsm_check.c +++ /dev/null @@ -1,149 +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. - -*/ - -#include "blis.h" - -void bli_trsm_basic_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ) -{ - err_t e_val; - - // Check object datatypes. - - 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 ); - - e_val = bli_check_floating_object( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_noninteger_object( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_floating_object( c ); - bli_check_error_code( e_val ); - - // 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_trsm_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b ) -{ - err_t e_val; - - // Check basic properties of the operation. - - bli_trsm_basic_check( side, alpha, a, b, &BLIS_ZERO, b ); - - // Check matrix squareness. - - e_val = bli_check_square_object( a ); - bli_check_error_code( e_val ); - - // Check matrix structure. - - e_val = bli_check_triangular_object( a ); - bli_check_error_code( e_val ); -} - -void bli_trsm_int_check( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c, - trsm_t* cntl ) -{ - err_t e_val; - - // Check object buffers (for non-NULLness). - - e_val = bli_check_object_buffer( alpha ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( a ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( b ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( beta ); - bli_check_error_code( e_val ); - - e_val = bli_check_object_buffer( c ); - bli_check_error_code( e_val ); - - // Check basic properties of the operation. - - bli_trsm_basic_check( BLIS_LEFT, alpha, a, b, beta, c ); - - // Check control tree pointer - - e_val = bli_check_valid_cntl( ( void* )cntl ); - bli_check_error_code( e_val ); -} - diff --git a/frame/3/old/bli_trsm_check.h b/frame/3/old/bli_trsm_check.h deleted file mode 100644 index f0df6c608..000000000 --- a/frame/3/old/bli_trsm_check.h +++ /dev/null @@ -1,53 +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. - -*/ - -void bli_trsm_basic_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c ); - -void bli_trsm_check( side_t side, - obj_t* alpha, - obj_t* a, - obj_t* b ); - -void bli_trsm_int_check( obj_t* alpha, - obj_t* a, - obj_t* b, - obj_t* beta, - obj_t* c, - trsm_t* cntl ); - diff --git a/frame/3/old/bli_trsm_direct.c b/frame/3/old/bli_trsm_direct.c deleted file mode 100644 index c640705c8..000000000 --- a/frame/3/old/bli_trsm_direct.c +++ /dev/null @@ -1,59 +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. - -*/ - -#include "blis.h" - -dir_t bli_trsm_direct - ( - obj_t* a, - obj_t* b, - obj_t* c - ) -{ - dir_t direct; - - if ( bli_obj_root_is_triangular( *a ) ) - { - if ( bli_obj_root_is_lower( *a ) ) direct = BLIS_FWD; - else direct = BLIS_BWD; - } - else // if ( bli_obj_root_is_triangular( *b ) ) - { - if ( bli_obj_root_is_lower( *b ) ) direct = BLIS_BWD; - else direct = BLIS_FWD; - } - - return direct; -} - diff --git a/frame/3/old/bli_trsm_l_ukr_ref.c b/frame/3/old/bli_trsm_l_ukr_ref.c deleted file mode 100644 index 5daf507df..000000000 --- a/frame/3/old/bli_trsm_l_ukr_ref.c +++ /dev/null @@ -1,108 +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. - -*/ - -#include "blis.h" - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname)( \ - ctype* restrict a, \ - ctype* restrict b, \ - ctype* restrict c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data \ - ) \ -{ \ - const dim_t m = PASTEMAC(ch,mr); \ - const dim_t n = PASTEMAC(ch,nr); \ -\ - const inc_t rs_a = 1; \ - const inc_t cs_a = PASTEMAC(ch,packmr); \ -\ - const inc_t rs_b = PASTEMAC(ch,packnr); \ - const inc_t cs_b = 1; \ -\ - dim_t iter, i, j, l; \ - dim_t n_behind; \ -\ - for ( iter = 0; iter < m; ++iter ) \ - { \ - i = iter; \ - n_behind = i; \ -\ - ctype* restrict alpha11 = a + (i )*rs_a + (i )*cs_a; \ - ctype* restrict a10t = a + (i )*rs_a + (0 )*cs_a; \ - ctype* restrict B0 = b + (0 )*rs_b + (0 )*cs_b; \ - ctype* restrict b1 = b + (i )*rs_b + (0 )*cs_b; \ -\ - /* b1 = b1 - a10t * B0; */ \ - /* b1 = b1 / alpha11; */ \ - for ( j = 0; j < n; ++j ) \ - { \ - ctype* restrict b01 = B0 + (0 )*rs_b + (j )*cs_b; \ - ctype* restrict beta11 = b1 + (0 )*rs_b + (j )*cs_b; \ - ctype* restrict gamma11 = c + (i )*rs_c + (j )*cs_c; \ - ctype beta11c = *beta11; \ - ctype rho11; \ -\ - /* beta11 = beta11 - a10t * b01; */ \ - PASTEMAC(ch,set0s)( rho11 ); \ - for ( l = 0; l < n_behind; ++l ) \ - { \ - ctype* restrict alpha10 = a10t + (l )*cs_a; \ - ctype* restrict beta01 = b01 + (l )*rs_b; \ -\ - PASTEMAC(ch,axpys)( *alpha10, *beta01, rho11 ); \ - } \ - PASTEMAC(ch,subs)( rho11, beta11c ); \ -\ - /* beta11 = beta11 / alpha11; */ \ - /* NOTE: The INVERSE of alpha11 (1.0/alpha11) is stored instead - of alpha11, so we can multiply rather than divide. We store - the inverse of alpha11 intentionally to avoid expensive - division instructions within the micro-kernel. */ \ - PASTEMAC(ch,scals)( *alpha11, beta11c ); \ -\ - /* Output final result to matrix c. */ \ - PASTEMAC(ch,copys)( beta11c, *gamma11 ); \ -\ - /* Store the local value back to b11. */ \ - PASTEMAC(ch,copys)( beta11c, *beta11 ); \ - } \ - } \ -} - -INSERT_GENTFUNC_BASIC0( trsm_l_ukr_ref ) - diff --git a/frame/3/old/bli_trsm_l_ukr_ref.h b/frame/3/old/bli_trsm_l_ukr_ref.h deleted file mode 100644 index 0b649c857..000000000 --- a/frame/3/old/bli_trsm_l_ukr_ref.h +++ /dev/null @@ -1,50 +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. - -*/ - - -// -// Prototype micro-kernel interfaces. -// -#undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname)( \ - ctype* restrict a, \ - ctype* restrict b, \ - ctype* restrict c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data \ - ); - -INSERT_GENTPROT_BASIC( trsm_l_ukr_ref ) - diff --git a/frame/3/old/bli_trsm_prune.c b/frame/3/old/bli_trsm_prune.c deleted file mode 100644 index 768ea118d..000000000 --- a/frame/3/old/bli_trsm_prune.c +++ /dev/null @@ -1,71 +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. - -*/ - -#include "blis.h" - -void bli_trsm_prune_unref_mparts_m( 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 m dimension) and adjust the - // subpartition of C accordingly. - bli_prune_unref_mparts( a, BLIS_M, c, BLIS_M ); -} - -void bli_trsm_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_trsm_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 ); -} - diff --git a/frame/3/old/bli_trsm_prune.h b/frame/3/old/bli_trsm_prune.h deleted file mode 100644 index 724db38aa..000000000 --- a/frame/3/old/bli_trsm_prune.h +++ /dev/null @@ -1,38 +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. - -*/ - -void bli_trsm_prune_unref_mparts_m( obj_t* a, obj_t* b, obj_t* c ); -void bli_trsm_prune_unref_mparts_n( obj_t* a, obj_t* b, obj_t* c ); -void bli_trsm_prune_unref_mparts_k( obj_t* a, obj_t* b, obj_t* c ); - diff --git a/frame/3/old/bli_trsm_u_ukr_ref.c b/frame/3/old/bli_trsm_u_ukr_ref.c deleted file mode 100644 index 56ae4d277..000000000 --- a/frame/3/old/bli_trsm_u_ukr_ref.c +++ /dev/null @@ -1,108 +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. - -*/ - -#include "blis.h" - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname)( \ - ctype* restrict a, \ - ctype* restrict b, \ - ctype* restrict c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data \ - ) \ -{ \ - const dim_t m = PASTEMAC(ch,mr); \ - const dim_t n = PASTEMAC(ch,nr); \ -\ - const inc_t rs_a = 1; \ - const inc_t cs_a = PASTEMAC(ch,packmr); \ -\ - const inc_t rs_b = PASTEMAC(ch,packnr); \ - const inc_t cs_b = 1; \ -\ - dim_t iter, i, j, l; \ - dim_t n_behind; \ -\ - for ( iter = 0; iter < m; ++iter ) \ - { \ - i = m - iter - 1; \ - n_behind = iter; \ -\ - ctype* restrict alpha11 = a + (i )*rs_a + (i )*cs_a; \ - ctype* restrict a12t = a + (i )*rs_a + (i+1)*cs_a; \ - ctype* restrict b1 = b + (i )*rs_b + (0 )*cs_b; \ - ctype* restrict B2 = b + (i+1)*rs_b + (0 )*cs_b; \ -\ - /* b1 = b1 - a12t * B2; */ \ - /* b1 = b1 / alpha11; */ \ - for ( j = 0; j < n; ++j ) \ - { \ - ctype* restrict beta11 = b1 + (0 )*rs_b + (j )*cs_b; \ - ctype* restrict b21 = B2 + (0 )*rs_b + (j )*cs_b; \ - ctype* restrict gamma11 = c + (i )*rs_c + (j )*cs_c; \ - ctype beta11c = *beta11; \ - ctype rho11; \ -\ - /* beta11 = beta11 - a12t * b21; */ \ - PASTEMAC(ch,set0s)( rho11 ); \ - for ( l = 0; l < n_behind; ++l ) \ - { \ - ctype* restrict alpha12 = a12t + (l )*cs_a; \ - ctype* restrict beta21 = b21 + (l )*rs_b; \ -\ - PASTEMAC(ch,axpys)( *alpha12, *beta21, rho11 ); \ - } \ - PASTEMAC(ch,subs)( rho11, beta11c ); \ -\ - /* beta11 = beta11 / alpha11; */ \ - /* NOTE: The INVERSE of alpha11 (1.0/alpha11) is stored instead - of alpha11, so we can multiply rather than divide. We store - the inverse of alpha11 intentionally to avoid expensive - division instructions within the micro-kernel. */ \ - PASTEMAC(ch,scals)( *alpha11, beta11c ); \ -\ - /* Output final result to matrix c. */ \ - PASTEMAC(ch,copys)( beta11c, *gamma11 ); \ -\ - /* Store the local value back to b11. */ \ - PASTEMAC(ch,copys)( beta11c, *beta11 ); \ - } \ - } \ -} - -INSERT_GENTFUNC_BASIC0( trsm_u_ukr_ref ) - diff --git a/frame/3/old/bli_trsm_u_ukr_ref.h b/frame/3/old/bli_trsm_u_ukr_ref.h deleted file mode 100644 index bcf3ab1fa..000000000 --- a/frame/3/old/bli_trsm_u_ukr_ref.h +++ /dev/null @@ -1,50 +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. - -*/ - - -// -// Prototype micro-kernel interfaces. -// -#undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname)( \ - ctype* restrict a, \ - ctype* restrict b, \ - ctype* restrict c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data \ - ); - -INSERT_GENTPROT_BASIC( trsm_u_ukr_ref ) - diff --git a/frame/3/old/bli_trsm_ukernel.c b/frame/3/old/bli_trsm_ukernel.c deleted file mode 100644 index a505744e4..000000000 --- a/frame/3/old/bli_trsm_ukernel.c +++ /dev/null @@ -1,130 +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. - -*/ - -#include "blis.h" - -#undef FUNCPTR_T -#define FUNCPTR_T trsm_ukr_fp - -typedef void (*FUNCPTR_T)( - void* a, - void* b, - void* c, inc_t rs_c, inc_t cs_c, - auxinfo_t* data, - cntx_t* cntx, - void* ukr - ); - -static FUNCPTR_T GENARRAY(ftypes_l,trsm_l_ukernel_void); -static FUNCPTR_T GENARRAY(ftypes_u,trsm_u_ukernel_void); - -void bli_trsm_ukernel( obj_t* a, - obj_t* b, - obj_t* c, - cntx_t* cntx ) -{ - num_t dt = bli_obj_datatype( *c ); - - void* buf_a = bli_obj_buffer_at_off( *a ); - - void* buf_b = bli_obj_buffer_at_off( *b ); - - void* buf_c = bli_obj_buffer_at_off( *c ); - inc_t rs_c = bli_obj_row_stride( *c ); - inc_t cs_c = bli_obj_col_stride( *c ); - - auxinfo_t data; - - FUNCPTR_T f; - - func_t* trsm_ukrs; - void* trsm_ukr; - - - // Fill the auxinfo_t struct in case the micro-kernel uses it. - bli_auxinfo_set_next_a( buf_a, data ); - bli_auxinfo_set_next_b( buf_b, data ); - - bli_auxinfo_set_is_a( 1, data ); - bli_auxinfo_set_is_b( 1, data ); - - // Query the function address from the micro-kernel func_t object. - if ( bli_obj_is_lower( *a ) ) - { - trsm_ukrs = bli_cntx_get_l3_ukr( BLIS_TRSM_L_UKR, cntx ); - trsm_ukr = bli_func_obj_query( dt, trsm_ukrs ); - } - else - { - trsm_ukrs = bli_cntx_get_l3_ukr( BLIS_TRSM_U_UKR, cntx ); - trsm_ukr = bli_func_obj_query( dt, trsm_ukrs ); - } - - // Index into the type combination array to extract the correct - // function pointer. - if ( bli_obj_is_lower( *a ) ) f = ftypes_l[dt]; - else f = ftypes_u[dt]; - - // Invoke the function. - f( buf_a, - buf_b, - buf_c, rs_c, cs_c, - &data, - trsm_ukr ); -} - - -#undef GENTFUNC -#define GENTFUNC( ctype, ch, varname, ukrtype ) \ -\ -void PASTEMAC(ch,varname)( \ - void* a, \ - void* b, \ - void* c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data, \ - void* ukr \ - ) \ -{ \ - /* Cast the micro-kernel address to its function pointer type. */ \ - PASTECH(ch,ukrtype) ukr_cast = ukr; \ -\ - ukr_cast( a, \ - b, \ - c, rs_c, cs_c, \ - data ); \ -} - -INSERT_GENTFUNC_BASIC( trsm_l_ukernel_void, trsm_ukr_t ) -INSERT_GENTFUNC_BASIC( trsm_u_ukernel_void, trsm_ukr_t ) - diff --git a/frame/3/trmm/bli_trmm_var.h b/frame/3/trmm/bli_trmm_var.h index d3ac2fa34..4b1884267 100644 --- a/frame/3/trmm/bli_trmm_var.h +++ b/frame/3/trmm/bli_trmm_var.h @@ -87,8 +87,8 @@ void PASTEMAC(ch,varname) \ thrinfo_t* thread \ ); -INSERT_GENTPROT_BASIC( trmm_ll_ker_var2 ) -INSERT_GENTPROT_BASIC( trmm_lu_ker_var2 ) -INSERT_GENTPROT_BASIC( trmm_rl_ker_var2 ) -INSERT_GENTPROT_BASIC( trmm_ru_ker_var2 ) +INSERT_GENTPROT_BASIC0( trmm_ll_ker_var2 ) +INSERT_GENTPROT_BASIC0( trmm_lu_ker_var2 ) +INSERT_GENTPROT_BASIC0( trmm_rl_ker_var2 ) +INSERT_GENTPROT_BASIC0( trmm_ru_ker_var2 ) diff --git a/frame/3/trsm/bli_trsm_var.h b/frame/3/trsm/bli_trsm_var.h index 2ff45fa13..9b0e82347 100644 --- a/frame/3/trsm/bli_trsm_var.h +++ b/frame/3/trsm/bli_trsm_var.h @@ -89,8 +89,8 @@ void PASTEMAC(ch,varname) \ thrinfo_t* thread \ ); -INSERT_GENTPROT_BASIC( trsm_ll_ker_var2 ) -INSERT_GENTPROT_BASIC( trsm_lu_ker_var2 ) -INSERT_GENTPROT_BASIC( trsm_rl_ker_var2 ) -INSERT_GENTPROT_BASIC( trsm_ru_ker_var2 ) +INSERT_GENTPROT_BASIC0( trsm_ll_ker_var2 ) +INSERT_GENTPROT_BASIC0( trsm_lu_ker_var2 ) +INSERT_GENTPROT_BASIC0( trsm_rl_ker_var2 ) +INSERT_GENTPROT_BASIC0( trsm_ru_ker_var2 ) diff --git a/frame/base/bli_arch.c b/frame/base/bli_arch.c new file mode 100644 index 000000000..d8e33672c --- /dev/null +++ b/frame/base/bli_arch.c @@ -0,0 +1,113 @@ +/* + + 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" + +// ----------------------------------------------------------------------------- + +arch_t bli_arch_query_id( void ) +{ + arch_t id = -1; + + // Architecture families. +#if defined BLIS_FAMILY_INTEL64 || \ + defined BLIS_FAMILY_AMD64 || \ + defined BLIS_FAMILY_X86_64 + id = bli_cpuid_query_id(); +#endif + + // Intel microarchitectures. +#ifdef BLIS_FAMILY_KNL + id = BLIS_ARCH_KNL; +#endif +#ifdef BLIS_FAMILY_KNC + id = BLIS_ARCH_KNC; +#endif +#ifdef BLIS_FAMILY_HASWELL + id = BLIS_ARCH_HASWELL; +#endif +#ifdef BLIS_FAMILY_SANDYBRIDGE + id = BLIS_ARCH_SANDYBRIDGE; +#endif +#ifdef BLIS_FAMILY_PENRYN + id = BLIS_ARCH_PENRYN; +#endif + + // AMD microarchitectures. +#ifdef BLIS_FAMILY_ZEN + id = BLIS_ARCH_ZEN; +#endif +#ifdef BLIS_FAMILY_EXCAVATOR + id = BLIS_ARCH_EXCAVATOR; +#endif +#ifdef BLIS_FAMILY_STEAMROLLER + id = BLIS_ARCH_STEAMROLLER; +#endif +#ifdef BLIS_FAMILY_PILEDRIVER + id = BLIS_ARCH_PILEDRIVER; +#endif +#ifdef BLIS_FAMILY_BULLDOZER + id = BLIS_ARCH_BULLDOZER; +#endif + + // ARM microarchitectures. +#ifdef BLIS_FAMILY_CORTEXA57 + id = BLIS_ARCH_CORTEXA57; +#endif +#ifdef BLIS_FAMILY_CORTEXA15 + id = BLIS_ARCH_CORTEXA15; +#endif +#ifdef BLIS_FAMILY_CORTEXA9 + id = BLIS_ARCH_CORTEXA9; +#endif + + // IBM microarchitectures. +#ifdef BLIS_FAMILY_POWER7 + id = BLIS_ARCH_POWER7; +#endif +#ifdef BLIS_FAMILY_BGQ + id = BLIS_ARCH_BGQ; +#endif + + // Generic microarchitecture. +#ifdef BLIS_FAMILY_GENERIC + id = BLIS_ARCH_GENERIC; +#endif + + //printf( "blis_arch_query_id(): id = %u\n", id ); + //exit(1); + + return id; +} + diff --git a/frame/base/bli_arch.h b/frame/base/bli_arch.h new file mode 100644 index 000000000..df5d62998 --- /dev/null +++ b/frame/base/bli_arch.h @@ -0,0 +1,42 @@ +/* + + 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_ARCH_H +#define BLIS_ARCH_H + +arch_t bli_arch_query_id( void ); + + +#endif + diff --git a/frame/base/bli_blksz.c b/frame/base/bli_blksz.c index 6d27c52d5..7d5fd44ca 100644 --- a/frame/base/bli_blksz.c +++ b/frame/base/bli_blksz.c @@ -43,9 +43,7 @@ blksz_t* bli_blksz_create_ed dim_t b_z, dim_t be_z ) { - blksz_t* b; - - b = ( blksz_t* ) bli_malloc_intl( sizeof(blksz_t) ); + blksz_t* b = bli_malloc_intl( sizeof( blksz_t ) ); bli_blksz_init_ed ( @@ -65,9 +63,7 @@ blksz_t* bli_blksz_create dim_t be_s, dim_t be_d, dim_t be_c, dim_t be_z ) { - blksz_t* b; - - b = ( blksz_t* ) bli_malloc_intl( sizeof(blksz_t) ); + blksz_t* b = bli_malloc_intl( sizeof( blksz_t ) ); bli_blksz_init ( @@ -92,6 +88,7 @@ void bli_blksz_init_ed b->v[BLIS_DOUBLE] = b_d; b->v[BLIS_SCOMPLEX] = b_c; b->v[BLIS_DCOMPLEX] = b_z; + b->e[BLIS_FLOAT] = be_s; b->e[BLIS_DOUBLE] = be_d; b->e[BLIS_SCOMPLEX] = be_c; @@ -110,11 +107,10 @@ void bli_blksz_init b->v[BLIS_SCOMPLEX] = b_c; b->v[BLIS_DCOMPLEX] = b_z; - // Interpret a zero as a request for the default value. - b->e[BLIS_FLOAT] = ( be_s == 0 ? b_s : be_s ); - b->e[BLIS_DOUBLE] = ( be_d == 0 ? b_d : be_d ); - b->e[BLIS_SCOMPLEX] = ( be_c == 0 ? b_c : be_c ); - b->e[BLIS_DCOMPLEX] = ( be_z == 0 ? b_z : be_z ); + b->e[BLIS_FLOAT] = be_s; + b->e[BLIS_DOUBLE] = be_d; + b->e[BLIS_SCOMPLEX] = be_c; + b->e[BLIS_DCOMPLEX] = be_z; } void bli_blksz_init_easy @@ -123,17 +119,10 @@ void bli_blksz_init_easy dim_t b_s, dim_t b_d, dim_t b_c, dim_t b_z ) { - b->v[BLIS_FLOAT] = b_s; - b->v[BLIS_DOUBLE] = b_d; - b->v[BLIS_SCOMPLEX] = b_c; - b->v[BLIS_DCOMPLEX] = b_z; - - // Here we assume the maximum blocksize values can be the same as the - // default values. - b->e[BLIS_FLOAT] = b_s; - b->e[BLIS_DOUBLE] = b_d; - b->e[BLIS_SCOMPLEX] = b_c; - b->e[BLIS_DCOMPLEX] = b_z; + b->v[BLIS_FLOAT] = b->e[BLIS_FLOAT] = b_s; + b->v[BLIS_DOUBLE] = b->e[BLIS_DOUBLE] = b_d; + b->v[BLIS_SCOMPLEX] = b->e[BLIS_SCOMPLEX] = b_c; + b->v[BLIS_DCOMPLEX] = b->e[BLIS_DCOMPLEX] = b_z; } void bli_blksz_free diff --git a/frame/base/bli_blksz.h b/frame/base/bli_blksz.h index abd066f88..5be816775 100644 --- a/frame/base/bli_blksz.h +++ b/frame/base/bli_blksz.h @@ -32,74 +32,145 @@ */ -// ----------------------------------------------------------------------------- - // blksz_t query -#define bli_blksz_get_def( dt, b ) \ -\ - ( (b)->v[ dt ] ) - -#define bli_blksz_get_max( dt, b ) \ -\ - ( (b)->e[ dt ] ) - -#define bli_blksz_get_def_max( def, max, dt, b ) \ -{ \ - *(def) = bli_blksz_get_def( dt, b ); \ - *(max) = bli_blksz_get_max( dt, b ); \ +static dim_t bli_blksz_get_def + ( + num_t dt, + blksz_t* b + ) +{ + return b->v[ dt ]; } +static dim_t bli_blksz_get_max + ( + num_t dt, + blksz_t* b + ) +{ + return b->e[ dt ]; +} + + // blksz_t modification -#define bli_blksz_set_def( val, dt, b ) \ -{ \ - (b)->v[ dt ] = val; \ +static void bli_blksz_set_def + ( + dim_t val, + num_t dt, + blksz_t* b + ) +{ + b->v[ dt ] = val; } -#define bli_blksz_set_max( val, dt, b ) \ -{ \ - (b)->e[ dt ] = val; \ +static void bli_blksz_set_max + ( + dim_t val, + num_t dt, + blksz_t* b + ) +{ + b->e[ dt ] = val; } -#define bli_blksz_set_def_max( def, max, dt, b ) \ -{ \ - bli_blksz_set_def( def, dt, b ); \ - bli_blksz_set_max( max, dt, b ); \ +static void bli_blksz_copy + ( + blksz_t* b_src, + blksz_t* b_dst + ) +{ + *b_dst = *b_src; } -#define bli_blksz_copy( b_src, b_dst ) \ -{ \ - *(b_dst) = *(b_src); \ +static void bli_blksz_copy_if_pos + ( + blksz_t* b_src, + blksz_t* b_dst + ) +{ + // Copy the blocksize values over to b_dst one-by-one so that + // we can skip the ones that are non-positive. + + const dim_t v_s = bli_blksz_get_def( BLIS_FLOAT, b_src ); + const dim_t v_d = bli_blksz_get_def( BLIS_DOUBLE, b_src ); + const dim_t v_c = bli_blksz_get_def( BLIS_SCOMPLEX, b_src ); + const dim_t v_z = bli_blksz_get_def( BLIS_DCOMPLEX, b_src ); + + const dim_t e_s = bli_blksz_get_max( BLIS_FLOAT, b_src ); + const dim_t e_d = bli_blksz_get_max( BLIS_DOUBLE, b_src ); + const dim_t e_c = bli_blksz_get_max( BLIS_SCOMPLEX, b_src ); + const dim_t e_z = bli_blksz_get_max( BLIS_DCOMPLEX, b_src ); + + if ( v_s > 0 ) bli_blksz_set_def( v_s, BLIS_FLOAT, b_dst ); + if ( v_d > 0 ) bli_blksz_set_def( v_d, BLIS_DOUBLE, b_dst ); + if ( v_c > 0 ) bli_blksz_set_def( v_c, BLIS_SCOMPLEX, b_dst ); + if ( v_z > 0 ) bli_blksz_set_def( v_z, BLIS_DCOMPLEX, b_dst ); + + if ( e_s > 0 ) bli_blksz_set_max( e_s, BLIS_FLOAT, b_dst ); + if ( e_d > 0 ) bli_blksz_set_max( e_d, BLIS_DOUBLE, b_dst ); + if ( e_c > 0 ) bli_blksz_set_max( e_c, BLIS_SCOMPLEX, b_dst ); + if ( e_z > 0 ) bli_blksz_set_max( e_z, BLIS_DCOMPLEX, b_dst ); } -#define bli_blksz_copy_dt( dt_src, b_src, \ - dt_dst, b_dst ) \ -{ \ - const dim_t v_src = bli_blksz_get_def( dt_src, b_src ); \ - const dim_t e_src = bli_blksz_get_max( dt_src, b_src ); \ -\ - bli_blksz_set_def( v_src, dt_dst, b_dst ); \ - bli_blksz_set_max( e_src, dt_dst, b_dst ); \ +static void bli_blksz_copy_def_dt + ( + num_t dt_src, blksz_t* b_src, + num_t dt_dst, blksz_t* b_dst + ) +{ + const dim_t val = bli_blksz_get_def( dt_src, b_src ); + + bli_blksz_set_def( val, dt_dst, b_dst ); } -#define bli_blksz_scale_def( num, den, dt, b ) \ -{ \ - (b)->v[ dt ] = ( (b)->v[ dt ] * num ) / den; \ +static void bli_blksz_copy_max_dt + ( + num_t dt_src, blksz_t* b_src, + num_t dt_dst, blksz_t* b_dst + ) +{ + const dim_t val = bli_blksz_get_max( dt_src, b_src ); + + bli_blksz_set_max( val, dt_dst, b_dst ); } -#define bli_blksz_scale_max( num, den, dt, b ) \ -{ \ - (b)->e[ dt ] = ( (b)->e[ dt ] * num ) / den; \ +static void bli_blksz_copy_dt + ( + num_t dt_src, blksz_t* b_src, + num_t dt_dst, blksz_t* b_dst + ) +{ + bli_blksz_copy_def_dt( dt_src, b_src, dt_dst, b_dst ); + bli_blksz_copy_max_dt( dt_src, b_src, dt_dst, b_dst ); } -#if 0 -#define bli_blksz_scale_dt_by( num, den, dt, b ) \ -{ \ - (b)->v[ dt ] = ( (b)->v[ dt ] * num ) / den; \ - (b)->e[ dt ] = ( (b)->e[ dt ] * num ) / den; \ +static void bli_blksz_scale_def + ( + dim_t num, + dim_t den, + num_t dt, + blksz_t* b + ) +{ + const dim_t val = bli_blksz_get_def( dt, b ); + + bli_blksz_set_def( ( val * num ) / den, dt, b ); +} + +static void bli_blksz_scale_max + ( + dim_t num, + dim_t den, + num_t dt, + blksz_t* b + ) +{ + const dim_t val = bli_blksz_get_max( dt, b ); + + bli_blksz_set_max( ( val * num ) / den, dt, b ); } -#endif // ----------------------------------------------------------------------------- diff --git a/frame/base/bli_check.c b/frame/base/bli_check.c index 2c63aeb81..24b376396 100644 --- a/frame/base/bli_check.c +++ b/frame/base/bli_check.c @@ -837,3 +837,68 @@ err_t bli_check_object_alias_of( obj_t* a, obj_t* b ) return e_val; } +// -- Architecture-related errors ---------------------------------------------- + +err_t bli_check_valid_arch_id( arch_t id ) +{ + err_t e_val = BLIS_SUCCESS; + + if ( id < 0 || BLIS_NUM_ARCHS-1 < id ) + e_val = BLIS_INVALID_ARCH_ID; + + return e_val; +} + +// -- Architecture-related errors ---------------------------------------------- + +err_t bli_check_valid_mc_mod_mult( blksz_t* mc, blksz_t* mr ) +{ + num_t dt; + + for ( dt = BLIS_DT_LO; dt <= BLIS_DT_HI; ++dt ) + { + dim_t mc_def_dt = bli_blksz_get_def( dt, mc ); + dim_t mc_max_dt = bli_blksz_get_max( dt, mc ); + dim_t mr_dt = bli_blksz_get_def( dt, mr ); + + if ( mc_def_dt % mr_dt != 0 ) return BLIS_MC_DEF_NONMULTIPLE_OF_MR; + else if ( mc_max_dt % mr_dt != 0 ) return BLIS_MC_MAX_NONMULTIPLE_OF_MR; + } + + return BLIS_SUCCESS; +} + +err_t bli_check_valid_nc_mod_mult( blksz_t* nc, blksz_t* nr ) +{ + num_t dt; + + for ( dt = BLIS_DT_LO; dt <= BLIS_DT_HI; ++dt ) + { + dim_t nc_def_dt = bli_blksz_get_def( dt, nc ); + dim_t nc_max_dt = bli_blksz_get_max( dt, nc ); + dim_t nr_dt = bli_blksz_get_def( dt, nr ); + + if ( nc_def_dt % nr_dt != 0 ) return BLIS_NC_DEF_NONMULTIPLE_OF_NR; + else if ( nc_max_dt % nr_dt != 0 ) return BLIS_NC_MAX_NONMULTIPLE_OF_NR; + } + + return BLIS_SUCCESS; +} + +err_t bli_check_valid_kc_mod_mult( blksz_t* kc, blksz_t* kr ) +{ + num_t dt; + + for ( dt = BLIS_DT_LO; dt <= BLIS_DT_HI; ++dt ) + { + dim_t kc_def_dt = bli_blksz_get_def( dt, kc ); + dim_t kc_max_dt = bli_blksz_get_max( dt, kc ); + dim_t kr_dt = bli_blksz_get_def( dt, kr ); + + if ( kc_def_dt % kr_dt != 0 ) return BLIS_KC_DEF_NONMULTIPLE_OF_KR; + else if ( kc_max_dt % kr_dt != 0 ) return BLIS_KC_MAX_NONMULTIPLE_OF_KR; + } + + return BLIS_SUCCESS; +} + diff --git a/frame/base/bli_check.h b/frame/base/bli_check.h index 76a396b07..96e8b826f 100644 --- a/frame/base/bli_check.h +++ b/frame/base/bli_check.h @@ -105,3 +105,9 @@ err_t bli_check_alignment_is_mult_of_ptr_size( size_t align_size ); err_t bli_check_object_alias_of( obj_t* a, obj_t* b ); +err_t bli_check_valid_arch_id( arch_t id ); + +err_t bli_check_valid_mc_mod_mult( blksz_t* mc, blksz_t* mr ); +err_t bli_check_valid_nc_mod_mult( blksz_t* nc, blksz_t* nr ); +err_t bli_check_valid_kc_mod_mult( blksz_t* kc, blksz_t* kr ); + diff --git a/frame/base/bli_cntx.c b/frame/base/bli_cntx.c index d4c4487ed..669d02c29 100644 --- a/frame/base/bli_cntx.c +++ b/frame/base/bli_cntx.c @@ -34,374 +34,14 @@ #include "blis.h" -#if 0 -// -// NOTE: Since these functions currently do nothing, they are defined -// as empty macros in bli_cntx. -// -void bli_cntx_create( cntx_t* cntx ) -{ - // Since cntx_t objects contain statically-allocated arrays, - // we don't need to do anything in order to create the cntx_t - // instance. -} - -void bli_cntx_free( cntx_t* cntx ) -{ - // Just as we don't need to do anything in order to create a - // cntx_t instance, we don't need to do anything to destory - // one. -} -#endif - void bli_cntx_clear( cntx_t* cntx ) { // Fill the entire cntx_t structure with zeros. - memset( ( void* )cntx, 0, sizeof( cntx ) ); -} - -void bli_cntx_init( cntx_t* cntx ) -{ - // This function initializes a "universal" context that is pre-loaded - // with kernel addresses for all level-1v, -1f, and -3 kernels, in - // addition to all level-1f and -3 blocksizes. - - bli_gks_cntx_set_l3_nat_ukr( BLIS_GEMM_UKR, cntx ); - bli_gks_cntx_set_l3_nat_ukr( BLIS_GEMMTRSM_L_UKR, cntx ); - bli_gks_cntx_set_l3_nat_ukr( BLIS_GEMMTRSM_U_UKR, cntx ); - bli_gks_cntx_set_l3_nat_ukr( BLIS_TRSM_L_UKR, cntx ); - bli_gks_cntx_set_l3_nat_ukr( BLIS_TRSM_U_UKR, cntx ); - - bli_gks_cntx_set_blkszs( BLIS_NAT, 6, - BLIS_NC, BLIS_NR, - BLIS_KC, BLIS_KR, - BLIS_MC, BLIS_KR, - BLIS_NR, BLIS_NR, - BLIS_MR, BLIS_MR, - BLIS_KR, BLIS_KR, - cntx ); - - bli_gks_cntx_set_l1f_ker( BLIS_AXPY2V_KER, cntx ); - bli_gks_cntx_set_l1f_ker( BLIS_DOTAXPYV_KER, cntx ); - bli_gks_cntx_set_l1f_ker( BLIS_AXPYF_KER, cntx ); - bli_gks_cntx_set_l1f_ker( BLIS_DOTXF_KER, cntx ); - bli_gks_cntx_set_l1f_ker( BLIS_DOTXAXPYF_KER, cntx ); - - bli_gks_cntx_set_blkszs( BLIS_NAT, 3, - BLIS_AF, BLIS_AF, - BLIS_DF, BLIS_DF, - BLIS_XF, BLIS_XF, - cntx ); - - bli_gks_cntx_set_l1v_ker( BLIS_ADDV_KER, cntx ); - bli_gks_cntx_set_l1v_ker( BLIS_AXPYV_KER, cntx ); - bli_gks_cntx_set_l1v_ker( BLIS_COPYV_KER, cntx ); - bli_gks_cntx_set_l1v_ker( BLIS_DOTV_KER, cntx ); - bli_gks_cntx_set_l1v_ker( BLIS_DOTXV_KER, cntx ); - bli_gks_cntx_set_l1v_ker( BLIS_INVERTV_KER, cntx ); - bli_gks_cntx_set_l1v_ker( BLIS_SCALV_KER, cntx ); - bli_gks_cntx_set_l1v_ker( BLIS_SCAL2V_KER, cntx ); - bli_gks_cntx_set_l1v_ker( BLIS_SETV_KER, cntx ); - bli_gks_cntx_set_l1v_ker( BLIS_SUBV_KER, cntx ); - bli_gks_cntx_set_l1v_ker( BLIS_SWAPV_KER, cntx ); + memset( ( void* )cntx, 0, sizeof( cntx_t ) ); } // ----------------------------------------------------------------------------- -blksz_t* bli_cntx_get_blksz - ( - bszid_t bs_id, - cntx_t* cntx - ) -{ - blksz_t* blkszs = bli_cntx_blkszs_buf( cntx ); - blksz_t* blksz = &blkszs[ bs_id ]; - - // Return the address of the blksz_t identified by bs_id. - return blksz; -} - -#if 0 -dim_t bli_cntx_get_blksz_def_dt( num_t dt, - bszid_t bs_id, - cntx_t* cntx ) -{ - blksz_t* blkszs = bli_cntx_blkszs_buf( cntx ); - blksz_t* blksz = &blkszs[ bs_id ]; - - // Return the default blocksize value for the datatype given. - return bli_blksz_get_def( dt, blksz ); -} - -dim_t bli_cntx_get_blksz_max_dt( num_t dt, - bszid_t bs_id, - cntx_t* cntx ) -{ - blksz_t* blkszs = bli_cntx_blkszs_buf( cntx ); - blksz_t* blksz = &blkszs[ bs_id ]; - - // Return the default blocksize value for the datatype given. - return bli_blksz_get_max( dt, blksz ); -} -#endif - -blksz_t* bli_cntx_get_bmult - ( - bszid_t bs_id, - cntx_t* cntx - ) -{ - blksz_t* blkszs = bli_cntx_blkszs_buf( cntx ); - bszid_t* bmults = bli_cntx_bmults_buf( cntx ); - bszid_t bm_id = bmults[ bs_id ]; - blksz_t* bmult = &blkszs[ bm_id ]; - - // Return the address of the blksz_t identified by the multiple for - // the blocksize corresponding to bs_id. - return bmult; -} - -#if 0 -dim_t bli_cntx_get_bmult_dt( num_t dt, - bszid_t bs_id, - cntx_t* cntx ) -{ - blksz_t* bmult = bli_cntx_get_bmult( bs_id, cntx ); - - return bli_blksz_get_def( dt, bmult ); -} -#endif - -func_t* bli_cntx_get_l3_ukr - ( - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - func_t* l3_vir_ukrs = bli_cntx_l3_vir_ukrs_buf( cntx ); - func_t* l3_nat_ukrs = bli_cntx_l3_nat_ukrs_buf( cntx ); - func_t* l3_ukrs; - func_t* l3_ukr; - - // If the context was set up for non-native (ie: induced) execution, - // the virtual ukernel func_t's will contain the appropriate function - // pointers. Otherwise, we use the native ukernel func_t's. - if ( bli_cntx_method( cntx ) != BLIS_NAT ) l3_ukrs = l3_vir_ukrs; - else l3_ukrs = l3_nat_ukrs; - - // Index into the func_t array chosen above using the ukr_id. - l3_ukr = &l3_ukrs[ ukr_id ]; - - // Return the address of the func_t identified by ukr_id. - return l3_ukr; -} - -#if 0 -void* bli_cntx_get_l3_ukr_dt( num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx ) -{ - func_t* l3_vir_ukrs = bli_cntx_l3_vir_ukrs_buf( cntx ); - func_t* l3_nat_ukrs = bli_cntx_l3_nat_ukrs_buf( cntx ); - func_t* l3_ukrs; - func_t* l3_ukr; - - // If the context was set up for non-native (ie: induced) execution, - // the virtual ukernel func_t's will contain the appropriate function - // pointers. Otherwise, we use the native ukernel func_t's. - if ( bli_cntx_method( cntx ) != BLIS_NAT ) l3_ukrs = l3_vir_ukrs; - else l3_ukrs = l3_nat_ukrs; - - // Index into the func_t array chosen above using the ukr_id. - l3_ukr = &l3_ukrs[ ukr_id ]; - - return bli_func_get_dt( dt, l3_ukr ); -} -#endif - -func_t* bli_cntx_get_l3_vir_ukr - ( - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - func_t* l3_vir_ukrs = bli_cntx_l3_vir_ukrs_buf( cntx ); - func_t* l3_vir_ukr = &l3_vir_ukrs[ ukr_id ]; - - // Return the address of the virtual level-3 micro-kernel func_t - // identified by ukr_id. - return l3_vir_ukr; -} - -#if 0 -void* bli_cntx_get_l3_vir_ukr_dt( num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx ) -{ - func_t* l3_vir_ukrs = bli_cntx_l3_vir_ukrs_buf( cntx ); - func_t* l3_vir_ukr = &l3_vir_ukrs[ ukr_id ]; - - // Return the address of the virtual level-3 micro-kernel func_t - // identified by ukr_id. - return bli_func_get_dt( dt, l3_vir_ukr ); -} -#endif - -func_t* bli_cntx_get_l3_nat_ukr - ( - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - func_t* l3_nat_ukrs = bli_cntx_l3_nat_ukrs_buf( cntx ); - func_t* l3_nat_ukr = &l3_nat_ukrs[ ukr_id ]; - - // Return the address of the native level-3 micro-kernel func_t - // identified by ukr_id. - return l3_nat_ukr; -} - -#if 0 -void* bli_cntx_get_l3_nat_ukr_dt( num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx ) -{ - func_t* l3_nat_ukrs = bli_cntx_l3_nat_ukrs_buf( cntx ); - func_t* l3_nat_ukr = &l3_nat_ukrs[ ukr_id ]; - - // Return the address of the native level-3 micro-kernel func_t - // identified by ukr_id. - return bli_func_get_dt( dt, l3_nat_ukr ); -} -#endif - -func_t* bli_cntx_get_l1f_ker - ( - l1fkr_t ker_id, - cntx_t* cntx - ) -{ - func_t* l1f_kers = bli_cntx_l1f_kers_buf( cntx ); - func_t* l1f_ker = &l1f_kers[ ker_id ]; - - // Return the address of the level-1f kernel func_t identified by - // ker_id. - return l1f_ker; -} - -#if 0 -void* bli_cntx_get_l1f_ker_dt( num_t dt, - l1fkr_t ker_id, - cntx_t* cntx ) -{ - func_t* l1f_kers = bli_cntx_l1f_kers_buf( cntx ); - func_t* l1f_ker = &l1f_kers[ ker_id ]; - - return bli_func_get_dt( dt, l1f_ker ); -} -#endif - -func_t* bli_cntx_get_l1v_ker - ( - l1vkr_t ker_id, - cntx_t* cntx - ) -{ - func_t* l1v_kers = bli_cntx_l1v_kers_buf( cntx ); - func_t* l1v_ker = &l1v_kers[ ker_id ]; - - // Return the address of the level-1v kernel func_t identified by - // ker_id. - return l1v_ker; -} - -#if 0 -void* bli_cntx_get_l1v_ker_dt( num_t dt, - l1vkr_t ker_id, - cntx_t* cntx ) -{ - func_t* l1v_kers = bli_cntx_l1v_kers_buf( cntx ); - func_t* l1v_ker = &l1v_kers[ ker_id ]; - - return bli_func_get_dt( dt, l1v_ker ); -} -#endif - -mbool_t* bli_cntx_get_l3_nat_ukr_prefs - ( - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - mbool_t* l3_nat_ukrs_prefs = bli_cntx_l3_nat_ukrs_prefs_buf( cntx ); - mbool_t* l3_nat_ukrs_pref = &l3_nat_ukrs_prefs[ ukr_id ]; - - // Return the address of the native kernel func_t identified by ukr_id. - return l3_nat_ukrs_pref; -} - -func_t* bli_cntx_get_packm_ker - ( - l1mkr_t ker_id, - cntx_t* cntx - ) -{ - func_t* packm_kers = bli_cntx_packm_kers_buf( cntx ); - func_t* packm_ker = &packm_kers[ ker_id ]; - - // Return the address of the func_t that contains the packm ukernels. - return packm_ker; -} - -func_t* bli_cntx_get_unpackm_ker - ( - l1mkr_t ker_id, - cntx_t* cntx - ) -{ - func_t* unpackm_kers = bli_cntx_unpackm_kers_buf( cntx ); - func_t* unpackm_ker = &unpackm_kers[ ker_id ]; - - // Return the address of the func_t that contains the unpackm ukernels. - return unpackm_ker; -} - -#if 0 -ind_t bli_cntx_get_ind_method( cntx_t* cntx ) -{ - return bli_cntx_method( cntx ); -} - -pack_t bli_cntx_get_pack_schema_a_block( cntx_t* cntx ) -{ - return bli_cntx_schema_a_block( cntx ); -} - -pack_t bli_cntx_get_pack_schema_b_panel( cntx_t* cntx ) -{ - return bli_cntx_schema_b_panel( cntx ); -} - -pack_t bli_cntx_get_pack_schema_c_panel( cntx_t* cntx ) -{ - return bli_cntx_schema_c_panel( cntx ); -} - -bool_t bli_cntx_get_ukr_anti_pref( cntx_t* cntx ) -{ - return bli_cntx_anti_pref( cntx ); -} -#endif - -dim_t bli_cntx_get_num_threads( cntx_t* cntx ) -{ - return bli_cntx_jc_way( cntx ) * - bli_cntx_pc_way( cntx ) * - bli_cntx_ic_way( cntx ) * - bli_cntx_jr_way( cntx ) * - bli_cntx_ir_way( cntx ); -} - dim_t bli_cntx_get_num_threads_in ( cntx_t* cntx, @@ -491,9 +131,9 @@ void bli_cntx_set_blkszs( ind_t method, dim_t n_bs, ... ) { // Here, we query the variable argument list for: // - the bszid_t of the blocksize we're about to process, - // - the address of the blksz_t object, and - // - the bszid_t of the multiple - // that we need to associate with the blksz_t object. + // - the address of the blksz_t object, + // - the bszid_t of the multiple we need to associate with + // the blksz_t object. bszid_t bs_id = va_arg( args, bszid_t ); blksz_t* blksz = va_arg( args, blksz_t* ); bszid_t bm_id = va_arg( args, bszid_t ); @@ -512,7 +152,8 @@ void bli_cntx_set_blkszs( ind_t method, dim_t n_bs, ... ) // Here, we query the variable argument list for: // - the bszid_t of the blocksize we're about to process, // - the address of the blksz_t object, - // - the bszid_t of the multiple, and + // - the bszid_t of the multiple we need to associate with + // the blksz_t object, // - the scalars we wish to apply to the real blocksizes to // come up with the induced complex blocksizes (for default // and maximum blocksizes). @@ -573,8 +214,8 @@ void bli_cntx_set_blkszs( ind_t method, dim_t n_bs, ... ) // location within the context's blksz_t array. Do the same // for the blocksize multiple id. //cntx_blkszs[ bs_id ] = *blksz; - //bli_blksz_copy_smart( blksz, cntx_blksz ); - bli_blksz_copy( blksz, cntx_blksz ); + //bli_blksz_copy( blksz, cntx_blksz ); + bli_blksz_copy_if_pos( blksz, cntx_blksz ); // Copy the blocksize multiple id into the context. cntx_bmults[ bs_id ] = bm_id; @@ -593,6 +234,11 @@ void bli_cntx_set_blkszs( ind_t method, dim_t n_bs, ... ) double msclr = msclrs[ i ]; blksz_t* blksz = blkszs[ i ]; + // NOTE: This is a bug! We need to grab the actual blocksize + // multiple, which is not at blkszs[i], but rather somewhere else + // in the array. In order to fix this, you probably need to store + // the contents of blkszs (and all the other arrays) by bs_id + // rather than i in the first loop. blksz_t* bmult = blkszs[ i ]; blksz_t* cntx_blksz = &cntx_blkszs[ bs_id ]; @@ -613,15 +259,16 @@ void bli_cntx_set_blkszs( ind_t method, dim_t n_bs, ... ) bli_blksz_scale_def( 1, ( dim_t )dsclr, BLIS_SCOMPLEX, cntx_blksz ); bli_blksz_scale_def( 1, ( dim_t )dsclr, BLIS_DCOMPLEX, cntx_blksz ); - if ( bs_id != bm_id ) + // Perform rounding to ensure the newly scaled values are still + // multiples of their register blocksize multiples. But only + // perform this rounding when the blocksize id is not equal to + // the blocksize multiple id (ie: we don't round down scaled + // register blocksizes since they are their own multiples). + // Also, we skip the rounding for 1m since it should never need + // such rounding. + if ( bs_id != bm_id && method != BLIS_1M ) { // Round the newly-scaled blocksizes down to their multiple. - // (Note that both the default and maximum blocksize values - // must be a multiple of the same blocksize multiple.) Also, - // note that this is only done when the blocksize id is not - // equal to the blocksize multiple id (ie: we don't round - // down scaled register blocksizes since they are their own - // multiples). bli_blksz_reduce_def_to( BLIS_FLOAT, bmult, BLIS_SCOMPLEX, cntx_blksz ); bli_blksz_reduce_def_to( BLIS_DOUBLE, bmult, BLIS_DCOMPLEX, cntx_blksz ); } @@ -636,15 +283,16 @@ void bli_cntx_set_blkszs( ind_t method, dim_t n_bs, ... ) bli_blksz_scale_max( 1, ( dim_t )msclr, BLIS_SCOMPLEX, cntx_blksz ); bli_blksz_scale_max( 1, ( dim_t )msclr, BLIS_DCOMPLEX, cntx_blksz ); - if ( bs_id != bm_id ) + // Perform rounding to ensure the newly scaled values are still + // multiples of their register blocksize multiples. But only + // perform this rounding when the blocksize id is not equal to + // the blocksize multiple id (ie: we don't round down scaled + // register blocksizes since they are their own multiples). + // Also, we skip the rounding for 1m since it should never need + // such rounding. + if ( bs_id != bm_id && method != BLIS_1M ) { // Round the newly-scaled blocksizes down to their multiple. - // (Note that both the default and maximum blocksize values - // must be a multiple of the same blocksize multiple.) Also, - // note that this is only done when the blocksize id is not - // equal to the blocksize multiple id (ie: we don't round - // down scaled register blocksizes since they are their own - // multiples). bli_blksz_reduce_max_to( BLIS_FLOAT, bmult, BLIS_SCOMPLEX, cntx_blksz ); bli_blksz_reduce_max_to( BLIS_DOUBLE, bmult, BLIS_DCOMPLEX, cntx_blksz ); } @@ -665,24 +313,161 @@ void bli_cntx_set_blkszs( ind_t method, dim_t n_bs, ... ) // ----------------------------------------------------------------------------- -void bli_cntx_set_blksz - ( - bszid_t bs_id, - blksz_t* blksz, - bszid_t mult_id, - cntx_t* cntx - ) +void bli_cntx_set_ind_blkszs( ind_t method, dim_t n_bs, ... ) { - blksz_t* blkszs = bli_cntx_blkszs_buf( cntx ); - bszid_t* bmults = bli_cntx_bmults_buf( cntx ); + /* Example prototypes: - // Copy the blocksize object into the specified location within - // the context's blocksize array. - blkszs[ bs_id ] = *blksz; + void bli_gks_cntx_set_ind_blkszs + ( + ind_t method != BLIS_NAT, + dim_t n_bs, + bszid_t bs0_id, dim_t def_scalr0, dim_t max_scalr0, + bszid_t bs1_id, dim_t def_scalr1, dim_t max_scalr1, + bszid_t bs2_id, dim_t def_scalr2, dim_t max_scalr2, + ... + cntx_t* cntx + ); + + NOTE: This function modifies an existing context that is presumed + to have been initialized for native execution. + */ + va_list args; + dim_t i; - // Assign the blocksize multiple id to the corresponding location - // in the context's blocksize multiple array. - bmults[ bs_id ] = mult_id; + bszid_t* bszids; + double* dsclrs; + double* msclrs; + + cntx_t* cntx; + + // Return early if called with BLIS_NAT. + if ( method == BLIS_NAT ) return; + + // Allocate some temporary local arrays. + bszids = bli_malloc_intl( n_bs * sizeof( bszid_t ) ); + dsclrs = bli_malloc_intl( n_bs * sizeof( double ) ); + msclrs = bli_malloc_intl( n_bs * sizeof( double ) ); + + // -- Begin variable argument section -- + + // Initialize variable argument environment. + va_start( args, n_bs ); + + { + // Process n_bs tuples. + for ( i = 0; i < n_bs; ++i ) + { + // Here, we query the variable argument list for: + // - the bszid_t of the blocksize we're about to process, + // - the scalars we wish to apply to the real blocksizes to + // come up with the induced complex blocksizes (for default + // and maximum blocksizes). + bszid_t bs_id = va_arg( args, bszid_t ); + double dsclr = va_arg( args, double ); + double msclr = va_arg( args, double ); + + // Store the values in our temporary arrays. + bszids[ i ] = bs_id; + dsclrs[ i ] = dsclr; + msclrs[ i ] = msclr; + } + } + + // The last argument should be the context pointer. + cntx = va_arg( args, cntx_t* ); + + // Shutdown variable argument environment and clean up stack. + va_end( args ); + + // -- End variable argument section -- + + // Save the execution type into the context. + bli_cntx_set_method( method, cntx ); + + // Now that we have the context address, we want to copy the values + // from the temporary buffers into the corresponding buffers in the + // context. + + { + // Process each blocksize id tuple provided. + for ( i = 0; i < n_bs; ++i ) + { + // Read the current blocksize id, blocksize multiple id, + // and blocksize scalar. + bszid_t bs_id = bszids[ i ]; + double dsclr = dsclrs[ i ]; + double msclr = msclrs[ i ]; + + //blksz_t* cntx_blksz = &cntx_blkszs[ bs_id ]; + + // Query the blocksize multiple's blocksize id. + bszid_t bm_id = bli_cntx_get_bmult_id( bs_id, cntx ); + + // Query the context for the blksz_t object assoicated with the + // current blocksize id, and also query the object corresponding + // to the blocksize multiple. + blksz_t* cntx_blksz = bli_cntx_get_blksz( bs_id, cntx ); + blksz_t* cntx_bmult = bli_cntx_get_bmult( bs_id, cntx ); + + // Copy the real domain values of the blksz_t object into the + // the complex domain slots of the same object. + bli_blksz_copy_dt( BLIS_FLOAT, cntx_blksz, BLIS_SCOMPLEX, cntx_blksz ); + bli_blksz_copy_dt( BLIS_DOUBLE, cntx_blksz, BLIS_DCOMPLEX, cntx_blksz ); + + // If the default blocksize scalar is non-unit, we need to scale + // the complex domain default blocksizes. + if ( dsclr != 1.0 ) + { + // Scale the complex domain default blocksize values in the + // blocksize object. + bli_blksz_scale_def( 1, ( dim_t )dsclr, BLIS_SCOMPLEX, cntx_blksz ); + bli_blksz_scale_def( 1, ( dim_t )dsclr, BLIS_DCOMPLEX, cntx_blksz ); + + // Perform rounding to ensure the newly scaled values are still + // multiples of their register blocksize multiples. But only + // perform this rounding when the blocksize id is not equal to + // the blocksize multiple id (ie: we don't round down scaled + // register blocksizes since they are their own multiples). + // Also, we skip the rounding for 1m since it should never need + // such rounding. + if ( bs_id != bm_id && method != BLIS_1M ) + { + // Round the newly-scaled blocksizes down to their multiple. + bli_blksz_reduce_def_to( BLIS_FLOAT, cntx_bmult, BLIS_SCOMPLEX, cntx_blksz ); + bli_blksz_reduce_def_to( BLIS_DOUBLE, cntx_bmult, BLIS_DCOMPLEX, cntx_blksz ); + } + } + + // Similarly, if the maximum blocksize scalar is non-unit, we need + // to scale the complex domain maximum blocksizes. + if ( msclr != 1.0 ) + { + // Scale the complex domain maximum blocksize values in the + // blocksize object. + bli_blksz_scale_max( 1, ( dim_t )msclr, BLIS_SCOMPLEX, cntx_blksz ); + bli_blksz_scale_max( 1, ( dim_t )msclr, BLIS_DCOMPLEX, cntx_blksz ); + + // Perform rounding to ensure the newly scaled values are still + // multiples of their register blocksize multiples. But only + // perform this rounding when the blocksize id is not equal to + // the blocksize multiple id (ie: we don't round down scaled + // register blocksizes since they are their own multiples). + // Also, we skip the rounding for 1m since it should never need + // such rounding. + if ( bs_id != bm_id && method != BLIS_1M ) + { + // Round the newly-scaled blocksizes down to their multiple. + bli_blksz_reduce_max_to( BLIS_FLOAT, cntx_bmult, BLIS_SCOMPLEX, cntx_blksz ); + bli_blksz_reduce_max_to( BLIS_DOUBLE, cntx_bmult, BLIS_DCOMPLEX, cntx_blksz ); + } + } + } + } + + // Free the temporary local arrays. + bli_free_intl( bszids ); + bli_free_intl( dsclrs ); + bli_free_intl( msclrs ); } // ----------------------------------------------------------------------------- @@ -784,80 +569,203 @@ void bli_cntx_set_l3_nat_ukrs( dim_t n_ukrs, ... ) // ----------------------------------------------------------------------------- -void bli_cntx_set_l3_nat_ukr - ( - l3ukr_t ukr_id, - func_t* func, - cntx_t* cntx - ) +void bli_cntx_set_l1f_kers( dim_t n_kers, ... ) { - func_t* l3_nat_ukrs = bli_cntx_l3_nat_ukrs_buf( cntx ); + // This function can be called from the bli_cntx_init_*() function for + // a particular architecture if the kernel developer wishes to use + // non-default level-1f kernels. It should be called after + // bli_cntx_init_defaults() so that default functions are still called + // for any datatypes / register blocksizes that were not targed for + // optimization. - // Copy the function object into the specified location within - // the context's native level-3 ukernel array. - l3_nat_ukrs[ ukr_id ] = *func; + /* Example prototypes: + + void bli_cntx_set_l1f_kers + ( + dim_t n_ukrs, + l1mkr_t ker0_id, num_t ker0_dt, void* ker0_fp, + l1mkr_t ker1_id, num_t ker1_dt, void* ker1_fp, + l1mkr_t ker2_id, num_t ker2_dt, void* ker2_fp, + ... + cntx_t* cntx + ); + */ + va_list args; + dim_t i; + + // Allocate some temporary local arrays. + l1mkr_t* ker_ids = bli_malloc_intl( n_kers * sizeof( l1mkr_t ) ); + num_t* ker_dts = bli_malloc_intl( n_kers * sizeof( num_t ) ); + void** ker_fps = bli_malloc_intl( n_kers * sizeof( void* ) ); + + // -- Begin variable argument section -- + + // Initialize variable argument environment. + va_start( args, n_kers ); + + // Process n_kers tuples. + for ( i = 0; i < n_kers; ++i ) + { + // Here, we query the variable argument list for: + // - the l1fkr_t of the kernel we're about to process, + // - the datatype of the kernel, and + // - the kernel function pointer + // that we need to store to the context. + const l1fkr_t ker_id = va_arg( args, l1fkr_t ); + const num_t ker_dt = va_arg( args, num_t ); + void* ker_fp = va_arg( args, void* ); + + // Store the values in our temporary arrays. + ker_ids[ i ] = ker_id; + ker_dts[ i ] = ker_dt; + ker_fps[ i ] = ker_fp; + } + + // The last argument should be the context pointer. + cntx_t* cntx = va_arg( args, cntx_t* ); + + // Shutdown variable argument environment and clean up stack. + va_end( args ); + + // -- End variable argument section -- + + // Query the context for the address of: + // - the level-1f kernels func_t array + func_t* cntx_l1f_kers = bli_cntx_l1f_kers_buf( cntx ); + + // Now that we have the context address, we want to copy the values + // from the temporary buffers into the corresponding buffers in the + // context. + + // Process each blocksize id tuple provided. + for ( i = 0; i < n_kers; ++i ) + { + // Read the current blocksize id, blksz_t* pointer, blocksize + // multiple id, and blocksize scalar. + const l1fkr_t ker_id = ker_ids[ i ]; + const num_t ker_dt = ker_dts[ i ]; + void* ker_fp = ker_fps[ i ]; + + // Index into the func_t and mbool_t for the current kernel id + // being processed. + func_t* kers = &cntx_l1f_kers[ ker_id ]; + + // Store the ukernel function pointer and preference values into + // the context. + bli_func_set_dt( ker_fp, ker_dt, kers ); + } + + // Free the temporary local arrays. + bli_free_intl( ker_ids ); + bli_free_intl( ker_dts ); + bli_free_intl( ker_fps ); } -void bli_cntx_set_l3_nat_ukr_prefs - ( - l3ukr_t ukr_id, - mbool_t* prefs, - cntx_t* cntx - ) +// ----------------------------------------------------------------------------- + +void bli_cntx_set_l1v_kers( dim_t n_kers, ... ) { - mbool_t* l3_nat_ukrs_prefs = bli_cntx_l3_nat_ukrs_prefs_buf( cntx ); + // This function can be called from the bli_cntx_init_*() function for + // a particular architecture if the kernel developer wishes to use + // non-default level-1v kernels. It should be called after + // bli_cntx_init_defaults() so that default functions are still called + // for any datatypes / register blocksizes that were not targed for + // optimization. - // Copy the mbool_t into the specified location within - // the context's native level-3 ukernel preference array. - l3_nat_ukrs_prefs[ ukr_id ] = *prefs; -} + /* Example prototypes: -void bli_cntx_set_l3_vir_ukr - ( - l3ukr_t ukr_id, - func_t* func, - cntx_t* cntx - ) -{ - func_t* l3_vir_ukrs = bli_cntx_l3_vir_ukrs_buf( cntx ); + void bli_cntx_set_l1v_kers + ( + dim_t n_ukrs, + l1mkr_t ker0_id, num_t ker0_dt, void* ker0_fp, + l1mkr_t ker1_id, num_t ker1_dt, void* ker1_fp, + l1mkr_t ker2_id, num_t ker2_dt, void* ker2_fp, + ... + cntx_t* cntx + ); + */ + va_list args; + dim_t i; - // Copy the function object into the specified location within - // the context's virtual level-3 ukernel array. - l3_vir_ukrs[ ukr_id ] = *func; -} + // Allocate some temporary local arrays. + l1mkr_t* ker_ids = bli_malloc_intl( n_kers * sizeof( l1mkr_t ) ); + num_t* ker_dts = bli_malloc_intl( n_kers * sizeof( num_t ) ); + void** ker_fps = bli_malloc_intl( n_kers * sizeof( void* ) ); -void bli_cntx_set_l1f_ker - ( - l1fkr_t ker_id, - func_t* func, - cntx_t* cntx - ) -{ - func_t* l1f_kers = bli_cntx_l1f_kers_buf( cntx ); + // -- Begin variable argument section -- - // Copy the function object into the specified location within - // the context's level-1f kernel array. - l1f_kers[ ker_id ] = *func; -} + // Initialize variable argument environment. + va_start( args, n_kers ); -void bli_cntx_set_l1v_ker - ( - l1vkr_t ker_id, - func_t* func, - cntx_t* cntx - ) -{ - func_t* l1v_kers = bli_cntx_l1v_kers_buf( cntx ); + // Process n_kers tuples. + for ( i = 0; i < n_kers; ++i ) + { + // Here, we query the variable argument list for: + // - the l1vkr_t of the kernel we're about to process, + // - the datatype of the kernel, and + // - the kernel function pointer + // that we need to store to the context. + const l1vkr_t ker_id = va_arg( args, l1vkr_t ); + const num_t ker_dt = va_arg( args, num_t ); + void* ker_fp = va_arg( args, void* ); - // Copy the function object into the specified location within - // the context's level-1v kernel array. - l1v_kers[ ker_id ] = *func; + // Store the values in our temporary arrays. + ker_ids[ i ] = ker_id; + ker_dts[ i ] = ker_dt; + ker_fps[ i ] = ker_fp; + } + + // The last argument should be the context pointer. + cntx_t* cntx = va_arg( args, cntx_t* ); + + // Shutdown variable argument environment and clean up stack. + va_end( args ); + + // -- End variable argument section -- + + // Query the context for the address of: + // - the level-1v kernels func_t array + func_t* cntx_l1v_kers = bli_cntx_l1v_kers_buf( cntx ); + + // Now that we have the context address, we want to copy the values + // from the temporary buffers into the corresponding buffers in the + // context. + + // Process each blocksize id tuple provided. + for ( i = 0; i < n_kers; ++i ) + { + // Read the current blocksize id, blksz_t* pointer, blocksize + // multiple id, and blocksize scalar. + const l1vkr_t ker_id = ker_ids[ i ]; + const num_t ker_dt = ker_dts[ i ]; + void* ker_fp = ker_fps[ i ]; + + // Index into the func_t and mbool_t for the current kernel id + // being processed. + func_t* kers = &cntx_l1v_kers[ ker_id ]; + + // Store the ukernel function pointer and preference values into + // the context. + bli_func_set_dt( ker_fp, ker_dt, kers ); + } + + // Free the temporary local arrays. + bli_free_intl( ker_ids ); + bli_free_intl( ker_dts ); + bli_free_intl( ker_fps ); } // ----------------------------------------------------------------------------- void bli_cntx_set_packm_kers( dim_t n_kers, ... ) { + // This function can be called from the bli_cntx_init_*() function for + // a particular architecture if the kernel developer wishes to use + // non-default packing kernels. It should be called after + // bli_cntx_init_defaults() so that default functions are still called + // for any datatypes / register blocksizes that were not targed for + // optimization. + /* Example prototypes: void bli_cntx_set_packm_kers @@ -943,77 +851,6 @@ void bli_cntx_set_packm_kers( dim_t n_kers, ... ) // ----------------------------------------------------------------------------- -void bli_cntx_set_packm_ker - ( - l1mkr_t ker_id, - func_t* func, - cntx_t* cntx - ) -{ - func_t* packm_kers = bli_cntx_packm_kers_buf( cntx ); - - // Copy the function object into the specified location within - // the context's packm kernel array. - packm_kers[ ker_id ] = *func; -} - -// ----------------------------------------------------------------------------- - -void bli_cntx_set_ind_method - ( - ind_t method, - cntx_t* cntx - ) -{ - bli_cntx_set_method( method, cntx ); -} - -void bli_cntx_set_pack_schema_ab_blockpanel - ( - pack_t schema_a, - pack_t schema_b, - cntx_t* cntx - ) -{ - bli_cntx_set_schema_a_block( schema_a, cntx ); - bli_cntx_set_schema_b_panel( schema_b, cntx ); -} - -void bli_cntx_set_pack_schema_a_block - ( - pack_t schema_a, - cntx_t* cntx - ) -{ - bli_cntx_set_schema_a_block( schema_a, cntx ); -} - -void bli_cntx_set_pack_schema_b_panel - ( - pack_t schema_b, - cntx_t* cntx - ) -{ - bli_cntx_set_schema_b_panel( schema_b, cntx ); -} - -void bli_cntx_set_pack_schema_c_panel - ( - pack_t schema_c, - cntx_t* cntx - ) -{ - bli_cntx_set_schema_c_panel( schema_c, cntx ); -} - -#if 0 -void bli_cntx_set_ukr_anti_pref( bool_t anti_pref, - cntx_t* cntx ) -{ - bli_cntx_set_anti_pref( anti_pref, cntx ); -} -#endif - void bli_cntx_set_thrloop_from_env ( opid_t l3_op, @@ -1152,191 +989,6 @@ void bli_cntx_set_thrloop_from_env } -// ----------------------------------------------------------------------------- - -bool_t bli_cntx_l3_nat_ukr_prefers_rows_dt - ( - num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - mbool_t* ukrs_prefs = bli_cntx_get_l3_nat_ukr_prefs( ukr_id, cntx ); - bool_t ukr_prefs = bli_mbool_get_dt( dt, ukrs_prefs ); - - // A ukernel preference of TRUE means the ukernel prefers row - // storage. - return ukr_prefs == TRUE; -} - -bool_t bli_cntx_l3_nat_ukr_prefers_cols_dt - ( - num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - mbool_t* ukrs_prefs = bli_cntx_get_l3_nat_ukr_prefs( ukr_id, cntx ); - bool_t ukr_prefs = bli_mbool_get_dt( dt, ukrs_prefs ); - - // A ukernel preference of FALSE means the ukernel prefers column - // storage. - return ukr_prefs == FALSE; -} - -bool_t bli_cntx_l3_nat_ukr_prefers_storage_of - ( - obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - return !bli_cntx_l3_nat_ukr_dislikes_storage_of( obj, ukr_id, cntx ); -} - -bool_t bli_cntx_l3_nat_ukr_dislikes_storage_of - ( - obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - const num_t dt = bli_obj_datatype( *obj ); - const bool_t ukr_prefers_rows - = bli_cntx_l3_nat_ukr_prefers_rows_dt( dt, ukr_id, cntx ); - const bool_t ukr_prefers_cols - = bli_cntx_l3_nat_ukr_prefers_cols_dt( dt, ukr_id, cntx ); - bool_t r_val = FALSE; - - if ( bli_obj_is_row_stored( *obj ) && ukr_prefers_cols ) r_val = TRUE; - else if ( bli_obj_is_col_stored( *obj ) && ukr_prefers_rows ) r_val = TRUE; - - return r_val; -} - -bool_t bli_cntx_l3_nat_ukr_eff_prefers_storage_of - ( - obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - bool_t r_val = bli_cntx_l3_nat_ukr_prefers_storage_of( obj, ukr_id, cntx ); - - // If the anti-preference is set, negate the result. - if ( bli_cntx_anti_pref( cntx ) ) r_val = !r_val; - - return r_val; -} - -bool_t bli_cntx_l3_nat_ukr_eff_dislikes_storage_of - ( - obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - bool_t r_val = bli_cntx_l3_nat_ukr_dislikes_storage_of( obj, ukr_id, cntx ); - - // If the anti-preference is set, negate the result. - if ( bli_cntx_anti_pref( cntx ) ) r_val = !r_val; - - return r_val; -} - -// ----------------------------------------------------------------------------- - -bool_t bli_cntx_l3_ukr_prefers_rows_dt - ( - num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - // Reference the ukr storage preferences of the corresponding real - // micro-kernel for induced methods. - if ( bli_cntx_get_ind_method( cntx ) != BLIS_NAT ) - dt = bli_datatype_proj_to_real( dt ); - - return bli_cntx_l3_nat_ukr_prefers_rows_dt( dt, ukr_id, cntx ); -} - -bool_t bli_cntx_l3_ukr_prefers_cols_dt - ( - num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - // Reference the ukr storage preferences of the corresponding real - // micro-kernel for induced methods. - if ( bli_cntx_get_ind_method( cntx ) != BLIS_NAT ) - dt = bli_datatype_proj_to_real( dt ); - - return bli_cntx_l3_nat_ukr_prefers_cols_dt( dt, ukr_id, cntx ); -} - -bool_t bli_cntx_l3_ukr_prefers_storage_of - ( - obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - return !bli_cntx_l3_ukr_dislikes_storage_of( obj, ukr_id, cntx ); -} - -bool_t bli_cntx_l3_ukr_dislikes_storage_of - ( - obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - num_t dt = bli_obj_datatype( *obj ); - - const bool_t ukr_prefers_rows - = bli_cntx_l3_ukr_prefers_rows_dt( dt, ukr_id, cntx ); - const bool_t ukr_prefers_cols - = bli_cntx_l3_ukr_prefers_cols_dt( dt, ukr_id, cntx ); - bool_t r_val = FALSE; - - if ( bli_obj_is_row_stored( *obj ) && ukr_prefers_cols ) r_val = TRUE; - else if ( bli_obj_is_col_stored( *obj ) && ukr_prefers_rows ) r_val = TRUE; - - return r_val; -} - -bool_t bli_cntx_l3_ukr_eff_prefers_storage_of - ( - obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - bool_t r_val = bli_cntx_l3_ukr_prefers_storage_of( obj, ukr_id, cntx ); - - // If the anti-preference is set, negate the result. - if ( bli_cntx_anti_pref( cntx ) ) r_val = !r_val; - - return r_val; -} - -bool_t bli_cntx_l3_ukr_eff_dislikes_storage_of - ( - obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx - ) -{ - bool_t r_val = bli_cntx_l3_ukr_dislikes_storage_of( obj, ukr_id, cntx ); - - // If the anti-preference is set, negate the result. - if ( bli_cntx_anti_pref( cntx ) ) r_val = !r_val; - - return r_val; -} - // ----------------------------------------------------------------------------- void bli_cntx_print( cntx_t* cntx ) @@ -1345,9 +997,8 @@ void bli_cntx_print( cntx_t* cntx ) // Print the values stored in the blksz_t objects. printf( " s d c z\n" ); -#if 0 - //for ( i = 0; i < BLIS_NUM_BLKSZS; ++i ) - for ( i = 0; i < 6; ++i ) + + for ( i = 0; i < BLIS_NUM_BLKSZS; ++i ) { printf( "blksz/mult %2lu: %13lu/%2lu %13lu/%2lu %13lu/%2lu %13lu/%2lu\n", i, @@ -1361,12 +1012,10 @@ void bli_cntx_print( cntx_t* cntx ) bli_cntx_get_bmult_dt ( BLIS_DCOMPLEX, i, cntx ) ); } -#endif - for ( i = 0; i < BLIS_NUM_LEVEL3_UKRS; ++i ) { - func_t* ukr = bli_cntx_get_l3_vir_ukr( i, cntx ); + func_t* ukr = bli_cntx_get_l3_vir_ukrs( i, cntx ); printf( "l3 vir ukr %2lu: %16p %16p %16p %16p\n", i, @@ -1379,7 +1028,7 @@ void bli_cntx_print( cntx_t* cntx ) for ( i = 0; i < BLIS_NUM_LEVEL3_UKRS; ++i ) { - func_t* ukr = bli_cntx_get_l3_nat_ukr( i, cntx ); + func_t* ukr = bli_cntx_get_l3_nat_ukrs( i, cntx ); printf( "l3 nat ukr %2lu: %16p %16p %16p %16p\n", i, @@ -1392,7 +1041,7 @@ void bli_cntx_print( cntx_t* cntx ) for ( i = 0; i < BLIS_NUM_LEVEL1F_KERS; ++i ) { - func_t* ker = bli_cntx_get_l1f_ker( i, cntx ); + func_t* ker = bli_cntx_get_l1f_kers( i, cntx ); printf( "l1f ker %2lu: %16p %16p %16p %16p\n", i, @@ -1405,7 +1054,7 @@ void bli_cntx_print( cntx_t* cntx ) for ( i = 0; i < BLIS_NUM_LEVEL1V_KERS; ++i ) { - func_t* ker = bli_cntx_get_l1v_ker( i, cntx ); + func_t* ker = bli_cntx_get_l1v_kers( i, cntx ); printf( "l1v ker %2lu: %16p %16p %16p %16p\n", i, @@ -1417,7 +1066,7 @@ void bli_cntx_print( cntx_t* cntx ) } { - ind_t method = bli_cntx_get_ind_method( cntx ); + ind_t method = bli_cntx_method( cntx ); printf( "ind method : %lu\n", ( guint_t )method ); } diff --git a/frame/base/bli_cntx.h b/frame/base/bli_cntx.h index 3167d1bf4..01bba3cbf 100644 --- a/frame/base/bli_cntx.h +++ b/frame/base/bli_cntx.h @@ -36,8 +36,6 @@ #ifndef BLIS_CNTX_H #define BLIS_CNTX_H -//#include "bli_cntx_init.h" - // Context object type (defined in bli_type_defs.h) @@ -72,501 +70,619 @@ typedef struct cntx_s // ----------------------------------------------------------------------------- -// cntx_t query (fields only) +// +// -- cntx_t query (fields only) ----------------------------------------------- +// -#define bli_cntx_blkszs_buf( cntx ) \ -\ - ( (cntx)->blkszs ) - -#define bli_cntx_bmults_buf( cntx ) \ -\ - ( (cntx)->bmults ) - -#define bli_cntx_l3_vir_ukrs_buf( cntx ) \ -\ - ( (cntx)->l3_vir_ukrs ) - -#define bli_cntx_l3_nat_ukrs_buf( cntx ) \ -\ - ( (cntx)->l3_nat_ukrs ) - -#define bli_cntx_l3_nat_ukrs_prefs_buf( cntx ) \ -\ - ( (cntx)->l3_nat_ukrs_prefs ) - -#define bli_cntx_l1f_kers_buf( cntx ) \ -\ - ( (cntx)->l1f_kers ) - -#define bli_cntx_l1v_kers_buf( cntx ) \ -\ - ( (cntx)->l1v_kers ) - -#define bli_cntx_packm_kers_buf( cntx ) \ -\ - ( (cntx)->packm_kers ) - -#define bli_cntx_unpackm_kers_buf( cntx ) \ -\ - ( (cntx)->unpackm_kers ) - -#define bli_cntx_method( cntx ) \ -\ - ( (cntx)->method ) - -#define bli_cntx_schema_a_block( cntx ) \ -\ - ( (cntx)->schema_a_block ) - -#define bli_cntx_schema_b_panel( cntx ) \ -\ - ( (cntx)->schema_b_panel ) - -#define bli_cntx_schema_c_panel( cntx ) \ -\ - ( (cntx)->schema_c_panel ) - -#define bli_cntx_anti_pref( cntx ) \ -\ - ( (cntx)->anti_pref ) - -#define bli_cntx_thrloop( cntx ) \ -\ - ( (cntx)->thrloop ) - -#define bli_cntx_membrk( cntx ) \ -\ - ( (cntx)->membrk ) - -#if 1 -#define bli_cntx_jc_way( cntx ) \ -\ - ( (cntx)->thrloop[ BLIS_NC ] ) - -#define bli_cntx_pc_way( cntx ) \ -\ - ( (cntx)->thrloop[ BLIS_KC ] ) - -#define bli_cntx_ic_way( cntx ) \ -\ - ( (cntx)->thrloop[ BLIS_MC ] ) - -#define bli_cntx_jr_way( cntx ) \ -\ - ( (cntx)->thrloop[ BLIS_NR ] ) - -#define bli_cntx_ir_way( cntx ) \ -\ - ( (cntx)->thrloop[ BLIS_MR ] ) -#endif - -#define bli_cntx_way_for_bszid( bszid, cntx ) \ -\ - ( (cntx)->thrloop[ bszid ] ) - -// cntx_t modification (fields only) - -#define bli_cntx_set_blkszs_buf( _blkszs, cntx_p ) \ -{ \ - (cntx_p)->blkszs = _blkszs; \ +static blksz_t* bli_cntx_blkszs_buf( cntx_t* cntx ) +{ + return cntx->blkszs; } - -#define bli_cntx_set_bmults_buf( _bmults, cntx_p ) \ -{ \ - (cntx_p)->bmults = _bmults; \ +static bszid_t* bli_cntx_bmults_buf( cntx_t* cntx ) +{ + return cntx->bmults; } - -#define bli_cntx_set_l3_vir_ukrs_buf( _l3_vir_ukrs, cntx_p ) \ -{ \ - (cntx_p)->l3_vir_ukrs = _l3_vir_ukrs; \ +static func_t* bli_cntx_l3_vir_ukrs_buf( cntx_t* cntx ) +{ + return cntx->l3_vir_ukrs; } - -#define bli_cntx_set_l3_nat_ukrs_buf( _l3_nat_ukrs, cntx_p ) \ -{ \ - (cntx_p)->l3_nat_ukrs = _l3_nat_ukrs; \ +static func_t* bli_cntx_l3_nat_ukrs_buf( cntx_t* cntx ) +{ + return cntx->l3_nat_ukrs; } - -#define bli_cntx_set_l3_nat_ukrs_prefs_buf( _l3_nat_ukrs_prefs, cntx_p ) \ -{ \ - (cntx_p)->l3_nat_ukrs_prefs = _l3_nat_ukrs_prefs; \ +static mbool_t* bli_cntx_l3_nat_ukrs_prefs_buf( cntx_t* cntx ) +{ + return cntx->l3_nat_ukrs_prefs; } - -#define bli_cntx_set_l1f_kers_buf( _l1f_kers, cntx_p ) \ -{ \ - (cntx_p)->l1f_kers = _l1f_kers; \ +static func_t* bli_cntx_l1f_kers_buf( cntx_t* cntx ) +{ + return cntx->l1f_kers; } - -#define bli_cntx_set_l1v_kers_buf( _l1v_kers, cntx_p ) \ -{ \ - (cntx_p)->l1v_kers = _l1v_kers; \ +static func_t* bli_cntx_l1v_kers_buf( cntx_t* cntx ) +{ + return cntx->l1v_kers; } - -#define bli_cntx_set_method( _method, cntx_p ) \ -{ \ - (cntx_p)->method = _method; \ +static func_t* bli_cntx_packm_kers_buf( cntx_t* cntx ) +{ + return cntx->packm_kers; } - -#define bli_cntx_set_schema_a_block( _schema_a_block, cntx_p ) \ -{ \ - (cntx_p)->schema_a_block = _schema_a_block; \ +static func_t* bli_cntx_unpackm_kers_buf( cntx_t* cntx ) +{ + return cntx->unpackm_kers; } - -#define bli_cntx_set_schema_b_panel( _schema_b_panel, cntx_p ) \ -{ \ - (cntx_p)->schema_b_panel = _schema_b_panel; \ +static ind_t bli_cntx_method( cntx_t* cntx ) +{ + return cntx->method; } - -#define bli_cntx_set_schema_c_panel( _schema_c_panel, cntx_p ) \ -{ \ - (cntx_p)->schema_c_panel = _schema_c_panel; \ +static pack_t bli_cntx_schema_a_block( cntx_t* cntx ) +{ + return cntx->schema_a_block; } - -#define bli_cntx_set_anti_pref( _anti_pref, cntx_p ) \ -{ \ - (cntx_p)->anti_pref = _anti_pref; \ +static pack_t bli_cntx_schema_b_panel( cntx_t* cntx ) +{ + return cntx->schema_b_panel; } - -#define bli_cntx_set_thrloop( jc_, pc_, ic_, jr_, ir_, cntx_p ) \ -{ \ - (cntx_p)->thrloop[ BLIS_NC ] = jc_; \ - (cntx_p)->thrloop[ BLIS_KC ] = pc_; \ - (cntx_p)->thrloop[ BLIS_MC ] = ic_; \ - (cntx_p)->thrloop[ BLIS_NR ] = jr_; \ - (cntx_p)->thrloop[ BLIS_MR ] = ir_; \ - (cntx_p)->thrloop[ BLIS_KR ] = 1; \ +static pack_t bli_cntx_schema_c_panel( cntx_t* cntx ) +{ + return cntx->schema_c_panel; } - -#define bli_cntx_set_membrk( _membrk, cntx_p ) \ -{ \ - (cntx_p)->membrk = _membrk; \ +static bool_t bli_cntx_anti_pref( cntx_t* cntx ) +{ + return cntx->anti_pref; +} +static dim_t* bli_cntx_thrloop( cntx_t* cntx ) +{ + return cntx->thrloop; +} +static membrk_t* bli_cntx_get_membrk( cntx_t* cntx ) +{ + return cntx->membrk; } - -// cntx_t query (complex) - -#define bli_cntx_get_blksz_def_dt( dt, bs_id, cntx ) \ -\ - bli_blksz_get_def \ - ( \ - (dt), (&(bli_cntx_blkszs_buf( (cntx) ))[ bs_id ]) \ - ) - -#define bli_cntx_get_blksz_max_dt( dt, bs_id, cntx ) \ -\ - bli_blksz_get_max \ - ( \ - (dt), (&(bli_cntx_blkszs_buf( (cntx) ))[ bs_id ]) \ - ) - -#define bli_cntx_get_bmult_dt( dt, bs_id, cntx ) \ -\ - bli_blksz_get_def \ - ( \ - (dt), \ - (&(bli_cntx_blkszs_buf( (cntx) )) \ - [ \ - (bli_cntx_bmults_buf( (cntx) ))[ bs_id ] \ - ]) \ - ) - -#define bli_cntx_get_l3_ukr_dt( dt, ukr_id, cntx ) \ -\ - bli_func_get_dt \ - ( \ - (dt), \ - &(( \ - bli_cntx_method( (cntx) ) != BLIS_NAT && \ - bli_is_complex( dt ) \ - ? bli_cntx_l3_vir_ukrs_buf( (cntx) ) \ - : bli_cntx_l3_nat_ukrs_buf( (cntx) ) \ - )[ ukr_id ]) \ - ) - -#define bli_cntx_get_l3_vir_ukr_dt( dt, ukr_id, cntx ) \ -\ - bli_func_get_dt \ - ( \ - (dt), (&(bli_cntx_l3_vir_ukrs_buf( (cntx) ))[ ukr_id ]) \ - ) - -#define bli_cntx_get_l3_nat_ukr_dt( dt, ukr_id, cntx ) \ -\ - bli_func_get_dt \ - ( \ - (dt), (&(bli_cntx_l3_nat_ukrs_buf( (cntx) ))[ ukr_id ]) \ - ) - -#define bli_cntx_get_l1f_ker_dt( dt, ker_id, cntx ) \ -\ - bli_func_get_dt \ - ( \ - (dt), (&(bli_cntx_l1f_kers_buf( (cntx) ))[ ker_id ]) \ - ) - -#define bli_cntx_get_l1v_ker_dt( dt, ker_id, cntx ) \ -\ - bli_func_get_dt \ - ( \ - (dt), (&(bli_cntx_l1v_kers_buf( (cntx) ))[ ker_id ]) \ - ) - -#define bli_cntx_get_l3_nat_ukr_prefs_dt( dt, ukr_id, cntx ) \ -\ - bli_mbool_get_dt \ - ( \ - (dt), (&(bli_cntx_l3_nat_ukrs_prefs_buf( (cntx) ))[ ukr_id ]) \ - ) - -#define bli_cntx_get_ind_method( cntx ) \ -\ - bli_cntx_method( cntx ) - -#define bli_cntx_get_pack_schema_a_block( cntx ) \ -\ - bli_cntx_schema_a_block( cntx ) - -#define bli_cntx_get_pack_schema_b_panel( cntx ) \ -\ - bli_cntx_schema_b_panel( cntx ) - -#define bli_cntx_get_pack_schema_c_panel( cntx ) \ -\ - bli_cntx_schema_c_panel( cntx ) - -#define bli_cntx_get_membrk( cntx ) \ -\ - bli_cntx_membrk( cntx ) - - - // ----------------------------------------------------------------------------- -// create/free +// +// -- cntx_t modification (fields only) ---------------------------------------- +// -//void bli_cntx_create( cntx_t* cntx ); -//void bli_cntx_free( cntx_t* cntx ); -void bli_cntx_clear( cntx_t* cntx ); -void bli_cntx_init( cntx_t* cntx ); - -// get functions - -blksz_t* bli_cntx_get_blksz( bszid_t bs_id, - cntx_t* cntx ); -blksz_t* bli_cntx_get_bmult( bszid_t bs_id, - cntx_t* cntx ); -func_t* bli_cntx_get_l3_ukr( l3ukr_t ukr_id, - cntx_t* cntx ); -func_t* bli_cntx_get_l3_vir_ukr( l3ukr_t ukr_id, - cntx_t* cntx ); -func_t* bli_cntx_get_l3_nat_ukr( l3ukr_t ukr_id, - cntx_t* cntx ); -mbool_t* bli_cntx_get_l3_nat_ukr_prefs( l3ukr_t ukr_id, - cntx_t* cntx ); -func_t* bli_cntx_get_l1f_ker( l1fkr_t ker_id, - cntx_t* cntx ); -func_t* bli_cntx_get_l1v_ker( l1vkr_t ker_id, - cntx_t* cntx ); -//func_t* bli_cntx_get_packm_ukr( cntx_t* cntx ); - -//dim_t bli_cntx_get_blksz_def_dt( num_t dt, -// bszid_t bs_id, -// cntx_t* cntx ); -//dim_t bli_cntx_get_blksz_max_dt( num_t dt, -// bszid_t bs_id, -// cntx_t* cntx ); -//dim_t bli_cntx_get_bmult_dt( num_t dt, -// bszid_t bs_id, -// cntx_t* cntx ); -//void* bli_cntx_get_l3_ukr_dt( num_t dt, -// l3ukr_t ukr_id, -// cntx_t* cntx ); -//void* bli_cntx_get_l3_vir_ukr_dt( num_t dt, -// l3ukr_t ukr_id, -// cntx_t* cntx ); -//void* bli_cntx_get_l3_nat_ukr_dt( num_t dt, -// l3ukr_t ukr_id, -// cntx_t* cntx ); -//bool_t bli_cntx_get_l3_nat_ukr_prefs_dt( num_t dt, -// l3ukr_t ukr_id, -// cntx_t* cntx ); -//void* bli_cntx_get_l1f_ker_dt( num_t dt, -// l1fkr_t ker_id, -// cntx_t* cntx ); -//void* bli_cntx_get_l1v_ker_dt( num_t dt, -// l1vkr_t ker_id, -// cntx_t* cntx ); -func_t* bli_cntx_get_packm_ker( l1mkr_t ker_id, - cntx_t* cntx ); -func_t* bli_cntx_get_unpackm_ker( l1mkr_t ker_id, - cntx_t* cntx ); -//ind_t bli_cntx_get_ind_method( cntx_t* cntx ); -//pack_t bli_cntx_get_pack_schema_a_block( cntx_t* cntx ); -//pack_t bli_cntx_get_pack_schema_b_panel( cntx_t* cntx ); -//pack_t bli_cntx_get_pack_schema_c_panel( cntx_t* cntx ); -//bool_t bli_cntx_get_ukr_anti_pref( cntx_t* cntx ); -dim_t bli_cntx_get_num_threads( cntx_t* cntx ); -dim_t bli_cntx_get_num_threads_in( cntx_t* cntx, cntl_t* cntl ); - -// set functions - -void bli_cntx_set_blkszs( ind_t method, dim_t n_bs, ... ); - -void bli_cntx_set_blksz( bszid_t bs_id, - blksz_t* blksz, - bszid_t mult_id, - cntx_t* cntx ); - -void bli_cntx_set_l3_nat_ukrs( dim_t n_ukrs, ... ); - -void bli_cntx_set_l3_nat_ukr( l3ukr_t ukr_id, - func_t* func, - cntx_t* cntx ); -void bli_cntx_set_l3_nat_ukr_prefs( l3ukr_t ukr_id, - mbool_t* prefs, - cntx_t* cntx ); - -void bli_cntx_set_l3_vir_ukr( l3ukr_t ukr_id, - func_t* func, - cntx_t* cntx ); - -void bli_cntx_set_l1f_ker( l1fkr_t ker_id, - func_t* func, - cntx_t* cntx ); - -void bli_cntx_set_l1v_ker( l1vkr_t ker_id, - func_t* func, - cntx_t* cntx ); - -void bli_cntx_set_packm_kers( dim_t n_kers, ... ); - -void bli_cntx_set_packm_ker( l1mkr_t ker_id, - func_t* func, - cntx_t* cntx ); - -void bli_cntx_set_packm_ukr( func_t* func, - cntx_t* cntx ); -void bli_cntx_set_ind_method( ind_t method, - cntx_t* cntx ); -void bli_cntx_set_pack_schema_ab_blockpanel( pack_t schema_a, - pack_t schema_b, - cntx_t* cntx ); -void bli_cntx_set_pack_schema_a_block( pack_t schema_a, - cntx_t* cntx ); -void bli_cntx_set_pack_schema_b_panel( pack_t schema_b, - cntx_t* cntx ); -void bli_cntx_set_pack_schema_c_panel( pack_t schema_c, - cntx_t* cntx ); -//void bli_cntx_set_ukr_anti_pref( bool_t anti_pref, -// cntx_t* cntx ); -void bli_cntx_set_thrloop_from_env( opid_t l3_op, - side_t side, - cntx_t* cntx, - dim_t m, - dim_t n, - dim_t k ); - -// other query functions - -bool_t bli_cntx_l3_nat_ukr_prefers_rows_dt( num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_nat_ukr_prefers_cols_dt( num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_nat_ukr_prefers_storage_of( obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_nat_ukr_dislikes_storage_of( obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_nat_ukr_eff_prefers_storage_of( obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_nat_ukr_eff_dislikes_storage_of( obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_ukr_prefers_rows_dt( num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_ukr_prefers_cols_dt( num_t dt, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_ukr_prefers_storage_of( obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_ukr_dislikes_storage_of( obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_ukr_eff_prefers_storage_of( obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx ); -bool_t bli_cntx_l3_ukr_eff_dislikes_storage_of( obj_t* obj, - l3ukr_t ukr_id, - cntx_t* cntx ); - -// print function - -void bli_cntx_print( cntx_t* cntx ); +static void bli_cntx_set_method( ind_t method, cntx_t* cntx ) +{ + cntx->method = method; +} +static void bli_cntx_set_schema_a_block( pack_t schema, cntx_t* cntx ) +{ + cntx->schema_a_block = schema; +} +static void bli_cntx_set_schema_b_panel( pack_t schema, cntx_t* cntx ) +{ + cntx->schema_b_panel = schema; +} +static void bli_cntx_set_schema_c_panel( pack_t schema, cntx_t* cntx ) +{ + cntx->schema_c_panel = schema; +} +static void bli_cntx_set_schema_ab_blockpanel( pack_t sa, pack_t sb, cntx_t* cntx ) +{ + bli_cntx_set_schema_a_block( sa, cntx ); + bli_cntx_set_schema_b_panel( sb, cntx ); +} +static void bli_cntx_set_anti_pref( bool_t anti_pref, cntx_t* cntx ) +{ + cntx->anti_pref = anti_pref; +} +static void bli_cntx_set_membrk( membrk_t* membrk, cntx_t* cntx ) +{ + cntx->membrk = membrk; +} // ----------------------------------------------------------------------------- -// Preprocess out these calls entirely, since they are currently just empty -// functions that do nothing. -#if 0 - #define bli_cntx_create( cntx ) { bli_cntx_clear( cntx ); } - #define bli_cntx_free( cntx ) { bli_cntx_clear( cntx ); } -#else - #define bli_cntx_create( cntx ) { ; } - #define bli_cntx_free( cntx ) { ; } -#endif +// +// -- cntx_t query (complex) --------------------------------------------------- +// -// These macros initialize/finalize a local context if the given context -// pointer is NULL. When initializing, the context address that should -// be used (local or external) is assigned to cntx_p. +static blksz_t* bli_cntx_get_blksz( bszid_t bs_id, cntx_t* cntx ) +{ + blksz_t* blkszs = bli_cntx_blkszs_buf( cntx ); + blksz_t* blksz = &blkszs[ bs_id ]; -#define bli_cntx_init_local_if( opname, dt, cntx, cntx_p ) \ -\ - cntx_t _cntx_l; \ -\ - if ( bli_is_null( cntx ) ) \ - { \ - PASTEMAC(opname,_cntx_init)( dt, &_cntx_l ); \ - cntx_p = &_cntx_l; \ - } \ - else \ - { \ - cntx_p = cntx; \ + // Return the address of the blksz_t identified by bs_id. + return blksz; +} + +static dim_t bli_cntx_get_blksz_def_dt( num_t dt, bszid_t bs_id, cntx_t* cntx ) +{ + blksz_t* blksz = bli_cntx_get_blksz( bs_id, cntx ); + dim_t bs_dt = bli_blksz_get_def( dt, blksz ); + + // Return the main (default) blocksize value for the datatype given. + return bs_dt; +} + +static dim_t bli_cntx_get_blksz_max_dt( num_t dt, bszid_t bs_id, cntx_t* cntx ) +{ + blksz_t* blksz = bli_cntx_get_blksz( bs_id, cntx ); + dim_t bs_dt = bli_blksz_get_max( dt, blksz ); + + // Return the auxiliary (maximum) blocksize value for the datatype given. + return bs_dt; +} + +static bszid_t bli_cntx_get_bmult_id( bszid_t bs_id, cntx_t* cntx ) +{ + bszid_t* restrict bmults = bli_cntx_bmults_buf( cntx ); + bszid_t bm_id = bmults[ bs_id ]; + + return bm_id; +} + +static blksz_t* bli_cntx_get_bmult( bszid_t bs_id, cntx_t* cntx ) +{ + bszid_t bm_id = bli_cntx_get_bmult_id( bs_id, cntx ); + blksz_t* restrict bmult = bli_cntx_get_blksz( bm_id, cntx ); + + return bmult; +} + +static dim_t bli_cntx_get_bmult_dt( num_t dt, bszid_t bs_id, cntx_t* cntx ) +{ + blksz_t* bmult = bli_cntx_get_bmult( bs_id, cntx ); + dim_t bm_dt = bli_blksz_get_def( dt, bmult ); + + return bm_dt; +} + +// ----------------------------------------------------------------------------- + +static func_t* bli_cntx_get_l3_ukrs( l3ukr_t ukr_id, cntx_t* cntx ) +{ + func_t* funcs; + + if ( bli_cntx_method( (cntx) ) != BLIS_NAT ) + funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + else + funcs = bli_cntx_l3_nat_ukrs_buf( cntx ); + + func_t* func = &funcs[ ukr_id ]; + + return func; +} + +static void* bli_cntx_get_l3_ukr_dt( num_t dt, l3ukr_t ukr_id, cntx_t* cntx ) +{ + func_t* func = bli_cntx_get_l3_ukrs( ukr_id, cntx ); + + return bli_func_get_dt( dt, func ); +} + +static func_t* bli_cntx_get_l3_vir_ukrs( l3ukr_t ukr_id, cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + func_t* func = &funcs[ ukr_id ]; + + return func; +} + +static void* bli_cntx_get_l3_vir_ukr_dt( num_t dt, l3ukr_t ukr_id, cntx_t* cntx ) +{ + func_t* func = bli_cntx_get_l3_vir_ukrs( ukr_id, cntx ); + + return bli_func_get_dt( dt, func ); +} + +static func_t* bli_cntx_get_l3_nat_ukrs( l3ukr_t ukr_id, cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l3_nat_ukrs_buf( cntx ); + func_t* func = &funcs[ ukr_id ]; + + return func; +} + +static void* bli_cntx_get_l3_nat_ukr_dt( num_t dt, l3ukr_t ukr_id, cntx_t* cntx ) +{ + func_t* func = bli_cntx_get_l3_nat_ukrs( ukr_id, cntx ); + + return bli_func_get_dt( dt, func ); +} + +// ----------------------------------------------------------------------------- + +static mbool_t* bli_cntx_get_l3_nat_ukr_prefs( l3ukr_t ukr_id, cntx_t* cntx ) +{ + mbool_t* mbools = bli_cntx_l3_nat_ukrs_prefs_buf( cntx ); + mbool_t* mbool = &mbools[ ukr_id ]; + + return mbool; +} + +static bool_t bli_cntx_get_l3_nat_ukr_prefs_dt( num_t dt, l3ukr_t ukr_id, cntx_t* cntx ) +{ + mbool_t* mbool = bli_cntx_get_l3_nat_ukr_prefs( ukr_id, cntx ); + + return bli_mbool_get_dt( dt, mbool ); +} + +// ----------------------------------------------------------------------------- + +static func_t* bli_cntx_get_l1f_kers( l1fkr_t ker_id, cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l1f_kers_buf( cntx ); + func_t* func = &funcs[ ker_id ]; + + return func; +} + +static void* bli_cntx_get_l1f_ker_dt( num_t dt, l1fkr_t ker_id, cntx_t* cntx ) +{ + func_t* func = bli_cntx_get_l1f_kers( ker_id, cntx ); + + return bli_func_get_dt( dt, func ); +} + +// ----------------------------------------------------------------------------- + +static func_t* bli_cntx_get_l1v_kers( l1vkr_t ker_id, cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l1v_kers_buf( cntx ); + func_t* func = &funcs[ ker_id ]; + + return func; +} + +static void* bli_cntx_get_l1v_ker_dt( num_t dt, l1vkr_t ker_id, cntx_t* cntx ) +{ + func_t* func = bli_cntx_get_l1v_kers( ker_id, cntx ); + + return bli_func_get_dt( dt, func ); +} + +// ----------------------------------------------------------------------------- + +static func_t* bli_cntx_get_packm_kers( l1mkr_t ker_id, cntx_t* cntx ) +{ + func_t* func = NULL; + + // Only index to the requested packm func_t if the packm kernel being + // requested is one that is explicitly supported. + if ( 0 <= ( guint_t )ker_id && + ( guint_t )ker_id < BLIS_NUM_PACKM_KERS ) + { + func_t* funcs = bli_cntx_packm_kers_buf( cntx ); + + func = &funcs[ ker_id ]; } -#define bli_cntx_finalize_local_if( opname, cntx ) \ -\ - if ( bli_is_null( cntx ) ) \ - { \ - PASTEMAC(opname,_cntx_finalize)( &_cntx_l ); \ + return func; +} + +static void* bli_cntx_get_packm_ker_dt( num_t dt, l1mkr_t ker_id, cntx_t* cntx ) +{ + void* fp = NULL; + + // Only query the context for the packm func_t (and then extract the + // datatype-specific function pointer) if the packm kernel being + // requested is one that is explicitly supported. + if ( 0 <= ( guint_t )ker_id && + ( guint_t )ker_id < BLIS_NUM_PACKM_KERS ) + { + func_t* func = bli_cntx_get_packm_kers( ker_id, cntx ); + + fp = bli_func_get_dt( dt, func ); } + return fp; +} -#define bli_cntx_init_local_if2( opname, suf, dt, cntx, cntx_p ) \ -\ - cntx_t _cntx_l; \ -\ - if ( bli_is_null( cntx ) ) \ - { \ - PASTEMAC2(opname,suf,_cntx_init)( dt, &_cntx_l ); \ - cntx_p = &_cntx_l; \ - } \ - else \ - { \ - cntx_p = cntx; \ +static func_t* bli_cntx_get_unpackm_kers( l1mkr_t ker_id, cntx_t* cntx ) +{ + func_t* func = NULL; + + // Only index to the requested unpackm func_t if the unpackm kernel being + // requested is one that is explicitly supported. + if ( 0 <= ( guint_t )ker_id && + ( guint_t )ker_id < BLIS_NUM_UNPACKM_KERS ) + { + func_t* funcs = bli_cntx_unpackm_kers_buf( cntx ); + + func = &funcs[ ker_id ]; } -#define bli_cntx_finalize_local_if2( opname, suf, cntx ) \ -\ - if ( bli_is_null( cntx ) ) \ - { \ - PASTEMAC2(opname,suf,_cntx_finalize)( &_cntx_l ); \ + return func; +} + +static void* bli_cntx_get_unpackm_ker_dt( num_t dt, l1mkr_t ker_id, cntx_t* cntx ) +{ + void* fp = NULL; + + // Only query the context for the unpackm func_t (and then extract the + // datatype-specific function pointer) if the unpackm kernel being + // requested is one that is explicitly supported. + if ( 0 <= ( guint_t )ker_id && + ( guint_t )ker_id < BLIS_NUM_UNPACKM_KERS ) + { + func_t* func = bli_cntx_get_unpackm_kers( ker_id, cntx ); + + fp = bli_func_get_dt( dt, func ); } + return fp; +} + +// ----------------------------------------------------------------------------- + +static dim_t bli_cntx_jc_way( cntx_t* cntx ) +{ + return cntx->thrloop[ BLIS_NC ]; +} +static dim_t bli_cntx_pc_way( cntx_t* cntx ) +{ + return cntx->thrloop[ BLIS_KC ]; +} +static dim_t bli_cntx_ic_way( cntx_t* cntx ) +{ + return cntx->thrloop[ BLIS_MC ]; +} +static dim_t bli_cntx_jr_way( cntx_t* cntx ) +{ + return cntx->thrloop[ BLIS_NR ]; +} +static dim_t bli_cntx_ir_way( cntx_t* cntx ) +{ + return cntx->thrloop[ BLIS_MR ]; +} +static dim_t bli_cntx_pr_way( cntx_t* cntx ) +{ + return cntx->thrloop[ BLIS_KR ]; +} + +static dim_t bli_cntx_way_for_bszid( bszid_t bszid, cntx_t* cntx ) +{ + return cntx->thrloop[ bszid ]; +} + +static dim_t bli_cntx_get_num_threads( cntx_t* cntx ) +{ + return bli_cntx_jc_way( cntx ) * + bli_cntx_pc_way( cntx ) * + bli_cntx_ic_way( cntx ) * + bli_cntx_jr_way( cntx ) * + bli_cntx_ir_way( cntx ); +} + +// ----------------------------------------------------------------------------- + +static bool_t bli_cntx_l3_nat_ukr_prefers_rows_dt( num_t dt, l3ukr_t ukr_id, cntx_t* cntx ) +{ + bool_t prefs = bli_cntx_get_l3_nat_ukr_prefs_dt( dt, ukr_id, cntx ); + + // A ukernel preference of TRUE means the ukernel prefers row storage. + return prefs == TRUE; +} + +static bool_t bli_cntx_l3_nat_ukr_prefers_cols_dt( num_t dt, l3ukr_t ukr_id, cntx_t* cntx ) +{ + bool_t prefs = bli_cntx_get_l3_nat_ukr_prefs_dt( dt, ukr_id, cntx ); + + // A ukernel preference of FALSE means the ukernel prefers column storage. + return prefs == FALSE; +} + +static bool_t bli_cntx_l3_nat_ukr_prefers_storage_of( obj_t* obj, l3ukr_t ukr_id, cntx_t* cntx ) +{ + const num_t dt = bli_obj_datatype( *obj ); + const bool_t ukr_prefers_rows + = bli_cntx_l3_nat_ukr_prefers_rows_dt( dt, ukr_id, cntx ); + const bool_t ukr_prefers_cols + = bli_cntx_l3_nat_ukr_prefers_cols_dt( dt, ukr_id, cntx ); + bool_t r_val = FALSE; + + if ( bli_obj_is_row_stored( *obj ) && ukr_prefers_rows ) r_val = TRUE; + else if ( bli_obj_is_col_stored( *obj ) && ukr_prefers_cols ) r_val = TRUE; + + return r_val; +} + +static bool_t bli_cntx_l3_nat_ukr_dislikes_storage_of( obj_t* obj, l3ukr_t ukr_id, cntx_t* cntx ) +{ + return !bli_cntx_l3_nat_ukr_prefers_storage_of( obj, ukr_id, cntx ); +} + +static bool_t bli_cntx_l3_nat_ukr_eff_prefers_storage_of( obj_t* obj, l3ukr_t ukr_id, cntx_t* cntx ) +{ + bool_t r_val = bli_cntx_l3_nat_ukr_prefers_storage_of( obj, ukr_id, cntx ); + + // If the anti-preference is set, negate the result. + if ( bli_cntx_anti_pref( cntx ) ) r_val = !r_val; + + return r_val; +} + +static bool_t bli_cntx_l3_nat_ukr_eff_dislikes_storage_of( obj_t* obj, l3ukr_t ukr_id, cntx_t* cntx ) +{ + bool_t r_val = bli_cntx_l3_nat_ukr_dislikes_storage_of( obj, ukr_id, cntx ); + + // If the anti-preference is set, negate the result. + if ( bli_cntx_anti_pref( cntx ) ) r_val = !r_val; + + return r_val; +} + +// ----------------------------------------------------------------------------- + +static bool_t bli_cntx_l3_ukr_prefers_rows_dt( num_t dt, l3ukr_t ukr_id, cntx_t* cntx ) +{ + // For induced methods, return the ukernel storage preferences of the + // corresponding real micro-kernel. + if ( bli_cntx_method( cntx ) != BLIS_NAT ) + dt = bli_datatype_proj_to_real( dt ); + + return bli_cntx_l3_nat_ukr_prefers_rows_dt( dt, ukr_id, cntx ); +} + +static bool_t bli_cntx_l3_ukr_prefers_cols_dt( num_t dt, l3ukr_t ukr_id, cntx_t* cntx ) +{ + // For induced methods, return the ukernel storage preferences of the + // corresponding real micro-kernel. + if ( bli_cntx_method( cntx ) != BLIS_NAT ) + dt = bli_datatype_proj_to_real( dt ); + + return bli_cntx_l3_nat_ukr_prefers_cols_dt( dt, ukr_id, cntx ); +} + +static bool_t bli_cntx_l3_ukr_prefers_storage_of( obj_t* obj, l3ukr_t ukr_id, cntx_t* cntx ) +{ + const num_t dt = bli_obj_datatype( *obj ); + const bool_t ukr_prefers_rows + = bli_cntx_l3_ukr_prefers_rows_dt( dt, ukr_id, cntx ); + const bool_t ukr_prefers_cols + = bli_cntx_l3_ukr_prefers_cols_dt( dt, ukr_id, cntx ); + bool_t r_val = FALSE; + + if ( bli_obj_is_row_stored( *obj ) && ukr_prefers_rows ) r_val = TRUE; + else if ( bli_obj_is_col_stored( *obj ) && ukr_prefers_cols ) r_val = TRUE; + + return r_val; +} + +static bool_t bli_cntx_l3_ukr_dislikes_storage_of( obj_t* obj, l3ukr_t ukr_id, cntx_t* cntx ) +{ + return !bli_cntx_l3_ukr_prefers_storage_of( obj, ukr_id, cntx ); +} + +static bool_t bli_cntx_l3_ukr_eff_prefers_storage_of( obj_t* obj, l3ukr_t ukr_id, cntx_t* cntx ) +{ + bool_t r_val = bli_cntx_l3_ukr_prefers_storage_of( obj, ukr_id, cntx ); + + // If the anti-preference is set, negate the result. + if ( bli_cntx_anti_pref( cntx ) ) r_val = !r_val; + + return r_val; +} + +static bool_t bli_cntx_l3_ukr_eff_dislikes_storage_of( obj_t* obj, l3ukr_t ukr_id, cntx_t* cntx ) +{ + bool_t r_val = bli_cntx_l3_ukr_dislikes_storage_of( obj, ukr_id, cntx ); + + // If the anti-preference is set, negate the result. + if ( bli_cntx_anti_pref( cntx ) ) r_val = !r_val; + + return r_val; +} + +// ----------------------------------------------------------------------------- + +// +// -- cntx_t modification (complex) -------------------------------------------- +// + +static void bli_cntx_set_blksz( bszid_t bs_id, blksz_t* blksz, bszid_t mult_id, cntx_t* cntx ) +{ + blksz_t* blkszs = bli_cntx_blkszs_buf( cntx ); + bszid_t* bmults = bli_cntx_bmults_buf( cntx ); + + blkszs[ bs_id ] = *blksz; + bmults[ bs_id ] = mult_id; +} + +static void bli_cntx_set_l3_vir_ukr( l3ukr_t ukr_id, func_t* func, cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + + funcs[ ukr_id ] = *func; +} + +static void bli_cntx_set_l3_nat_ukr( l3ukr_t ukr_id, func_t* func, cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l3_nat_ukrs_buf( cntx ); + + funcs[ ukr_id ] = *func; +} + +static void bli_cntx_set_l3_nat_ukr_prefs( l3ukr_t ukr_id, mbool_t* prefs, cntx_t* cntx ) +{ + mbool_t* mbools = bli_cntx_l3_nat_ukrs_prefs_buf( cntx ); + + mbools[ ukr_id ] = *prefs; +} + +static void bli_cntx_set_l1f_ker( l1fkr_t ker_id, func_t* func, cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l1f_kers_buf( cntx ); + + funcs[ ker_id ] = *func; +} + +static void bli_cntx_set_l1v_ker( l1vkr_t ker_id, func_t* func, cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l1v_kers_buf( cntx ); + + funcs[ ker_id ] = *func; +} + +static void bli_cntx_set_packm_ker( l1mkr_t ker_id, func_t* func, cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_get_packm_kers( ker_id, cntx ); + + funcs[ ker_id ] = *func; +} + +static void bli_cntx_set_packm_ker_dt( void* fp, num_t dt, l1mkr_t ker_id, cntx_t* cntx ) +{ + func_t* func = bli_cntx_get_packm_ker_dt( dt, ker_id, cntx ); + + bli_func_set_dt( fp, dt, func ); +} + +static void bli_cntx_set_unpackm_ker( l1mkr_t ker_id, func_t* func, cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_get_unpackm_kers( ker_id, cntx ); + + funcs[ ker_id ] = *func; +} + +static void bli_cntx_set_unpackm_ker_dt( void* fp, num_t dt, l1mkr_t ker_id, cntx_t* cntx ) +{ + func_t* func = bli_cntx_get_unpackm_ker_dt( dt, ker_id, cntx ); + + bli_func_set_dt( fp, dt, func ); +} + +static void bli_cntx_set_thrloop( dim_t jc, dim_t pc, dim_t ic, dim_t jr, dim_t ir, cntx_t* cntx ) +{ + cntx->thrloop[ BLIS_NC ] = jc; + cntx->thrloop[ BLIS_KC ] = pc; + cntx->thrloop[ BLIS_MC ] = ic; + cntx->thrloop[ BLIS_NR ] = jr; + cntx->thrloop[ BLIS_MR ] = ir; + cntx->thrloop[ BLIS_KR ] = 1; +} + +// ----------------------------------------------------------------------------- + +// Function prototypes + +void bli_cntx_clear( cntx_t* cntx ); + +dim_t bli_cntx_get_num_threads_in( cntx_t* cntx, cntl_t* cntl ); + +void bli_cntx_set_blkszs( ind_t method, dim_t n_bs, ... ); + +void bli_cntx_set_ind_blkszs( ind_t method, dim_t n_bs, ... ); + +void bli_cntx_set_l3_nat_ukrs( dim_t n_ukrs, ... ); +void bli_cntx_set_l1f_kers( dim_t n_kers, ... ); +void bli_cntx_set_l1v_kers( dim_t n_kers, ... ); +void bli_cntx_set_packm_kers( dim_t n_kers, ... ); + +void bli_cntx_set_thrloop_from_env( opid_t l3_op, + side_t side, + cntx_t* cntx, + dim_t m, + dim_t n, + dim_t k ); + +void bli_cntx_print( cntx_t* cntx ); + #endif diff --git a/frame/base/bli_cpuid.c b/frame/base/bli_cpuid.c new file mode 100644 index 000000000..a9d77d1fb --- /dev/null +++ b/frame/base/bli_cpuid.c @@ -0,0 +1,682 @@ +/* + + 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" + +arch_t bli_cpuid_query_id( void ) +{ + uint32_t vendor, family, model, features; + + // Call the CPUID instruction and parse its results into a family id, + // model id, and a feature bit field. The return value encodes the + // vendor. + vendor = bli_cpuid_query( &family, &model, &features ); + + if ( vendor == VENDOR_INTEL ) + { + // Check for each Intel configuration that is enabled, check for that + // microarchitecture. We check from most recent to most dated. +#ifdef BLIS_CONFIG_KNL + if ( bli_cpuid_is_knl( family, model, features ) ) + return BLIS_ARCH_KNL; +#endif +#ifdef BLIS_CONFIG_HASWELL + if ( bli_cpuid_is_haswell( family, model, features ) ) + return BLIS_ARCH_HASWELL; +#endif +#ifdef BLIS_CONFIG_SANDYBRIDGE + if ( bli_cpuid_is_sandybridge( family, model, features ) ) + return BLIS_ARCH_SANDYBRIDGE; +#endif +#ifdef BLIS_CONFIG_PENRYN + if ( bli_cpuid_is_penryn( family, model, features ) ) + return BLIS_ARCH_PENRYN; +#endif + // If none of the other sub-configurations were detected, return + // the 'generic' arch_t id value. + return BLIS_ARCH_GENERIC; + } + else if ( vendor == VENDOR_AMD ) + { + + // Check for each AMD configuration that is enabled, check for that + // microarchitecture. We check from most recent to most dated. +#ifdef BLIS_CONFIG_ZEN + if ( bli_cpuid_is_zen( family, model, features ) ) + return BLIS_ARCH_ZEN; +#endif +#ifdef BLIS_CONFIG_EXCAVATOR + if ( bli_cpuid_is_excavator( family, model, features ) ) + return BLIS_ARCH_EXCAVATOR; +#endif +#ifdef BLIS_CONFIG_STEAMROLLER + if ( bli_cpuid_is_steamroller( family, model, features ) ) + return BLIS_ARCH_STEAMROLLER; +#endif +#ifdef BLIS_CONFIG_PILEDRIVER + if ( bli_cpuid_is_piledriver( family, model, features ) ) + return BLIS_ARCH_PILEDRIVER; +#endif +#ifdef BLIS_CONFIG_BULLDOZER + if ( bli_cpuid_is_bulldozer( family, model, features ) ) + return BLIS_ARCH_BULLDOZER; +#endif + // If none of the other sub-configurations were detected, return + // the 'generic' arch_t id value. + return BLIS_ARCH_GENERIC; + } + else if ( vendor == VENDOR_UNKNOWN ) + { + return BLIS_ARCH_GENERIC; + } + + return BLIS_ARCH_GENERIC; +} + +// ----------------------------------------------------------------------------- + +bool_t bli_cpuid_is_knl + ( + uint32_t family, + uint32_t model, + uint32_t features + ) +{ + // Check for expected CPU features. + const uint32_t expected = FEATURE_AVX | + FEATURE_FMA3 | + FEATURE_AVX2 | + FEATURE_AVX512F | + FEATURE_AVX512PF; + + if ( !bli_cpuid_has_features( features, expected ) ) return FALSE; + + return TRUE; +} + +bool_t bli_cpuid_is_haswell + ( + uint32_t family, + uint32_t model, + uint32_t features + ) +{ + // Check for expected CPU features. + const uint32_t expected = FEATURE_AVX | + FEATURE_FMA3 | + FEATURE_AVX2; + + if ( !bli_cpuid_has_features( features, expected ) ) return FALSE; + + return TRUE; +} + +bool_t bli_cpuid_is_sandybridge + ( + uint32_t family, + uint32_t model, + uint32_t features + ) +{ + // Check for expected CPU features. + const uint32_t expected = FEATURE_AVX; + + if ( !bli_cpuid_has_features( features, expected ) ) return FALSE; + + return TRUE; +} + +bool_t bli_cpuid_is_penryn + ( + uint32_t family, + uint32_t model, + uint32_t features + ) +{ + // Check for expected CPU features. + const uint32_t expected = FEATURE_SSE3 | + FEATURE_SSSE3; + + if ( !bli_cpuid_has_features( features, expected ) ) return FALSE; + + return TRUE; +} + + +// ----------------------------------------------------------------------------- + +bool_t bli_cpuid_is_zen + ( + uint32_t family, + uint32_t model, + uint32_t features + ) +{ + // Check for expected CPU features. + const uint32_t expected = FEATURE_AVX | + FEATURE_FMA3 | + FEATURE_AVX2; + + if ( !bli_cpuid_has_features( features, expected ) ) return FALSE; + + // All Zen cores have a family of 0x17. + if ( family != 0x17 ) return FALSE; + + // Finally, check for specific models: + // - 0x00-0xff (THIS NEEDS UPDATING) + const bool_t is_arch + = + ( 0x00 <= model && model <= 0xff ); + + if ( !is_arch ) return FALSE; + + return TRUE; +} + +bool_t bli_cpuid_is_excavator + ( + uint32_t family, + uint32_t model, + uint32_t features + ) +{ + // Check for expected CPU features. + const uint32_t expected = FEATURE_AVX | + FEATURE_FMA3 | + FEATURE_AVX2; + + if ( !bli_cpuid_has_features( features, expected ) ) return FALSE; + + // All Excavator cores have a family of 0x15. + if ( family != 0x15 ) return FALSE; + + // Finally, check for specific models: + // - 0x60-0x7f + const bool_t is_arch + = + ( 0x60 <= model && model <= 0x7f ); + + if ( !is_arch ) return FALSE; + + return TRUE; +} + +bool_t bli_cpuid_is_steamroller + ( + uint32_t family, + uint32_t model, + uint32_t features + ) +{ + // Check for expected CPU features. + const uint32_t expected = FEATURE_AVX | + FEATURE_FMA3 | + FEATURE_FMA4; + + if ( !bli_cpuid_has_features( features, expected ) ) return FALSE; + + // All Steamroller cores have a family of 0x15. + if ( family != 0x15 ) return FALSE; + + // Finally, check for specific models: + // - 0x30-0x3f + const bool_t is_arch + = + ( 0x30 <= model && model <= 0x3f ); + + if ( !is_arch ) return FALSE; + + return TRUE; +} + +bool_t bli_cpuid_is_piledriver + ( + uint32_t family, + uint32_t model, + uint32_t features + ) +{ + // Check for expected CPU features. + const uint32_t expected = FEATURE_AVX | + FEATURE_FMA3 | + FEATURE_FMA4; + + if ( !bli_cpuid_has_features( features, expected ) ) return FALSE; + + // All Piledriver cores have a family of 0x15. + if ( family != 0x15 ) return FALSE; + + // Finally, check for specific models: + // - 0x02 + // - 0x10-0x1f + const bool_t is_arch + = + model == 0x02 || ( 0x10 <= model && model <= 0x1f ); + + if ( !is_arch ) return FALSE; + + return TRUE; +} + +bool_t bli_cpuid_is_bulldozer + ( + uint32_t family, + uint32_t model, + uint32_t features + ) +{ + // Check for expected CPU features. + const uint32_t expected = FEATURE_AVX | + FEATURE_FMA4; + + if ( !bli_cpuid_has_features( features, expected ) ) return FALSE; + + // All Bulldozer cores have a family of 0x15. + if ( family != 0x15 ) return FALSE; + + // Finally, check for specific models: + // - 0x00 + // - 0x01 + const bool_t is_arch + = + ( model == 0x00 || model == 0x01 ); + + if ( !is_arch ) return FALSE; + + return TRUE; +} + +// ----------------------------------------------------------------------------- + +// +// This section of the file was based off of cpuid.cxx from TBLIS [1]. +// +// [1] https://github.com/devinamatthews/tblis +// + +/* + + Copyright (C) 2017, The University of Texas at Austin + Copyright (C) 2017, Devin Matthews + + 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. + +*/ + +#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86) + +enum +{ + // input register(s) output register + FEATURE_MASK_SSE3 = (1u<< 0), // cpuid[eax=1] :ecx[0] + FEATURE_MASK_SSSE3 = (1u<< 9), // cpuid[eax=1] :ecx[9] + FEATURE_MASK_SSE41 = (1u<<19), // cpuid[eax=1] :ecx[19] + FEATURE_MASK_SSE42 = (1u<<20), // cpuid[eax=1] :ecx[20] + FEATURE_MASK_AVX = (1u<<28), // cpuid[eax=1] :ecx[28] + FEATURE_MASK_AVX2 = (1u<< 5), // cpuid[eax=7,ecx=0] :ebx[5] + FEATURE_MASK_FMA3 = (1u<<12), // cpuid[eax=1] :ecx[12] + FEATURE_MASK_FMA4 = (1u<<16), // cpuid[eax=0x80000001]:ecx[16] + FEATURE_MASK_AVX512F = (1u<<16), // cpuid[eax=7,ecx=0] :ebx[16] + FEATURE_MASK_AVX512DQ = (1u<<17), // cpuid[eax=7,ecx=0] :ebx[17] + FEATURE_MASK_AVX512PF = (1u<<26), // cpuid[eax=7,ecx=0] :ebx[26] + FEATURE_MASK_AVX512ER = (1u<<27), // cpuid[eax=7,ecx=0] :ebx[27] + FEATURE_MASK_AVX512CD = (1u<<28), // cpuid[eax=7,ecx=0] :ebx[28] + FEATURE_MASK_AVX512BW = (1u<<30), // cpuid[eax=7,ecx=0] :ebx[30] + FEATURE_MASK_AVX512VL = (1u<<31), // cpuid[eax=7,ecx=0] :ebx[31] + FEATURE_MASK_XGETBV = (1u<<26)| + (1u<<27), // cpuid[eax=1] :ecx[27:26] + XGETBV_MASK_XMM = 0x02u, // xcr0[1] + XGETBV_MASK_YMM = 0x04u, // xcr0[2] + XGETBV_MASK_ZMM = 0xe0u // xcr0[7:5] +}; + + +uint32_t bli_cpuid_query + ( + uint32_t* family, + uint32_t* model, + uint32_t* features + ) +{ + uint32_t eax, ebx, ecx, edx; + + uint32_t old_model = 0; + uint32_t old_family = 0; + uint32_t ext_model = 0; + uint32_t ext_family = 0; + + *family = 0; + *model = 0; + *features = 0; + + //fprintf( stderr, "checking cpuid\n" ); + + uint32_t cpuid_max = __get_cpuid_max( 0, 0 ); + uint32_t cpuid_max_ext = __get_cpuid_max( 0x80000000u, 0 ); + + //fprintf( stderr, "max cpuid leaf: %d\n", cpuid_max ); + //fprintf( stderr, "max extended cpuid leaf: %08x\n", cpuid_max_ext ); + + if ( cpuid_max < 1 ) return VENDOR_UNKNOWN; + + // The fourth '0' serves as the NULL-terminator for the vendor string. + uint32_t vendor_string[4] = { 0, 0, 0, 0 }; + + // This is actually a macro that modifies the last four operands, + // hence why they are not passed by address. + __cpuid( 0, eax, vendor_string[0], + vendor_string[2], + vendor_string[1] ); + + // Check extended feature bits for post-AVX2 features. + if ( cpuid_max >= 7 ) + { + // This is actually a macro that modifies the last four operands, + // hence why they are not passed by address. + __cpuid_count( 7, 0, eax, ebx, ecx, edx ); + + //fprintf( stderr, "cpuid leaf 7:\n" ); + //print_binary( eax ); + //print_binary( ebx ); + //print_binary( ecx ); + //print_binary( edx ); + + if ( bli_cpuid_has_features( ebx, FEATURE_MASK_AVX2 ) ) *features |= FEATURE_AVX2; + if ( bli_cpuid_has_features( ebx, FEATURE_MASK_AVX512F ) ) *features |= FEATURE_AVX512F; + if ( bli_cpuid_has_features( ebx, FEATURE_MASK_AVX512DQ ) ) *features |= FEATURE_AVX512DQ; + if ( bli_cpuid_has_features( ebx, FEATURE_MASK_AVX512PF ) ) *features |= FEATURE_AVX512PF; + if ( bli_cpuid_has_features( ebx, FEATURE_MASK_AVX512ER ) ) *features |= FEATURE_AVX512ER; + if ( bli_cpuid_has_features( ebx, FEATURE_MASK_AVX512CD ) ) *features |= FEATURE_AVX512CD; + if ( bli_cpuid_has_features( ebx, FEATURE_MASK_AVX512BW ) ) *features |= FEATURE_AVX512BW; + if ( bli_cpuid_has_features( ebx, FEATURE_MASK_AVX512VL ) ) *features |= FEATURE_AVX512VL; + } + + // Check extended processor info / features bits for AMD-specific features. + if ( cpuid_max_ext >= 0x80000001u ) + { + // This is actually a macro that modifies the last four operands, + // hence why they are not passed by address. + __cpuid( 0x80000001u, eax, ebx, ecx, edx ); + + //fprintf(stderr, "extended cpuid leaf 0x80000001:\n"); + //print_binary(eax); + //print_binary(ebx); + //print_binary(ecx); + //print_binary(edx); + + if ( bli_cpuid_has_features( ecx, FEATURE_MASK_FMA4 ) ) *features |= FEATURE_FMA4; + } + + // Unconditionally check processor info / features bits. + { + // This is actually a macro that modifies the last four operands, + // hence why they are not passed by address. + __cpuid( 1, eax, ebx, ecx, edx ); + + //fprintf(stderr, "cpuid leaf 1:\n"); + //print_binary(eax); + //print_binary(ebx); + //print_binary(ecx); + //print_binary(edx); + + /* + cpuid(eax=1): eax[27:0] + + 3: 0 - Stepping + 7: 4 - Model + 11: 8 - Family + 13:12 - Processor Type + 19:16 - Extended Model + 27:20 - Extended Family + + Intel and AMD have suggested applications to display the family of a + CPU as the sum of the "Family" and the "Extended Family" fields shown + above, and the model as the sum of the "Model" and the 4-bit + left-shifted "Extended Model" fields. If "Family" is different than + 6 or 15, only the "Family" and "Model" fields should be used while the + "Extended Family" and "Extended Model" bits are reserved. If "Family" + is set to 15, then "Extended Family" and the 4-bit left-shifted + "Extended Model" should be added to the respective base values, and if + "Family" is set to 6, then only the 4-bit left-shifted "Extended Model" + should be added to "Model". + */ + + old_model = ( eax >> 4 ) & ( 0xF ); // bits 7:4 + old_family = ( eax >> 8 ) & ( 0xF ); // bits 11:8 + + ext_model = ( eax >> 16 ) & ( 0xF ); // bits 19:16 + ext_family = ( eax >> 20 ) & ( 0xFF ); // bits 27:20 + + // Set the display model and family values based on the original family + // value. See explanation above. + if ( old_family == 6 ) + { + *model = ( ext_model << 4 ) + old_model; + *family = old_family; + } + else if ( old_family == 15 ) + { + *model = ( ext_model << 4 ) + old_model; + *family = ( ext_family ) + old_family; + } + else + { + *model = old_model; + *family = old_family; + } + + // Check for SSE, AVX, and FMA3 features. + if ( bli_cpuid_has_features( ecx, FEATURE_MASK_SSE3 ) ) *features |= FEATURE_SSE3; + if ( bli_cpuid_has_features( ecx, FEATURE_MASK_SSSE3 ) ) *features |= FEATURE_SSSE3; + if ( bli_cpuid_has_features( ecx, FEATURE_MASK_SSE41 ) ) *features |= FEATURE_SSE41; + if ( bli_cpuid_has_features( ecx, FEATURE_MASK_SSE42 ) ) *features |= FEATURE_SSE42; + if ( bli_cpuid_has_features( ecx, FEATURE_MASK_AVX ) ) *features |= FEATURE_AVX; + if ( bli_cpuid_has_features( ecx, FEATURE_MASK_FMA3 ) ) *features |= FEATURE_FMA3; + + // Check whether the hardware supports xsave/xrestor/xsetbv/xgetbv AND + // support for these is enabled by the OS. If so, then we proceed with + // checking that various register-state saving features are available. + if ( bli_cpuid_has_features( ecx, FEATURE_MASK_XGETBV ) ) + { + uint32_t xcr = 0; + + // Call xgetbv to get xcr0 (the extended control register) copied + // to [edx:eax]. This encodes whether software supports various + // register state-saving features. + __asm__ __volatile__ + ( + ".byte 0x0F, 0x01, 0xD0" + : "=a" (eax), + "=d" (edx) + : "c" (xcr) + : "cc" + ); + + //fprintf(stderr, "xcr0:\n"); + //print_binary(eax); + //print_binary(edx); + + //fprintf(stderr, "xgetbv: xmm: %d\n", bli_cpuid_has_features(eax, XGETBV_MASK_XMM)); + //fprintf(stderr, "xgetbv: ymm: %d\n", bli_cpuid_has_features(eax, XGETBV_MASK_XMM| + // XGETBV_MASK_YMM)); + //fprintf(stderr, "xgetbv: zmm: %d\n", bli_cpuid_has_features(eax, XGETBV_MASK_XMM| + // XGETBV_MASK_YMM| + // XGETBV_MASK_ZMM)); + + // The OS can manage the state of 512-bit zmm (AVX-512) registers + // only if the xcr[7:5] bits are set. If they are not set, then + // clear all feature bits related to AVX-512. + if ( !bli_cpuid_has_features( eax, XGETBV_MASK_XMM | + XGETBV_MASK_YMM | + XGETBV_MASK_ZMM ) ) + { + *features &= ~( FEATURE_AVX512F | + FEATURE_AVX512DQ | + FEATURE_AVX512PF | + FEATURE_AVX512ER | + FEATURE_AVX512CD | + FEATURE_AVX512BW | + FEATURE_AVX512VL ); + } + + // The OS can manage the state of 256-bit ymm (AVX) registers + // only if the xcr[2] bit is set. If it is not set, then + // clear all feature bits related to AVX. + if ( !bli_cpuid_has_features( eax, XGETBV_MASK_XMM | + XGETBV_MASK_YMM ) ) + { + *features &= ~( FEATURE_AVX | + FEATURE_AVX2 | + FEATURE_FMA3 | + FEATURE_FMA4 ); + } + + // The OS can manage the state of 128-bit xmm (SSE) registers + // only if the xcr[1] bit is set. If it is not set, then + // clear all feature bits related to SSE (which means the + // entire bitfield is clear). + if ( !bli_cpuid_has_features( eax, XGETBV_MASK_XMM ) ) + { + *features = 0; + } + } + else + { + // If the hardware does not support xsave/xrestor/xsetbv/xgetbv, + // OR these features are not enabled by the OS, then we clear + // the bitfield, because it means that not even xmm support is + // present. + + //fprintf(stderr, "xgetbv: no\n"); + features = 0; + } + } + + //fprintf(stderr, "vendor: %12s\n", vendor_string); + //fprintf(stderr, "family: %d\n", family); + //fprintf(stderr, "model: %d\n", model); + //fprintf(stderr, "sse3: %d\n", bli_cpuid_has_features(features, FEATURE_SSE3)); + //fprintf(stderr, "ssse3: %d\n", bli_cpuid_has_features(features, FEATURE_SSSE3)); + //fprintf(stderr, "sse4.1: %d\n", bli_cpuid_has_features(features, FEATURE_SSE41)); + //fprintf(stderr, "sse4.2: %d\n", bli_cpuid_has_features(features, FEATURE_SSE42)); + //fprintf(stderr, "avx: %d\n", bli_cpuid_has_features(features, FEATURE_AVX)); + //fprintf(stderr, "avx2: %d\n", bli_cpuid_has_features(features, FEATURE_AVX2)); + //fprintf(stderr, "fma3: %d\n", bli_cpuid_has_features(features, FEATURE_FMA3)); + //fprintf(stderr, "fma4: %d\n", bli_cpuid_has_features(features, FEATURE_FMA4)); + //fprintf(stderr, "avx512f: %d\n", bli_cpuid_has_features(features, FEATURE_AVX512F)); + //fprintf(stderr, "avx512pf: %d\n", bli_cpuid_has_features(features, FEATURE_AVX512PF)); + //fprintf(stderr, "avx512dq: %d\n", bli_cpuid_has_features(features, FEATURE_AVX512DQ)); + + // Check the vendor string and return a value to indicate Intel or AMD. + if ( strcmp( ( char* )vendor_string, "AuthenticAMD" ) == 0 ) + return VENDOR_AMD; + else if ( strcmp( ( char* )vendor_string, "GenuineIntel" ) == 0 ) + return VENDOR_INTEL; + else + return VENDOR_UNKNOWN; +} + +#elif defined(__aarch64__) || defined(__arm__) || defined(_M_ARM) + +int get_cpu_type( int* model, int* part, int* features ) +{ + model = MODEL_UNKNOWN; + features = 0; + + FILE *fd1 = popen("grep -m 1 Processor /proc/cpuinfo", "r"); + if (!fd1) return VENDOR_ARM; + FILE *fd2 = popen("grep -m 1 'CPU part' /proc/cpuinfo", "r"); + if (!fd2) + { + pclose(fd1); + return VENDOR_ARM; + } + FILE *fd3 = popen("grep -m 1 Features /proc/cpuinfo", "r"); + if (!fd3) + { + pclose(fd1); + pclose(fd2); + return VENDOR_ARM; + } + + char c; + std::string proc, ptno, feat; + while ((c = fgetc(fd1)) != EOF) proc.push_back(c); + while ((c = fgetc(fd2)) != EOF) ptno.push_back(c); + while ((c = fgetc(fd3)) != EOF) feat.push_back(c); + + pclose(fd1); + pclose(fd2); + pclose(fd3); + + if (feat.find("neon") != std::string::npos || + feat.find("asimd") != std::string::npos) + features |= FEATURE_NEON; + + if (proc.find("ARMv7") != std::string::npos) + model = MODEL_ARMV7; + else if (proc.find("AArch64") != std::string::npos) + model = MODEL_ARMV8; + + auto pos = ptno.find("0x"); + TBLIS_ASSERT(pos != std::string::npos); + part = strtoi(ptno, pos, 16); + + return VENDOR_ARM; +} + + +#endif diff --git a/frame/base/bli_cpuid.h b/frame/base/bli_cpuid.h new file mode 100644 index 000000000..a9c99fef4 --- /dev/null +++ b/frame/base/bli_cpuid.h @@ -0,0 +1,151 @@ +/* + + 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_CPUID_H +#define BLIS_CPUID_H + +arch_t bli_cpuid_query_id( void ); + +bool_t bli_cpuid_is_knl( uint32_t family, uint32_t model, uint32_t features ); +bool_t bli_cpuid_is_haswell( uint32_t family, uint32_t model, uint32_t features ); +bool_t bli_cpuid_is_sandybridge( uint32_t family, uint32_t model, uint32_t features ); +bool_t bli_cpuid_is_penryn( uint32_t family, uint32_t model, uint32_t features ); + +bool_t bli_cpuid_is_zen( uint32_t family, uint32_t model, uint32_t features ); +bool_t bli_cpuid_is_excavator( uint32_t family, uint32_t model, uint32_t features ); +bool_t bli_cpuid_is_steamroller( uint32_t family, uint32_t model, uint32_t features ); +bool_t bli_cpuid_is_piledriver( uint32_t family, uint32_t model, uint32_t features ); +bool_t bli_cpuid_is_bulldozer( uint32_t family, uint32_t model, uint32_t features ); + +uint32_t bli_cpuid_query( uint32_t* family, uint32_t* model, uint32_t* features ); + +// ----------------------------------------------------------------------------- + +// +// This section of the file was based off of cpuid.hpp from TBLIS [1]. +// +// [1] https://github.com/devinamatthews/tblis +// + +/* + + Copyright (C) 2017, The University of Texas at Austin + Copyright (C) 2017, Devin Matthews + + 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. + +*/ + +static bool_t bli_cpuid_has_features( uint32_t have, uint32_t want ) +{ + return ( have & want ) == want; +} + +// ----------------------------------------------------------------------------- + +#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86) + +#include "cpuid.h" + +enum +{ + VENDOR_INTEL, + VENDOR_AMD, + VENDOR_UNKNOWN +}; +enum +{ + FEATURE_SSE3 = 0x0001, + FEATURE_SSSE3 = 0x0002, + FEATURE_SSE41 = 0x0004, + FEATURE_SSE42 = 0x0008, + FEATURE_AVX = 0x0010, + FEATURE_AVX2 = 0x0020, + FEATURE_FMA3 = 0x0040, + FEATURE_FMA4 = 0x0080, + FEATURE_AVX512F = 0x0100, + FEATURE_AVX512DQ = 0x0200, + FEATURE_AVX512PF = 0x0400, + FEATURE_AVX512ER = 0x0800, + FEATURE_AVX512CD = 0x1000, + FEATURE_AVX512BW = 0x2000, + FEATURE_AVX512VL = 0x4000 +}; + +#elif defined(__aarch64__) || defined(__arm__) || defined(_M_ARM) + +enum +{ + VENDOR_ARM, + VENDOR_UNKNOWN +}; +enum +{ + MODEL_ARMV7, + MODEL_ARMV8, + MODEL_UNKNOWN +}; +enum +{ + FEATURE_NEON = 0x1 +}; + +#endif + + + +#endif + diff --git a/frame/base/bli_error.c b/frame/base/bli_error.c index 2284d84c6..f2fc511ef 100644 --- a/frame/base/bli_error.c +++ b/frame/base/bli_error.c @@ -177,6 +177,22 @@ void bli_error_init_msgs( void ) sprintf( bli_error_string_for_code(BLIS_EXPECTED_OBJECT_ALIAS), "Expected object to be alias." ); + + sprintf( bli_error_string_for_code(BLIS_INVALID_ARCH_ID), + "Invalid architecture id value." ); + + sprintf( bli_error_string_for_code(BLIS_MC_DEF_NONMULTIPLE_OF_MR), + "Default MC is non-multiple of MR for one or more datatypes." ); + sprintf( bli_error_string_for_code(BLIS_MC_DEF_NONMULTIPLE_OF_MR), + "Maximum MC is non-multiple of MR for one or more datatypes." ); + sprintf( bli_error_string_for_code(BLIS_NC_DEF_NONMULTIPLE_OF_NR), + "Default NC is non-multiple of NR for one or more datatypes." ); + sprintf( bli_error_string_for_code(BLIS_NC_DEF_NONMULTIPLE_OF_NR), + "Maximum NC is non-multiple of NR for one or more datatypes." ); + sprintf( bli_error_string_for_code(BLIS_KC_DEF_NONMULTIPLE_OF_KR), + "Default KC is non-multiple of KR for one or more datatypes." ); + sprintf( bli_error_string_for_code(BLIS_KC_DEF_NONMULTIPLE_OF_KR), + "Maximum KC is non-multiple of KR for one or more datatypes." ); } void bli_print_msg( char* str, char* file, guint_t line ) diff --git a/frame/base/bli_func.h b/frame/base/bli_func.h index 2bfc2ad20..42c60028a 100644 --- a/frame/base/bli_func.h +++ b/frame/base/bli_func.h @@ -36,15 +36,36 @@ // func_t query -#define bli_func_get_dt( dt, f ) \ -\ - ( (f)->ptr[ dt ] ) +static void* bli_func_get_dt + ( + num_t dt, + func_t* func + ) +{ + return func->ptr[ dt ]; +} // func_t modification -#define bli_func_set_dt( fp, dt, f ) \ -{ \ - (f)->ptr[ dt ] = fp; \ +static void bli_func_set_dt + ( + void* fp, + num_t dt, + func_t* func + ) +{ + func->ptr[ dt ] = fp; +} + +static void bli_func_copy_dt + ( + num_t dt_src, func_t* func_src, + num_t dt_dst, func_t* func_dst + ) +{ + void* fp = bli_func_get_dt( dt_src, func_src ); + + bli_func_set_dt( fp, dt_dst, func_dst ); } // ----------------------------------------------------------------------------- diff --git a/frame/base/bli_gks.c b/frame/base/bli_gks.c index 4d819babe..2ae0223de 100644 --- a/frame/base/bli_gks.c +++ b/frame/base/bli_gks.c @@ -34,945 +34,495 @@ #include "blis.h" -// -// -- blksz_t structure -------------------------------------------------------- -// +// The array of cntx_t* pointers to cache modified contexts used by +// induced methods. +static cntx_t** gks[ BLIS_NUM_ARCHS ]; -static blksz_t bli_gks_blkszs[BLIS_NUM_BLKSZS] = -{ - /* float (0) scomplex (1) double (2) dcomplex (3) */ -/* kr */ { { BLIS_DEFAULT_KR_S, BLIS_DEFAULT_KR_C, BLIS_DEFAULT_KR_D, BLIS_DEFAULT_KR_Z, }, - { BLIS_PACKDIM_KR_S, BLIS_PACKDIM_KR_C, BLIS_PACKDIM_KR_D, BLIS_PACKDIM_KR_Z, } - }, -/* mr */ { { BLIS_DEFAULT_MR_S, BLIS_DEFAULT_MR_C, BLIS_DEFAULT_MR_D, BLIS_DEFAULT_MR_Z, }, - { BLIS_PACKDIM_MR_S, BLIS_PACKDIM_MR_C, BLIS_PACKDIM_MR_D, BLIS_PACKDIM_MR_Z, } - }, -/* nr */ { { BLIS_DEFAULT_NR_S, BLIS_DEFAULT_NR_C, BLIS_DEFAULT_NR_D, BLIS_DEFAULT_NR_Z, }, - { BLIS_PACKDIM_NR_S, BLIS_PACKDIM_NR_C, BLIS_PACKDIM_NR_D, BLIS_PACKDIM_NR_Z, } - }, -/* mc */ { { BLIS_DEFAULT_MC_S, BLIS_DEFAULT_MC_C, BLIS_DEFAULT_MC_D, BLIS_DEFAULT_MC_Z, }, - { BLIS_MAXIMUM_MC_S, BLIS_MAXIMUM_MC_C, BLIS_MAXIMUM_MC_D, BLIS_MAXIMUM_MC_Z, } - }, -/* kc */ { { BLIS_DEFAULT_KC_S, BLIS_DEFAULT_KC_C, BLIS_DEFAULT_KC_D, BLIS_DEFAULT_KC_Z, }, - { BLIS_MAXIMUM_KC_S, BLIS_MAXIMUM_KC_C, BLIS_MAXIMUM_KC_D, BLIS_MAXIMUM_KC_Z, } - }, -/* nc */ { { BLIS_DEFAULT_NC_S, BLIS_DEFAULT_NC_C, BLIS_DEFAULT_NC_D, BLIS_DEFAULT_NC_Z, }, - { BLIS_MAXIMUM_NC_S, BLIS_MAXIMUM_NC_C, BLIS_MAXIMUM_NC_D, BLIS_MAXIMUM_NC_Z, } - }, -/* m2 */ { { BLIS_DEFAULT_M2_S, BLIS_DEFAULT_M2_C, BLIS_DEFAULT_M2_D, BLIS_DEFAULT_M2_Z, }, - { BLIS_DEFAULT_M2_S, BLIS_DEFAULT_M2_C, BLIS_DEFAULT_M2_D, BLIS_DEFAULT_M2_Z, } - }, -/* n2 */ { { BLIS_DEFAULT_N2_S, BLIS_DEFAULT_N2_C, BLIS_DEFAULT_N2_D, BLIS_DEFAULT_N2_Z, }, - { BLIS_DEFAULT_N2_S, BLIS_DEFAULT_N2_C, BLIS_DEFAULT_N2_D, BLIS_DEFAULT_N2_Z, } - }, -/* 1f */ { { BLIS_DEFAULT_1F_S, BLIS_DEFAULT_1F_C, BLIS_DEFAULT_1F_D, BLIS_DEFAULT_1F_Z, }, - { BLIS_DEFAULT_1F_S, BLIS_DEFAULT_1F_C, BLIS_DEFAULT_1F_D, BLIS_DEFAULT_1F_Z, } - }, -/* af */ { { BLIS_DEFAULT_AF_S, BLIS_DEFAULT_AF_C, BLIS_DEFAULT_AF_D, BLIS_DEFAULT_AF_Z, }, - { BLIS_DEFAULT_AF_S, BLIS_DEFAULT_AF_C, BLIS_DEFAULT_AF_D, BLIS_DEFAULT_AF_Z, } - }, -/* df */ { { BLIS_DEFAULT_DF_S, BLIS_DEFAULT_DF_C, BLIS_DEFAULT_DF_D, BLIS_DEFAULT_DF_Z, }, - { BLIS_DEFAULT_DF_S, BLIS_DEFAULT_DF_C, BLIS_DEFAULT_DF_D, BLIS_DEFAULT_DF_Z, } - }, -}; +// The array of function pointers holding the registered context initialization +// functions for induced methods. +static void* cntx_ind_init[ BLIS_NUM_ARCHS ]; -// ----------------------------------------------------------------------------- +// The array of function pointers holding the registered context initialization +// functions for reference kernels. +static void* cntx_ref_init[ BLIS_NUM_ARCHS ]; -void bli_gks_get_blksz( bszid_t bs_id, - blksz_t* blksz ) -{ - *blksz = bli_gks_blkszs[ bs_id ]; -} - -void bli_gks_cntx_set_blkszs( ind_t method, dim_t n_bs, ... ) -{ - /* Example prototypes: - - void bli_gks_cntx_set_blkszs - ( - ind_t method = BLIS_NAT, - dim_t n_bs, - bszid_t bs0_id, bszid_t bm0_id, - bszid_t bs1_id, bszid_t bm1_id, - bszid_t bs2_id, bszid_t bm2_id, - ... - cntx_t* cntx - ); - - void bli_gks_cntx_set_blkszs - ( - ind_t method != BLIS_NAT, - dim_t n_bs, - bszid_t bs0_id, bszid_t bm0_id, dim_t def_scalr0, dim_t max_scalr0, - bszid_t bs1_id, bszid_t bm1_id, dim_t def_scalr1, dim_t max_scalr1, - bszid_t bs2_id, bszid_t bm2_id, dim_t def_scalr2, dim_t max_scalr2, - ... - cntx_t* cntx - ); - */ - va_list args; - dim_t i; - - bszid_t* bszids; - bszid_t* bmults; - double* dsclrs; - double* msclrs; - - cntx_t* cntx; - - blksz_t* cntx_blkszs; - bszid_t* cntx_bmults; - - - // Allocate some temporary local arrays. - bszids = bli_malloc_intl( n_bs * sizeof( bszid_t ) ); - bmults = bli_malloc_intl( n_bs * sizeof( bszid_t ) ); - dsclrs = bli_malloc_intl( n_bs * sizeof( double ) ); - msclrs = bli_malloc_intl( n_bs * sizeof( double ) ); - - // -- Begin variable argument section -- - - // Initialize variable argument environment. - va_start( args, n_bs ); - - // Handle native and induced method cases separately. - if ( method == BLIS_NAT ) - { - // Process n_bs tuples. - for ( i = 0; i < n_bs; ++i ) - { - // Here, we query the variable argument list for: - // - the bszid_t of the blocksize we're about to process, - // - the bszid_t of the multiple we need to associate with - // the blksz_t object. - bszid_t bs_id = va_arg( args, bszid_t ); - bszid_t bm_id = va_arg( args, bszid_t ); - - // Store the values in our temporary arrays. - bszids[ i ] = bs_id; - bmults[ i ] = bm_id; - } - } - else // if induced method execution was indicated - { - // Process n_bs tuples. - for ( i = 0; i < n_bs; ++i ) - { - // Here, we query the variable argument list for: - // - the bszid_t of the blocksize we're about to process, - // - the bszid_t of the multiple we need to associate with - // the blksz_t object. - // - the scalars we wish to apply to the real blocksizes to - // come up with the induced complex blocksizes (for default - // and maximum blocksizes). - bszid_t bs_id = va_arg( args, bszid_t ); - bszid_t bm_id = va_arg( args, bszid_t ); - double dsclr = va_arg( args, double ); - double msclr = va_arg( args, double ); - - // Store the values in our temporary arrays. - bszids[ i ] = bs_id; - bmults[ i ] = bm_id; - dsclrs[ i ] = dsclr; - msclrs[ i ] = msclr; - } - } - - // The last argument should be the context pointer. - cntx = va_arg( args, cntx_t* ); - - // Shutdown variable argument environment and clean up stack. - va_end( args ); - - // -- End variable argument section -- - - // Save the execution type into the context. - bli_cntx_set_method( method, cntx ); - - // Query the context for the addresses of: - // - the blocksize object array - // - the blocksize multiple array - cntx_blkszs = bli_cntx_blkszs_buf( cntx ); - cntx_bmults = bli_cntx_bmults_buf( cntx ); - - // Now that we have the context address, we want to copy the values - // from the temporary buffers into the corresponding buffers in the - // context. - - // Handle native and induced method cases separately. - if ( method == BLIS_NAT ) - { - // Process each blocksize id tuple provided. - for ( i = 0; i < n_bs; ++i ) - { - // Read the current blocksize id, blocksize multiple id. - bszid_t bs_id = bszids[ i ]; - bszid_t bm_id = bmults[ i ]; - - blksz_t* cntx_blksz = &cntx_blkszs[ bs_id ]; - - // Query the blocksizes (blksz_t) associated with bs_id and save - // them directly into the appropriate location in the context's - // blksz_t array. - bli_gks_get_blksz( bs_id, cntx_blksz ); - - // Copy the blocksize multiple id into the context. - cntx_bmults[ bs_id ] = bm_id; - } - } - else - { - // Process each blocksize id tuple provided. - for ( i = 0; i < n_bs; ++i ) - { - // Read the current blocksize id, blocksize multiple id, - // and blocksize scalar. - bszid_t bs_id = bszids[ i ]; - bszid_t bm_id = bmults[ i ]; - double dsclr = dsclrs[ i ]; - double msclr = msclrs[ i ]; - - blksz_t blksz_l; - blksz_t bmult_l; - - blksz_t* blksz = &blksz_l; - blksz_t* bmult = &bmult_l; - - blksz_t* cntx_blksz = &cntx_blkszs[ bs_id ]; - - // Query the blocksizes (blksz_t) associated with bs_id and bm_id - // and use them to populate a pair of local blksz_t objects. - bli_gks_get_blksz( bs_id, blksz ); - bli_gks_get_blksz( bm_id, bmult ); - - // Copy the real domain values of the source blksz_t object into - // the context, duplicating into the complex domain fields. - bli_blksz_copy_dt( BLIS_FLOAT, blksz, BLIS_FLOAT, cntx_blksz ); - bli_blksz_copy_dt( BLIS_DOUBLE, blksz, BLIS_DOUBLE, cntx_blksz ); - bli_blksz_copy_dt( BLIS_FLOAT, blksz, BLIS_SCOMPLEX, cntx_blksz ); - bli_blksz_copy_dt( BLIS_DOUBLE, blksz, BLIS_DCOMPLEX, cntx_blksz ); - - // If the default blocksize scalar is non-unit, we need to scale - // the complex domain default blocksizes. - if ( dsclr != 1.0 ) - { - // Scale the complex domain default blocksize values in the - // blocksize object. - bli_blksz_scale_def( 1, ( dim_t )dsclr, BLIS_SCOMPLEX, cntx_blksz ); - bli_blksz_scale_def( 1, ( dim_t )dsclr, BLIS_DCOMPLEX, cntx_blksz ); - - if ( bs_id != bm_id ) - { - // Round the newly-scaled blocksizes down to their multiple. - // (Note that both the default and maximum blocksize values - // must be a multiple of the same blocksize multiple.) Also, - // note that this is only done when the blocksize id is not - // equal to the blocksize multiple id (ie: we don't round - // down scaled register blocksizes since they are their own - // multiples). - bli_blksz_reduce_def_to( BLIS_FLOAT, bmult, BLIS_SCOMPLEX, cntx_blksz ); - bli_blksz_reduce_def_to( BLIS_DOUBLE, bmult, BLIS_DCOMPLEX, cntx_blksz ); - } - } - - // Similarly, if the maximum blocksize scalar is non-unit, we need - // to scale the complex domain maximum blocksizes. - if ( msclr != 1.0 ) - { - // Scale the complex domain maximum blocksize values in the - // blocksize object. - bli_blksz_scale_max( 1, ( dim_t )msclr, BLIS_SCOMPLEX, cntx_blksz ); - bli_blksz_scale_max( 1, ( dim_t )msclr, BLIS_DCOMPLEX, cntx_blksz ); - - if ( bs_id != bm_id ) - { - // Round the newly-scaled blocksizes down to their multiple. - // (Note that both the default and maximum blocksize values - // must be a multiple of the same blocksize multiple.) Also, - // note that this is only done when the blocksize id is not - // equal to the blocksize multiple id (ie: we don't round - // down scaled register blocksizes since they are their own - // multiples). - bli_blksz_reduce_max_to( BLIS_FLOAT, bmult, BLIS_SCOMPLEX, cntx_blksz ); - bli_blksz_reduce_max_to( BLIS_DOUBLE, bmult, BLIS_DCOMPLEX, cntx_blksz ); - } - } - - // Copy the blocksize multiple id into the context. - cntx_bmults[ bs_id ] = bm_id; - } - } - - // Free the temporary local arrays. - bli_free_intl( bszids ); - bli_free_intl( bmults ); - bli_free_intl( dsclrs ); - bli_free_intl( msclrs ); -} - - -// -// -- level-3 micro-kernel structure ------------------------------------------- -// - -static func_t bli_gks_l3_ind_ukrs[BLIS_NUM_IND_METHODS] - [BLIS_NUM_LEVEL3_UKRS] = -{ - /* s(0) c(1) d(2) z(3) */ -/* 3mh */ { -/* gemm */ { { NULL, BLIS_CGEMM3MH_UKERNEL, NULL, BLIS_ZGEMM3MH_UKERNEL, } }, -/* gemmtrsm_l */ { { NULL, NULL, NULL, NULL, } }, -/* gemmtrsm_u */ { { NULL, NULL, NULL, NULL, } }, -/* trsm_l */ { { NULL, NULL, NULL, NULL, } }, -/* trsm_u */ { { NULL, NULL, NULL, NULL, } }, - }, -/* 3m3 */ { -/* gemm */ { { NULL, BLIS_CGEMM3M3_UKERNEL, NULL, BLIS_ZGEMM3M3_UKERNEL, } }, -/* gemmtrsm_l */ { { NULL, NULL, NULL, NULL, } }, -/* gemmtrsm_u */ { { NULL, NULL, NULL, NULL, } }, -/* trsm_l */ { { NULL, NULL, NULL, NULL, } }, -/* trsm_u */ { { NULL, NULL, NULL, NULL, } }, - }, -/* 3m2 */ { -/* gemm */ { { NULL, BLIS_CGEMM3M2_UKERNEL, NULL, BLIS_ZGEMM3M2_UKERNEL, } }, -/* gemmtrsm_l */ { { NULL, NULL, NULL, NULL, } }, -/* gemmtrsm_u */ { { NULL, NULL, NULL, NULL, } }, -/* trsm_l */ { { NULL, NULL, NULL, NULL, } }, -/* trsm_u */ { { NULL, NULL, NULL, NULL, } }, - }, -/* 3m1 */ { -/* gemm */ { { NULL, BLIS_CGEMM3M1_UKERNEL, NULL, BLIS_ZGEMM3M1_UKERNEL, } }, -/* gemmtrsm_l */ { { NULL, BLIS_CGEMMTRSM3M1_L_UKERNEL, NULL, BLIS_ZGEMMTRSM3M1_L_UKERNEL, } }, -/* gemmtrsm_u */ { { NULL, BLIS_CGEMMTRSM3M1_U_UKERNEL, NULL, BLIS_ZGEMMTRSM3M1_U_UKERNEL, } }, -/* trsm_l */ { { NULL, BLIS_CTRSM3M1_L_UKERNEL, NULL, BLIS_ZTRSM3M1_L_UKERNEL, } }, -/* trsm_u */ { { NULL, BLIS_CTRSM3M1_U_UKERNEL, NULL, BLIS_ZTRSM3M1_U_UKERNEL, } }, - }, -/* 4mh */ { -/* gemm */ { { NULL, BLIS_CGEMM4MH_UKERNEL, NULL, BLIS_ZGEMM4MH_UKERNEL, } }, -/* gemmtrsm_l */ { { NULL, NULL, NULL, NULL, } }, -/* gemmtrsm_u */ { { NULL, NULL, NULL, NULL, } }, -/* trsm_l */ { { NULL, NULL, NULL, NULL, } }, -/* trsm_u */ { { NULL, NULL, NULL, NULL, } }, - }, -/* 4m1b */ { -/* gemm */ { { NULL, BLIS_CGEMM4MB_UKERNEL, NULL, BLIS_ZGEMM4MB_UKERNEL, } }, -/* gemmtrsm_l */ { { NULL, NULL, NULL, NULL, } }, -/* gemmtrsm_u */ { { NULL, NULL, NULL, NULL, } }, -/* trsm_l */ { { NULL, NULL, NULL, NULL, } }, -/* trsm_u */ { { NULL, NULL, NULL, NULL, } }, - }, -/* 4m1a */ { -/* gemm */ { { NULL, BLIS_CGEMM4M1_UKERNEL, NULL, BLIS_ZGEMM4M1_UKERNEL, } }, -/* gemmtrsm_l */ { { NULL, BLIS_CGEMMTRSM4M1_L_UKERNEL, NULL, BLIS_ZGEMMTRSM4M1_L_UKERNEL, } }, -/* gemmtrsm_u */ { { NULL, BLIS_CGEMMTRSM4M1_U_UKERNEL, NULL, BLIS_ZGEMMTRSM4M1_U_UKERNEL, } }, -/* trsm_l */ { { NULL, BLIS_CTRSM4M1_L_UKERNEL, NULL, BLIS_ZTRSM4M1_L_UKERNEL, } }, -/* trsm_u */ { { NULL, BLIS_CTRSM4M1_U_UKERNEL, NULL, BLIS_ZTRSM4M1_U_UKERNEL, } }, - }, -/* 1m */ { -/* gemm */ { { BLIS_SGEMM_UKERNEL, BLIS_CGEMM1M_UKERNEL, - BLIS_DGEMM_UKERNEL, BLIS_ZGEMM1M_UKERNEL, } }, -/* gemmtrsm_l */ { { NULL, BLIS_CGEMMTRSM1M_L_UKERNEL, - NULL, BLIS_ZGEMMTRSM1M_L_UKERNEL, } }, -/* gemmtrsm_u */ { { NULL, BLIS_CGEMMTRSM1M_U_UKERNEL, - NULL, BLIS_ZGEMMTRSM1M_U_UKERNEL, } }, -/* trsm_l */ { { NULL, BLIS_CTRSM1M_L_UKERNEL, - NULL, BLIS_ZTRSM1M_L_UKERNEL, } }, -/* trsm_u */ { { NULL, BLIS_CTRSM1M_U_UKERNEL, - NULL, BLIS_ZTRSM1M_U_UKERNEL, } }, - }, -/* nat */ { -/* gemm */ { { BLIS_SGEMM_UKERNEL, BLIS_CGEMM_UKERNEL, - BLIS_DGEMM_UKERNEL, BLIS_ZGEMM_UKERNEL, } }, -/* gemmtrsm_l */ { { BLIS_SGEMMTRSM_L_UKERNEL, BLIS_CGEMMTRSM_L_UKERNEL, - BLIS_DGEMMTRSM_L_UKERNEL, BLIS_ZGEMMTRSM_L_UKERNEL, } }, -/* gemmtrsm_u */ { { BLIS_SGEMMTRSM_U_UKERNEL, BLIS_CGEMMTRSM_U_UKERNEL, - BLIS_DGEMMTRSM_U_UKERNEL, BLIS_ZGEMMTRSM_U_UKERNEL, } }, -/* trsm_l */ { { BLIS_STRSM_L_UKERNEL, BLIS_CTRSM_L_UKERNEL, - BLIS_DTRSM_L_UKERNEL, BLIS_ZTRSM_L_UKERNEL, } }, -/* trsm_u */ { { BLIS_STRSM_U_UKERNEL, BLIS_CTRSM_U_UKERNEL, - BLIS_DTRSM_U_UKERNEL, BLIS_ZTRSM_U_UKERNEL, } }, - }, -}; - -static func_t bli_gks_l3_ref_ukrs[BLIS_NUM_LEVEL3_UKRS] = -{ - /* float (0) scomplex (1) double (2) dcomplex (3) */ -/* gemm */ { { BLIS_SGEMM_UKERNEL_REF, BLIS_CGEMM_UKERNEL_REF, - BLIS_DGEMM_UKERNEL_REF, BLIS_ZGEMM_UKERNEL_REF, } }, -/* gemmtrsm_l */ { { BLIS_SGEMMTRSM_L_UKERNEL_REF, BLIS_CGEMMTRSM_L_UKERNEL_REF, - BLIS_DGEMMTRSM_L_UKERNEL_REF, BLIS_ZGEMMTRSM_L_UKERNEL_REF, } }, -/* gemmtrsm_u */ { { BLIS_SGEMMTRSM_U_UKERNEL_REF, BLIS_CGEMMTRSM_U_UKERNEL_REF, - BLIS_DGEMMTRSM_U_UKERNEL_REF, BLIS_ZGEMMTRSM_U_UKERNEL_REF, } }, -/* trsm_l */ { { BLIS_STRSM_L_UKERNEL_REF, BLIS_CTRSM_L_UKERNEL_REF, - BLIS_DTRSM_L_UKERNEL_REF, BLIS_ZTRSM_L_UKERNEL_REF, } }, -/* trsm_u */ { { BLIS_STRSM_U_UKERNEL_REF, BLIS_CTRSM_U_UKERNEL_REF, - BLIS_DTRSM_U_UKERNEL_REF, BLIS_ZTRSM_U_UKERNEL_REF, } }, -}; - -// ----------------------------------------------------------------------------- - -void bli_gks_get_l3_nat_ukr( l3ukr_t ukr, - func_t* func ) -{ - *func = bli_gks_l3_ind_ukrs[ BLIS_NAT ][ ukr ]; -} - -void bli_gks_get_l3_vir_ukr( ind_t method, - l3ukr_t ukr, - func_t* func ) -{ - *func = bli_gks_l3_ind_ukrs[ method ][ ukr ]; -} - -void bli_gks_get_l3_ref_ukr( l3ukr_t ukr, - func_t* func ) -{ - *func = bli_gks_l3_ref_ukrs[ ukr ]; -} - -void bli_gks_cntx_set_l3_nat_ukr( l3ukr_t ukr, - cntx_t* cntx ) -{ - func_t* cntx_l3_nat_ukrs = bli_cntx_l3_nat_ukrs_buf( cntx ); - func_t* cntx_l3_nat_ukr = &cntx_l3_nat_ukrs[ ukr ]; - - bli_gks_get_l3_nat_ukr( ukr, cntx_l3_nat_ukr ); -} - -void bli_gks_cntx_set_l3_nat_ukrs( dim_t n_uk, ... ) -{ - /* Example prototype: - - void - bli_gks_cntx_set_l3_nat_ukrs( dim_t n_uk, - l3ukr_t ukr0_id, - l3ukr_t ukr1_id, - l3ukr_t ukr2_id, - ... - cntx_t* cntx ); - */ - - va_list args; - dim_t i; - l3ukr_t* l3_ukrs; - cntx_t* cntx; - - // Allocate some temporary local arrays. - l3_ukrs = bli_malloc_intl( n_uk * sizeof( l3ukr_t ) ); - - // -- Begin variable argument section -- - - // Initialize variable argument environment. - va_start( args, n_uk ); - - // Process n_uk kernel ids. - for ( i = 0; i < n_uk; ++i ) - { - // Here, we query the variable argument list for the kernel id. - const l3ukr_t uk_id = va_arg( args, l3ukr_t ); - - // Store the value in our temporary array. - l3_ukrs[ i ] = uk_id; - } - - // The last argument should be the context pointer. - cntx = va_arg( args, cntx_t* ); - - // Shutdown variable argument environment and clean up stack. - va_end( args ); - - // -- End variable argument section -- - - // Process each kernel id provided. - for ( i = 0; i < n_uk; ++i ) - { - // Read the current kernel id. - const l3ukr_t uk_id = l3_ukrs[ i ]; - - // Query the func_t associated with uk_id and save it directly into - // the context. - bli_gks_cntx_set_l3_nat_ukr( uk_id, cntx ); - } - - // Free the temporary local array. - bli_free_intl( l3_ukrs ); -} - -void bli_gks_cntx_set_l3_vir_ukr( ind_t method, - l3ukr_t ukr, - cntx_t* cntx ) -{ - func_t* cntx_l3_vir_ukrs = bli_cntx_l3_vir_ukrs_buf( cntx ); - func_t* cntx_l3_vir_ukr = &cntx_l3_vir_ukrs[ ukr ]; - - bli_gks_get_l3_vir_ukr( method, ukr, cntx_l3_vir_ukr ); -} - -void bli_gks_cntx_set_l3_vir_ukrs( ind_t method, dim_t n_uk, ... ) -{ - /* Example prototype: - - void - bli_gks_cntx_set_l3_vir_ukrs( ind_t method, - dim_t n_uk, - l3ukr_t ukr0_id, - l3ukr_t ukr1_id, - l3ukr_t ukr2_id, - ... - cntx_t* cntx ); - */ - - va_list args; - dim_t i; - l3ukr_t* l3_ukrs; - cntx_t* cntx; - - // Allocate some temporary local arrays. - l3_ukrs = bli_malloc_intl( n_uk * sizeof( l3ukr_t ) ); - - // -- Begin variable argument section -- - - // Initialize variable argument environment. - va_start( args, n_uk ); - - // Process n_uk kernel ids. - for ( i = 0; i < n_uk; ++i ) - { - // Here, we query the variable argument list for the kernel id. - const l3ukr_t uk_id = va_arg( args, l3ukr_t ); - - // Store the value in our temporary array. - l3_ukrs[ i ] = uk_id; - } - - // The last argument should be the context pointer. - cntx = va_arg( args, cntx_t* ); - - // Shutdown variable argument environment and clean up stack. - va_end( args ); - - // -- End variable argument section -- - - // Process each kernel id provided. - for ( i = 0; i < n_uk; ++i ) - { - // Read the current kernel id. - const l3ukr_t uk_id = l3_ukrs[ i ]; - - // Query the func_t associated with uk_id and save it directly into - // the context. - bli_gks_cntx_set_l3_vir_ukr( method, uk_id, cntx ); - } - - // Free the temporary local array. - bli_free_intl( l3_ukrs ); -} - - -// -// -- level-3 micro-kernel preferences ----------------------------------------- -// - -static mbool_t bli_gks_l3_ukrs_prefs[BLIS_NUM_LEVEL3_UKRS] = -{ -/* gemm */ { { BLIS_SGEMM_UKERNEL_PREFERS_CONTIG_ROWS, - BLIS_CGEMM_UKERNEL_PREFERS_CONTIG_ROWS, - BLIS_DGEMM_UKERNEL_PREFERS_CONTIG_ROWS, - BLIS_ZGEMM_UKERNEL_PREFERS_CONTIG_ROWS, } }, -/* gemmtrsm_l */ { { FALSE, FALSE, FALSE, FALSE, } }, -/* gemmtrsm_u */ { { FALSE, FALSE, FALSE, FALSE, } }, -/* trsm_l */ { { FALSE, FALSE, FALSE, FALSE, } }, -/* trsm_u */ { { FALSE, FALSE, FALSE, FALSE, } }, -}; - -// ----------------------------------------------------------------------------- - -void bli_gks_get_l3_nat_ukr_prefs( l3ukr_t ukr, - mbool_t* mbool ) -{ - *mbool = bli_gks_l3_ukrs_prefs[ ukr ]; -} - -void bli_gks_cntx_set_l3_nat_ukr_prefs( l3ukr_t ukr, - cntx_t* cntx ) -{ - mbool_t* cntx_l3_nat_ukr_prefs = bli_cntx_l3_nat_ukrs_prefs_buf( cntx ); - mbool_t* cntx_l3_nat_ukr_pref = &cntx_l3_nat_ukr_prefs[ ukr ]; - - bli_gks_get_l3_nat_ukr_prefs( ukr, cntx_l3_nat_ukr_pref ); - - // Explicitly set the anti-preference to FALSE. - bli_cntx_set_anti_pref( FALSE, cntx ); -} - - -#if 0 -// -// -- packm structure-aware kernel structure ----------------------------------- -// - -// IF ENABLED: NEEDS UPDATING FOR 1M. - -static func_t bli_gks_packm_struc_kers[BLIS_NUM_PACK_SCHEMA_TYPES] = -{ - /* float (0) scomplex (1) double (2) dcomplex (3) */ -// row/col vectors - { NULL, NULL, - NULL, NULL, }, -// row/col panels - { bli_spackm_struc_cxk, bli_cpackm_struc_cxk, - bli_dpackm_struc_cxk, bli_zpackm_struc_cxk, }, -// row/col panels: 4m interleaved - { NULL, bli_cpackm_struc_cxk_4mi, - NULL, bli_zpackm_struc_cxk_4mi, }, -// row/col panels: 4m separated (NOT IMPLEMENTED) - { NULL, NULL, - NULL, NULL, }, -// row/col panels: 3m interleaved - { NULL, bli_cpackm_struc_cxk_3mis, - NULL, bli_zpackm_struc_cxk_3mis, }, -// row/col panels: 3m separated - { NULL, bli_cpackm_struc_cxk_3mis, - NULL, bli_zpackm_struc_cxk_3mis, }, -// row/col panels: real only - { NULL, bli_cpackm_struc_cxk_rih, - NULL, bli_zpackm_struc_cxk_rih, }, -// row/col panels: imaginary only - { NULL, bli_cpackm_struc_cxk_rih, - NULL, bli_zpackm_struc_cxk_rih, }, -// row/col panels: real+imaginary only - { NULL, bli_cpackm_struc_cxk_rih, - NULL, bli_zpackm_struc_cxk_rih, }, -}; - -// ----------------------------------------------------------------------------- - -void bli_gks_get_packm_struc_ker( pack_t schema, - func_t* func ) -{ - const dim_t i = bli_pack_schema_index( schema ); - - *func = bli_gks_packm_struc_kers[ i ]; -} - -void bli_gks_cntx_set_packm_struc_ker( pack_t schema, - cntx_t* cntx ) -{ - func_t* cntx_packm_ukr = bli_cntx_packm_ukrs( cntx ); - - bli_gks_get_packm_struc_kers( schema, cntx_packm_ukr ); -} +#ifdef BLIS_ENABLE_PTHREADS +pthread_mutex_t gks_mutex = PTHREAD_MUTEX_INITIALIZER; #endif - -// -// -- level-1f kernel structure ------------------------------------------------ -// - -static func_t bli_gks_l1f_kers[BLIS_NUM_LEVEL1F_KERS] = -{ - /* float (0) scomplex (1) double (2) dcomplex (3) */ -/* axpy2v */ { { BLIS_SAXPY2V_KERNEL, BLIS_CAXPY2V_KERNEL, - BLIS_DAXPY2V_KERNEL, BLIS_ZAXPY2V_KERNEL, } - }, -/* dotaxpyv */ { { BLIS_SDOTAXPYV_KERNEL, BLIS_CDOTAXPYV_KERNEL, - BLIS_DDOTAXPYV_KERNEL, BLIS_ZDOTAXPYV_KERNEL, } - }, -/* axpyf */ { { BLIS_SAXPYF_KERNEL, BLIS_CAXPYF_KERNEL, - BLIS_DAXPYF_KERNEL, BLIS_ZAXPYF_KERNEL, } - }, -/* dotxf */ { { BLIS_SDOTXF_KERNEL, BLIS_CDOTXF_KERNEL, - BLIS_DDOTXF_KERNEL, BLIS_ZDOTXF_KERNEL, } - }, -/* dotxaxpyf */ { { BLIS_SDOTXAXPYF_KERNEL, BLIS_CDOTXAXPYF_KERNEL, - BLIS_DDOTXAXPYF_KERNEL, BLIS_ZDOTXAXPYF_KERNEL, } - }, -}; - -static func_t bli_gks_l1f_ref_kers[BLIS_NUM_LEVEL1F_KERS] = -{ - /* float (0) scomplex (1) double (2) dcomplex (3) */ -/* axpy2v */ { { BLIS_SAXPY2V_KERNEL_REF, BLIS_CAXPY2V_KERNEL_REF, - BLIS_DAXPY2V_KERNEL_REF, BLIS_ZAXPY2V_KERNEL_REF, } - }, -/* dotaxpyv */ { { BLIS_SDOTAXPYV_KERNEL_REF, BLIS_CDOTAXPYV_KERNEL_REF, - BLIS_DDOTAXPYV_KERNEL_REF, BLIS_ZDOTAXPYV_KERNEL_REF, } - }, -/* axpyf */ { { BLIS_SAXPYF_KERNEL_REF, BLIS_CAXPYF_KERNEL_REF, - BLIS_DAXPYF_KERNEL_REF, BLIS_ZAXPYF_KERNEL_REF, } - }, -/* dotxf */ { { BLIS_SDOTXF_KERNEL_REF, BLIS_CDOTXF_KERNEL_REF, - BLIS_DDOTXF_KERNEL_REF, BLIS_ZDOTXF_KERNEL_REF, } - }, -/* dotxaxpyf */ { { BLIS_SDOTXAXPYF_KERNEL_REF, BLIS_CDOTXAXPYF_KERNEL_REF, - BLIS_DDOTXAXPYF_KERNEL_REF, BLIS_ZDOTXAXPYF_KERNEL_REF, } - }, -}; +// Define a function pointer type for context initialization functions. +typedef void (*nat_cntx_init_ft)( cntx_t* cntx ); +typedef void (*ref_cntx_init_ft)( cntx_t* cntx ); +typedef void (*ind_cntx_init_ft)( ind_t method, num_t dt, cntx_t* cntx ); // ----------------------------------------------------------------------------- -void bli_gks_get_l1f_ker( l1fkr_t ker, - func_t* func ) +void bli_gks_init( void ) { - *func = bli_gks_l1f_kers[ ker ]; -} - -void bli_gks_get_l1f_ref_ker( l1fkr_t ker, - func_t* func ) -{ - *func = bli_gks_l1f_ref_kers[ ker ]; -} - -void bli_gks_cntx_set_l1f_ker( l1fkr_t ker, - cntx_t* cntx ) -{ - func_t* cntx_l1f_kers = bli_cntx_l1f_kers_buf( cntx ); - func_t* cntx_l1f_ker = &cntx_l1f_kers[ ker ]; - - bli_gks_get_l1f_ker( ker, cntx_l1f_ker ); -} - -void bli_gks_cntx_set_l1f_kers( dim_t n_kr, ... ) -{ - /* Example prototype: - - void - bli_gks_cntx_set_l1f_kers( dim_t n_kr, - l1fkr_t ker0_id, - l1fkr_t ker1_id, - l1fkr_t ker2_id, - ... - cntx_t* cntx ); - */ - - va_list args; - dim_t i; - l1fkr_t* l1f_kers; - cntx_t* cntx; - - // Allocate some temporary local arrays. - l1f_kers = bli_malloc_intl( n_kr * sizeof( l1fkr_t ) ); - - // -- Begin variable argument section -- - - // Initialize variable argument environment. - va_start( args, n_kr ); - - // Process n_kr kernel ids. - for ( i = 0; i < n_kr; ++i ) + // BEGIN CRITICAL SECTION + // NOTE: This critical section is implicit. We assume this function is only + // called from within the critical section within bli_init(). { - // Here, we query the variable argument list for the kernel id. - const l1fkr_t kr_id = va_arg( args, l1fkr_t ); + // Initialize the internal data structure we use to track registered + // contexts. + bli_gks_init_index(); - // Store the value in our temporary array. - l1f_kers[ i ] = kr_id; + // Register a context for each architecture that was #define'd in + // bli_config.h. + + // Intel architectures +#ifdef BLIS_CONFIG_KNL + bli_gks_register_cntx( BLIS_ARCH_KNL, bli_cntx_init_knl, + bli_cntx_init_knl_ref, + bli_cntx_init_knl_ind ); +#endif +#ifdef BLIS_CONFIG_KNC + bli_gks_register_cntx( BLIS_ARCH_KNC, bli_cntx_init_knc, + bli_cntx_init_knc_ref, + bli_cntx_init_knc_ind ); +#endif +#ifdef BLIS_CONFIG_HASWELL + bli_gks_register_cntx( BLIS_ARCH_HASWELL, bli_cntx_init_haswell, + bli_cntx_init_haswell_ref, + bli_cntx_init_haswell_ind ); +#endif +#ifdef BLIS_CONFIG_SANDYBRIDGE + bli_gks_register_cntx( BLIS_ARCH_SANDYBRIDGE, bli_cntx_init_sandybridge, + bli_cntx_init_sandybridge_ref, + bli_cntx_init_sandybridge_ind ); +#endif +#ifdef BLIS_CONFIG_PENRYN + bli_gks_register_cntx( BLIS_ARCH_PENRYN, bli_cntx_init_penryn, + bli_cntx_init_penryn_ref, + bli_cntx_init_penryn_ind ); +#endif + + // AMD architectures +#ifdef BLIS_CONFIG_ZEN + bli_gks_register_cntx( BLIS_ARCH_ZEN, bli_cntx_init_zen, + bli_cntx_init_zen_ref, + bli_cntx_init_zen_ind ); +#endif +#ifdef BLIS_CONFIG_EXCAVATOR + bli_gks_register_cntx( BLIS_ARCH_EXCAVATOR, bli_cntx_init_excavator, + bli_cntx_init_excavator_ref, + bli_cntx_init_excavator_ind ); +#endif +#ifdef BLIS_CONFIG_STEAMROLLER + bli_gks_register_cntx( BLIS_ARCH_STEAMROLLER, bli_cntx_init_steamroller, + bli_cntx_init_steamroller_ref, + bli_cntx_init_steamroller_ind ); +#endif +#ifdef BLIS_CONFIG_PILEDRIVER + bli_gks_register_cntx( BLIS_ARCH_PILEDRIVER, bli_cntx_init_piledriver, + bli_cntx_init_piledriver_ref, + bli_cntx_init_piledriver_ind ); +#endif +#ifdef BLIS_CONFIG_BULLDOZER + bli_gks_register_cntx( BLIS_ARCH_BULLDOZER, bli_cntx_init_bulldozer, + bli_cntx_init_bulldozer_ref, + bli_cntx_init_bulldozer_ind ); +#endif + + // ARM architectures +#ifdef BLIS_CONFIG_CORTEXA57 + bli_gks_register_cntx( BLIS_ARCH_CORTEXA57, bli_cntx_init_cortexa57, + bli_cntx_init_cortexa57_ref, + bli_cntx_init_cortexa57_ind ); +#endif +#ifdef BLIS_CONFIG_CORTEXA15 + bli_gks_register_cntx( BLIS_ARCH_CORTEXA15, bli_cntx_init_cortexa15, + bli_cntx_init_cortexa15_ref, + bli_cntx_init_cortexa15_ind ); +#endif +#ifdef BLIS_CONFIG_CORTEXA9 + bli_gks_register_cntx( BLIS_ARCH_CORTEXA9, bli_cntx_init_cortexa9, + bli_cntx_init_cortexa9_ref, + bli_cntx_init_cortexa9_ind ); +#endif + + // IBM architectures +#ifdef BLIS_CONFIG_POWER7 + bli_gks_register_cntx( BLIS_ARCH_POWER7, bli_cntx_init_power7, + bli_cntx_init_power7_ref, + bli_cntx_init_power7_ind ); +#endif +#ifdef BLIS_CONFIG_BGQ + bli_gks_register_cntx( BLIS_ARCH_BGQ, bli_cntx_init_bgq, + bli_cntx_init_bgq_ref, + bli_cntx_init_bgq_ind ); +#endif + + // Generic architectures +#ifdef BLIS_CONFIG_GENERIC + bli_gks_register_cntx( BLIS_ARCH_GENERIC, bli_cntx_init_generic, + bli_cntx_init_generic_ref, + bli_cntx_init_generic_ind ); +#endif } - - // The last argument should be the context pointer. - cntx = va_arg( args, cntx_t* ); - - // Shutdown variable argument environment and clean up stack. - va_end( args ); - - // -- End variable argument section -- - - // Process each kernel id provided. - for ( i = 0; i < n_kr; ++i ) - { - // Read the current kernel id. - const l1fkr_t kr_id = l1f_kers[ i ]; - - // Query the func_t associated with kr_id and save it directly into - // the context. - bli_gks_cntx_set_l1f_ker( kr_id, cntx ); - } - - // Free the temporary local array. - bli_free_intl( l1f_kers ); + // END CRITICAL SECTION } - -// -// -- level-1v kernel structure ------------------------------------------------ -// - -static func_t bli_gks_l1v_kers[BLIS_NUM_LEVEL1V_KERS] = -{ - /* float (0) scomplex (1) double (2) dcomplex (3) */ -/* addv */ { { BLIS_SADDV_KERNEL, BLIS_CADDV_KERNEL, - BLIS_DADDV_KERNEL, BLIS_ZADDV_KERNEL, } - }, -/* amaxv */ { { BLIS_SAMAXV_KERNEL, BLIS_CAMAXV_KERNEL, - BLIS_DAMAXV_KERNEL, BLIS_ZAMAXV_KERNEL, } - }, -/* axpbyv */ { { BLIS_SAXPBYV_KERNEL, BLIS_CAXPBYV_KERNEL, - BLIS_DAXPBYV_KERNEL, BLIS_ZAXPBYV_KERNEL, } - }, -/* axpyv */ { { BLIS_SAXPYV_KERNEL, BLIS_CAXPYV_KERNEL, - BLIS_DAXPYV_KERNEL, BLIS_ZAXPYV_KERNEL, } - }, -/* copyv */ { { BLIS_SCOPYV_KERNEL, BLIS_CCOPYV_KERNEL, - BLIS_DCOPYV_KERNEL, BLIS_ZCOPYV_KERNEL, } - }, -/* dotv */ { { BLIS_SDOTV_KERNEL, BLIS_CDOTV_KERNEL, - BLIS_DDOTV_KERNEL, BLIS_ZDOTV_KERNEL, } - }, -/* dotxv */ { { BLIS_SDOTXV_KERNEL, BLIS_CDOTXV_KERNEL, - BLIS_DDOTXV_KERNEL, BLIS_ZDOTXV_KERNEL, } - }, -/* invertv */ { { BLIS_SINVERTV_KERNEL, BLIS_CINVERTV_KERNEL, - BLIS_DINVERTV_KERNEL, BLIS_ZINVERTV_KERNEL, } - }, -/* scalv */ { { BLIS_SSCALV_KERNEL, BLIS_CSCALV_KERNEL, - BLIS_DSCALV_KERNEL, BLIS_ZSCALV_KERNEL, } - }, -/* scal2v */ { { BLIS_SSCAL2V_KERNEL, BLIS_CSCAL2V_KERNEL, - BLIS_DSCAL2V_KERNEL, BLIS_ZSCAL2V_KERNEL, } - }, -/* setv */ { { BLIS_SSETV_KERNEL, BLIS_CSETV_KERNEL, - BLIS_DSETV_KERNEL, BLIS_ZSETV_KERNEL, } - }, -/* subv */ { { BLIS_SSUBV_KERNEL, BLIS_CSUBV_KERNEL, - BLIS_DSUBV_KERNEL, BLIS_ZSUBV_KERNEL, } - }, -/* swapv */ { { BLIS_SSWAPV_KERNEL, BLIS_CSWAPV_KERNEL, - BLIS_DSWAPV_KERNEL, BLIS_ZSWAPV_KERNEL, } - }, -/* xpbyv */ { { BLIS_SXPBYV_KERNEL, BLIS_CXPBYV_KERNEL, - BLIS_DXPBYV_KERNEL, BLIS_ZXPBYV_KERNEL, } - }, -}; - -static func_t bli_gks_l1v_ref_kers[BLIS_NUM_LEVEL1V_KERS] = -{ - /* float (0) scomplex (1) double (2) dcomplex (3) */ -/* addv */ { { BLIS_SADDV_KERNEL_REF, BLIS_CADDV_KERNEL_REF, - BLIS_DADDV_KERNEL_REF, BLIS_ZADDV_KERNEL_REF, } - }, -/* amaxv */ { { BLIS_SAMAXV_KERNEL_REF, BLIS_CAMAXV_KERNEL_REF, - BLIS_DAMAXV_KERNEL_REF, BLIS_ZAMAXV_KERNEL_REF, } - }, -/* axpbyv */ { { BLIS_SAXPBYV_KERNEL_REF, BLIS_CAXPBYV_KERNEL_REF, - BLIS_DAXPBYV_KERNEL_REF, BLIS_ZAXPBYV_KERNEL_REF, } - }, -/* axpyv */ { { BLIS_SAXPYV_KERNEL_REF, BLIS_CAXPYV_KERNEL_REF, - BLIS_DAXPYV_KERNEL_REF, BLIS_ZAXPYV_KERNEL_REF, } - }, -/* copyv */ { { BLIS_SCOPYV_KERNEL_REF, BLIS_CCOPYV_KERNEL_REF, - BLIS_DCOPYV_KERNEL_REF, BLIS_ZCOPYV_KERNEL_REF, } - }, -/* dotv */ { { BLIS_SDOTV_KERNEL_REF, BLIS_CDOTV_KERNEL_REF, - BLIS_DDOTV_KERNEL_REF, BLIS_ZDOTV_KERNEL_REF, } - }, -/* dotxv */ { { BLIS_SDOTXV_KERNEL_REF, BLIS_CDOTXV_KERNEL_REF, - BLIS_DDOTXV_KERNEL_REF, BLIS_ZDOTXV_KERNEL_REF, } - }, -/* invertv */ { { BLIS_SINVERTV_KERNEL_REF, BLIS_CINVERTV_KERNEL_REF, - BLIS_DINVERTV_KERNEL_REF, BLIS_ZINVERTV_KERNEL_REF, } - }, -/* scalv */ { { BLIS_SSCALV_KERNEL_REF, BLIS_CSCALV_KERNEL_REF, - BLIS_DSCALV_KERNEL_REF, BLIS_ZSCALV_KERNEL_REF, } - }, -/* scal2v */ { { BLIS_SSCAL2V_KERNEL_REF, BLIS_CSCAL2V_KERNEL_REF, - BLIS_DSCAL2V_KERNEL_REF, BLIS_ZSCAL2V_KERNEL_REF, } - }, -/* setv */ { { BLIS_SSETV_KERNEL_REF, BLIS_CSETV_KERNEL_REF, - BLIS_DSETV_KERNEL_REF, BLIS_ZSETV_KERNEL_REF, } - }, -/* subv */ { { BLIS_SSUBV_KERNEL_REF, BLIS_CSUBV_KERNEL_REF, - BLIS_DSUBV_KERNEL_REF, BLIS_ZSUBV_KERNEL_REF, } - }, -/* swapv */ { { BLIS_SSWAPV_KERNEL_REF, BLIS_CSWAPV_KERNEL_REF, - BLIS_DSWAPV_KERNEL_REF, BLIS_ZSWAPV_KERNEL_REF, } - }, -/* xpbyv */ { { BLIS_SXPBYV_KERNEL_REF, BLIS_CXPBYV_KERNEL_REF, - BLIS_DXPBYV_KERNEL_REF, BLIS_ZXPBYV_KERNEL_REF, } - }, -}; - // ----------------------------------------------------------------------------- -void bli_gks_get_l1v_ker( l1vkr_t ker, - func_t* func ) +void bli_gks_finalize( void ) { - *func = bli_gks_l1v_kers[ ker ]; -} + arch_t id; + ind_t ind; -void bli_gks_get_l1v_ref_ker( l1vkr_t ker, - func_t* func ) -{ - *func = bli_gks_l1v_ref_kers[ ker ]; -} - -void bli_gks_cntx_set_l1v_ker( l1vkr_t ker, - cntx_t* cntx ) -{ - func_t* cntx_l1v_kers = bli_cntx_l1v_kers_buf( cntx ); - func_t* cntx_l1v_ker = &cntx_l1v_kers[ ker ]; - - bli_gks_get_l1v_ker( ker, cntx_l1v_ker ); -} - - -void bli_gks_cntx_set_l1v_kers( dim_t n_kr, ... ) -{ - /* Example prototype: - - void - bli_gks_cntx_set_l1v_kers( dim_t n_kr, - l1vkr_t ker0_id, - l1vkr_t ker1_id, - l1vkr_t ker2_id, - ... - cntx_t* cntx ); - */ - - va_list args; - dim_t i; - l1vkr_t* l1v_kers; - cntx_t* cntx; - - // Allocate some temporary local arrays. - l1v_kers = bli_malloc_intl( n_kr * sizeof( l1vkr_t ) ); - - // -- Begin variable argument section -- - - // Initialize variable argument environment. - va_start( args, n_kr ); - - // Process n_kr kernel ids. - for ( i = 0; i < n_kr; ++i ) + // BEGIN CRITICAL SECTION + // NOTE: This critical section is implicit. We assume this function is only + // called from within the critical section within bli_finalize(). { - // Here, we query the variable argument list for the kernel id. - const l1vkr_t kr_id = va_arg( args, l1vkr_t ); - // Store the value in our temporary array. - l1v_kers[ i ] = kr_id; + // Iterate over the architectures in the gks array. + for ( id = 0; id < BLIS_NUM_ARCHS; ++id ) + { + cntx_t** restrict gks_id = gks[ id ]; + + // Only consider context arrays for architectures that were allocated + // in the first place. + if ( gks_id != NULL ) + { + // Iterate over the induced methods in the current sub-array + // referenced by cntx_pp. + for ( ind = 0; ind < BLIS_NUM_IND_METHODS; ++ind ) + { + cntx_t* restrict gks_id_ind = gks_id[ ind ]; + + // If the current context was allocated, free it. + if ( gks_id_ind != NULL ) + { + bli_free_intl( gks_id_ind ); + } + } + } + } + + } + // END CRITICAL SECTION +} + +// ----------------------------------------------------------------------------- + +void bli_gks_init_index( void ) +{ + // This function is called by bli_gks_init(). It simply initializes all + // architecture id elements of the internal arrays to NULL. + + const size_t gks_size = sizeof( cntx_t* ) * BLIS_NUM_ARCHS; + const size_t fpa_size = sizeof( void* ) * BLIS_NUM_ARCHS; + + // Set every entry in gks and context init function pointer arrays to + // zero/NULL. This is done so that later on we know which ones were + // allocated. + memset( gks, 0, gks_size ); + memset( cntx_ref_init, 0, fpa_size ); + memset( cntx_ind_init, 0, fpa_size ); +} + +// ----------------------------------------------------------------------------- + +cntx_t* bli_gks_lookup_nat_cntx + ( + arch_t id + ) +{ + // Return the address of the (native) context for a given architecture id. + // This function assumes the architecture has already been registered. + + return bli_gks_lookup_ind_cntx( id, BLIS_NAT ); +} + +// ----------------------------------------------------------------------------- + +cntx_t* bli_gks_lookup_ind_cntx + ( + arch_t id, + ind_t ind + ) +{ + // Return the address of the context for a given architecture id and + // induced method. This function assumes the architecture has already + // been registered. Note that this function returns NULL if the induced + // method hasn't yet been called (and thus its context pointer is still + // NULL). + + if ( bli_error_checking_is_enabled() ) + { + err_t e_val; + + // Confirm that the architecture id is valid. + e_val = bli_check_valid_arch_id( id ); + bli_check_error_code( e_val ); } - // The last argument should be the context pointer. - cntx = va_arg( args, cntx_t* ); + // Index into the array of context pointers for the given architecture id, + // and then index into the subarray for the given induced method. + cntx_t** restrict gks_id = gks[ id ]; + cntx_t* restrict gks_id_ind = gks_id[ ind ]; - // Shutdown variable argument environment and clean up stack. - va_end( args ); - - // -- End variable argument section -- - - // Process each kernel id provided. - for ( i = 0; i < n_kr; ++i ) - { - // Read the current kernel id. - const l1vkr_t kr_id = l1v_kers[ i ]; - - // Query the func_t associated with kr_id and save it directly into - // the context. - bli_gks_cntx_set_l1v_ker( kr_id, cntx ); - } - - // Free the temporary local array. - bli_free_intl( l1v_kers ); + // Return the context pointer at gks_id_ind. + return gks_id_ind; } +// ----------------------------------------------------------------------------- + +void bli_gks_register_cntx + ( + arch_t id, + void* nat_fp, + void* ref_fp, + void* ind_fp + ) +{ + // This function is called by bli_gks_init() for each architecture that + // will be supported by BLIS. It takes an architecture id and three + // function pointers, one to a function that initializes a native context + // (supplied by the kernel developer), one to a function that initializes + // a reference context (with function pointers specific to the architecture + // associated with id), and one to a function that initializes a + // context for use with induced methods (again, with function pointers + // to the architecture). The latter two functions are automatically + // generated by the framework. Unlike with native contexts, we don't + // actually store the induced contexts until that induced method is + // called, and we don't ever store reference contexts. For this reason, we + // can get away with only storing the pointers to the initialization + // functions for those latter two types of contexts, which we can then + // call at a later time when those contexts are needed. + + nat_cntx_init_ft f = nat_fp; + + // First, store the function pointers to the context initialization + // functions for reference kernels and induced method execution. The + // former will be used whenever we need to obtain reference kernels and + // latter will be used later on if the user calls a level-3 function + // with induced execution enabled. + cntx_ref_init[ id ] = ref_fp; + cntx_ind_init[ id ] = ind_fp; + + // If the the context array pointer isn't NULL, then it means the given + // architecture id has already registered (and the underlying memory + // allocations and context initializations have already been performed). + // This is really just a safety feature to prevent memory leaks; this + // early return should never occur, because the caller should never try + // to register with an architecture id that has already been registered. + if ( gks[ id ] != NULL ) return; + + // At this point, we know the pointer to the array of cntx_t* is NULL and + // needs to be allocated. Allocate the memory and initialize it to + // zeros/NULL, storing the address of the alloacted memory at the element + // for the current architecture id. + gks[ id ] = bli_calloc_intl( sizeof( cntx_t* ) * BLIS_NUM_IND_METHODS ); + + // Alias the allocated array for readability. + cntx_t** restrict gks_id = gks[ id ]; + + // Allocate memory for a single context and store the address at + // the element in the gks[ id ] array that is reserved for native + // execution. + gks_id[ BLIS_NAT ] = bli_calloc_intl( sizeof( cntx_t ) ); + + // Alias the allocated context address for readability. + cntx_t* restrict gks_id_nat = gks_id[ BLIS_NAT ]; + + // Call the context initialization function on the element of the newly + // allocated array corresponding to native execution. + f( gks_id_nat ); + + // Verify that cache blocksizes are whole multiples of register blocksizes. + // Specifically, verify that: + // - MC is a whole multiple of MR. + // - NC is a whole multiple of NR. + // - KC is a whole multiple of KR. + // These constraints are enforced because it makes it easier to handle diagonals + // in the macro-kernel implementations. Additionally, we optionally verify that: + // - MC is a whole multiple of NR. + // - NC is a whole multiple of MR. + // These latter constraints, guarded by #ifndef BLIS_RELAX_MCNR_NCMR_CONSTRAINTS + // below, are only enforced when we wish to be able to handle the trsm right- + // side case handling that swaps A and B, so that B is the triangular matrix, + // with NR blocking used to pack A and MR blocking used to pack B, with the + // arguments to the gemmtrsm microkernel swapped at the last minute, as the + // kernel is called. + err_t e_val; + + blksz_t* restrict mc = bli_cntx_get_blksz( BLIS_MC, gks_id_nat ); + blksz_t* restrict nc = bli_cntx_get_blksz( BLIS_NC, gks_id_nat ); + blksz_t* restrict kc = bli_cntx_get_blksz( BLIS_KC, gks_id_nat ); + blksz_t* restrict mr = bli_cntx_get_blksz( BLIS_MR, gks_id_nat ); + blksz_t* restrict nr = bli_cntx_get_blksz( BLIS_NR, gks_id_nat ); + blksz_t* restrict kr = bli_cntx_get_blksz( BLIS_KR, gks_id_nat ); + + e_val = bli_check_valid_mc_mod_mult( mc, mr ); bli_check_error_code( e_val ); + e_val = bli_check_valid_nc_mod_mult( nc, nr ); bli_check_error_code( e_val ); + e_val = bli_check_valid_kc_mod_mult( kc, kr ); bli_check_error_code( e_val ); +#ifndef BLIS_RELAX_MCNR_NCMR_CONSTRAINTS + e_val = bli_check_valid_mc_mod_mult( mc, nr ); bli_check_error_code( e_val ); + e_val = bli_check_valid_nc_mod_mult( nc, mr ); bli_check_error_code( e_val ); +#endif +} + +// ----------------------------------------------------------------------------- + +cntx_t* bli_gks_query_cntx( void ) +{ + return bli_gks_query_nat_cntx(); +} + +// ----------------------------------------------------------------------------- + +cntx_t* bli_gks_query_nat_cntx( void ) +{ + // Return the address of the native context for the architecture id + // corresponding to the current hardware, as determined by + // bli_arch_query_id(). + + // Query the architecture id. + arch_t id = bli_arch_query_id(); + + // Use the architecture id to look up a pointer to its context. + cntx_t* cntx = bli_gks_lookup_nat_cntx( id ); + + return cntx; +} + +// ----------------------------------------------------------------------------- + +cntx_t* bli_gks_query_ind_cntx + ( + ind_t ind, + num_t dt + ) +{ + cntx_t* gks_id_ind; + + // Return the address of a context that will be suited for executing a + // level-3 operation via the requested induced method (and datatype) for + // the architecture id corresponding to the current hardware, as + // determined by bli_arch_query_id(). + + // This function is called when a level-3 operation via induced method is + // called, e.g. bli_gemm1m(). If this is the first time that induced method + // is being executed since bli_gks_init(), the necessary context structure + // is allocated and initialized. If this is not the first time, then the + // address of a previously-allocated and initialized (cached) context is + // returned. Note that much of this must be done with mutual exclusion to + // ensure thread safety and deterministic behavior. + + // Query the architecture id. + arch_t id = bli_arch_query_id(); + + // NOTE: These initial statements can reside outside of the critical section + // because gks[ id ] should have already been allocated, and the native + // context in that array should have already been allocated/initialized. + + // Query the gks for the array of context pointers corresponding to the + // given architecture id. + cntx_t** restrict gks_id = gks[ id ]; + cntx_t* restrict gks_id_nat = gks_id[ BLIS_NAT ]; + + // If for some reason the native context was requested, we can return + // its address early. + if ( ind == BLIS_NAT ) return gks_id_nat; + + // This function assumes that the architecture idenified by id has + // already been registered with the gks (which guarantees that + // gks[ id ] is non-NULL and gks[ id ][ BLIS_NAT ] is also non-NULL + // and refers to a context initialized with valid data). + +#ifdef BLIS_ENABLE_OPENMP + _Pragma( "omp critical (gks)" ) +#endif +#ifdef BLIS_ENABLE_PTHREADS + pthread_mutex_lock( &gks_mutex ); +#endif + + // BEGIN CRITICAL SECTION + { + // Alias for readability the element of gks_id associated with the + // requested induced method. + gks_id_ind = gks_id[ ind ]; + + // If the context pointer is NULL, then we know we must allocate and + // then initialize the context before returning its address. + if ( gks_id_ind == NULL ) + { + // If gks_id_ind is NULL, then we know we must allocate and then + // initialize the context, storing its address back to + // gks_id[ ind ]. + gks_id_ind = bli_calloc_intl( sizeof( cntx_t ) ); + gks_id[ ind ] = gks_id_ind; + + // Before we can call the induced method context initialization + // function on the newly allocated structure, we must first copy + // over the contents of the native context. + *gks_id_ind = *gks_id_nat; + + // Use the architecture id to look up the function pointer to the + // context initialization function for induced methods. + ind_cntx_init_ft f = cntx_ind_init[ id ]; + + // Now we modify the context (so that it contains the proper values + // for its induced method) by calling the context initialization + // function for the current induced method. (That function assumes + // that the context is pre- initialized with values for native + // execution.) + f( ind, dt, gks_id_ind ); + } + } + // END CRITICAL SECTION + +#ifdef BLIS_ENABLE_PTHREADS + pthread_mutex_unlock( &gks_mutex ); +#endif + + // Return the address of the newly-allocated/initialized context. + return gks_id_ind; + +} + +// ----------------------------------------------------------------------------- + +void bli_gks_init_ref_cntx + ( + cntx_t* cntx + ) +{ + // Query the architecture id. + arch_t id = bli_arch_query_id(); + + // Obtain the function pointer to the context initialization function for + // reference kernels. + ref_cntx_init_ft f = cntx_ref_init[ id ]; + + // Initialize the caller's context with reference kernels and related values. + f( cntx ); +} + +// ----------------------------------------------------------------------------- + +bool_t bli_gks_cntx_l3_nat_ukr_is_ref + ( + num_t dt, + l3ukr_t ukr_id, + cntx_t* cntx + ) +{ + cntx_t ref_cntx; + + // Initialize a context with reference kernels for the arch_t id queried + // via bli_arch_query_id(). + bli_gks_init_ref_cntx( &ref_cntx ); + + // Query each context for the micro-kernel function pointer for the + // specified datatype. + void* ref_fp = bli_cntx_get_l3_nat_ukr_dt( dt, ukr_id, &ref_cntx ); + void* fp = bli_cntx_get_l3_nat_ukr_dt( dt, ukr_id, cntx ); + + // Return the result. + return fp == ref_fp; +} // // -- level-3 micro-kernel implementation strings ------------------------------ @@ -990,17 +540,19 @@ static char* bli_gks_l3_ukr_impl_str[BLIS_NUM_UKR_IMPL_TYPES] = char* bli_gks_l3_ukr_impl_string( l3ukr_t ukr, ind_t method, num_t dt ) { - func_t p; kimpl_t ki; - // Query the func_t for the given ukr type and method. - bli_gks_get_l3_vir_ukr( method, ukr, &p ); + // Query the context for the current induced method and datatype, and + // then query the ukernel function pointer for the given datatype from + // that context. + cntx_t* cntx = bli_gks_query_ind_cntx( method, dt ); + void* fp = bli_cntx_get_l3_ukr_dt( dt, ukr, cntx ); - // Check whether the ukrs func_t is NULL for the given ukr type and - // datatype. If the queried ukr func_t is NULL, return the string - // for not applicable. Otherwise, query the ukernel implementation - // type using the method provided and return the associated string. - if ( bli_func_is_null_dt( dt, &p ) ) + // Check whether the ukernel function pointer is NULL for the given + // datatype. If it is NULL, return the string for not applicable. + // Otherwise, query the ukernel implementation type using the method + // provided and return the associated string. + if ( fp == NULL ) ki = BLIS_NOTAPPLIC_UKERNEL; else ki = bli_gks_l3_ukr_impl_type( ukr, method, dt ); @@ -1049,19 +601,28 @@ kimpl_t bli_gks_l3_ukr_impl_type( l3ukr_t ukr, ind_t method, num_t dt ) // method to the typed function pointer within the known // reference ukrs object. - func_t funcs; - func_t ref_funcs; - void* p; - void* ref_p; + cntx_t ref_cntx_l; - bli_gks_get_l3_vir_ukr( method, ukr, &funcs ); - bli_gks_get_l3_ref_ukr( ukr, &ref_funcs ); + // Query the architecture id. + arch_t id = bli_arch_query_id(); - p = bli_func_get_dt( dt, &funcs ); - ref_p = bli_func_get_dt( dt, &ref_funcs ); - - if ( p == ref_p ) return BLIS_REFERENCE_UKERNEL; - else return BLIS_OPTIMIZED_UKERNEL; + // Obtain the function pointer to the context initialization function + // for reference kernels. + ref_cntx_init_ft f = cntx_ref_init[ id ]; + + // Initialize a local context with reference kernels and related values. + f( &ref_cntx_l ); + + // Query the native context from the gks. + cntx_t* nat_cntx = bli_gks_lookup_nat_cntx( id ); + + // Query the native ukernel func_t from both the native and reference + // contexts. + void* nat_fp = bli_cntx_get_l3_nat_ukr_dt( dt, ukr, nat_cntx ); + void* ref_fp = bli_cntx_get_l3_nat_ukr_dt( dt, ukr, &ref_cntx_l ); + + if ( nat_fp == ref_fp ) return BLIS_REFERENCE_UKERNEL; + else return BLIS_OPTIMIZED_UKERNEL; } } diff --git a/frame/base/bli_gks.h b/frame/base/bli_gks.h index a889497be..f05302950 100644 --- a/frame/base/bli_gks.h +++ b/frame/base/bli_gks.h @@ -35,9 +35,35 @@ #ifndef BLIS_GKS_H #define BLIS_GKS_H +arch_t bli_arch_query_id( void ); // ----------------------------------------------------------------------------- +void bli_gks_init( void ); +void bli_gks_finalize( void ); + +void bli_gks_init_index( void ); + +cntx_t* bli_gks_lookup_nat_cntx( arch_t id ); +cntx_t* bli_gks_lookup_ind_cntx( arch_t id, ind_t ind ); +void bli_gks_register_cntx( arch_t id, void* nat_fp, void* ref_fp, void* ind_fp ); + +cntx_t* bli_gks_query_cntx( void ); +cntx_t* bli_gks_query_nat_cntx( void ); +cntx_t* bli_gks_query_ind_cntx( ind_t ind, num_t dt ); + +void bli_gks_init_ref_cntx( cntx_t* cntx ); + +bool_t bli_gks_cntx_l3_nat_ukr_is_ref( num_t dt, l3ukr_t ukr_id, cntx_t* cntx ); + +char* bli_gks_l3_ukr_impl_string( l3ukr_t ukr, ind_t method, num_t dt ); +kimpl_t bli_gks_l3_ukr_impl_type( l3ukr_t ukr, ind_t method, num_t dt ); + +//char* bli_gks_l3_ukr_avail_impl_string( l3ukr_t ukr, num_t dt ); + +#if 0 +// ----------------------------------------------------------------------------- + void bli_gks_get_blksz( bszid_t bs_id, blksz_t* blksz ); @@ -70,6 +96,28 @@ void bli_gks_cntx_set_l3_nat_ukr_prefs( l3ukr_t ukr, // ----------------------------------------------------------------------------- +void bli_gks_get_packm_ker( l1mkr_t ker, + func_t* func ); +void bli_gks_get_packm_ref_ker( l1mkr_t ker, + func_t* func ); +void bli_gks_cntx_set_packm_ker( l1mkr_t ker, + cntx_t* cntx ); + +void bli_gks_cntx_set_packm_kers( dim_t n_kr, ... ); + +// ----------------------------------------------------------------------------- + +void bli_gks_get_unpackm_ker( l1mkr_t ker, + func_t* func ); +void bli_gks_get_unpackm_ref_ker( l1mkr_t ker, + func_t* func ); +void bli_gks_cntx_set_unpackm_ker( l1mkr_t ker, + cntx_t* cntx ); + +void bli_gks_cntx_set_unpackm_kers( dim_t n_kr, ... ); + +// ----------------------------------------------------------------------------- + void bli_gks_get_l1f_ker( l1fkr_t ker, func_t* func ); void bli_gks_get_l1f_ref_ker( l1fkr_t ker, @@ -89,13 +137,10 @@ void bli_gks_cntx_set_l1v_ker( l1vkr_t ker, cntx_t* cntx ); void bli_gks_cntx_set_l1v_kers( dim_t n_kr, ... ); +#endif // ----------------------------------------------------------------------------- -char* bli_gks_l3_ukr_impl_string( l3ukr_t ukr, ind_t method, num_t dt ); -kimpl_t bli_gks_l3_ukr_impl_type( l3ukr_t ukr, ind_t method, num_t dt ); - -// ----------------------------------------------------------------------------- #endif diff --git a/frame/base/bli_init.c b/frame/base/bli_init.c index 3a9fb55e9..f82118db6 100644 --- a/frame/base/bli_init.c +++ b/frame/base/bli_init.c @@ -35,7 +35,7 @@ #include "blis.h" #ifdef BLIS_ENABLE_PTHREADS -static pthread_mutex_t initialize_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER; #endif static bool_t bli_is_init = FALSE; @@ -67,7 +67,7 @@ err_t bli_init( void ) _Pragma( "omp critical (init)" ) #endif #ifdef BLIS_ENABLE_PTHREADS - pthread_mutex_lock( &initialize_mutex ); + pthread_mutex_lock( &init_mutex ); #endif // BEGIN CRITICAL SECTION @@ -84,9 +84,10 @@ err_t bli_init( void ) // Initialize various sub-APIs. bli_const_init(); bli_error_init(); - bli_memsys_init(); + bli_gks_init(); bli_ind_init(); bli_thread_init(); + bli_memsys_init(); // After initialization is complete, mark BLIS as initialized. bli_is_init = TRUE; @@ -99,7 +100,7 @@ err_t bli_init( void ) // END CRITICAL SECTION #ifdef BLIS_ENABLE_PTHREADS - pthread_mutex_unlock( &initialize_mutex ); + pthread_mutex_unlock( &init_mutex ); #endif return r_val; @@ -131,7 +132,7 @@ err_t bli_finalize( void ) _Pragma( "omp critical (init)" ) #endif #ifdef BLIS_ENABLE_PTHREADS - pthread_mutex_lock( &initialize_mutex ); + pthread_mutex_lock( &init_mutex ); #endif // BEGIN CRITICAL SECTION @@ -149,8 +150,9 @@ err_t bli_finalize( void ) bli_const_finalize(); bli_error_finalize(); bli_memsys_finalize(); - bli_ind_finalize(); bli_thread_finalize(); + bli_gks_finalize(); + bli_ind_finalize(); // After finalization is complete, mark BLIS as uninitialized. bli_is_init = FALSE; @@ -163,11 +165,11 @@ err_t bli_finalize( void ) // END CRITICAL SECTION #ifdef BLIS_ENABLE_PTHREADS - pthread_mutex_unlock( &initialize_mutex ); + pthread_mutex_unlock( &init_mutex ); #endif #ifdef BLIS_ENABLE_PTHREADS - pthread_mutex_destroy( &initialize_mutex ); + pthread_mutex_destroy( &init_mutex ); #endif return r_val; diff --git a/frame/base/bli_machval.h b/frame/base/bli_machval.h index 2c86f9dd5..bf3ae3c48 100644 --- a/frame/base/bli_machval.h +++ b/frame/base/bli_machval.h @@ -54,5 +54,5 @@ void PASTEMAC(chv,opname)( \ void* v \ ); -INSERT_GENTPROTR_BASIC( machval ) +INSERT_GENTPROTR_BASIC0( machval ) diff --git a/frame/base/bli_malloc.c b/frame/base/bli_malloc.c index 3a36378ae..59dfa986d 100644 --- a/frame/base/bli_malloc.c +++ b/frame/base/bli_malloc.c @@ -73,6 +73,15 @@ void* bli_malloc_intl( size_t size ) return bli_malloc_noalign( malloc_fp, size ); } +void* bli_calloc_intl( size_t size ) +{ + void* p = bli_malloc_intl( size ); + + memset( p, 0, size ); + + return p; +} + void bli_free_intl( void* p ) { bli_free_noalign( BLIS_FREE_INTL, p ); diff --git a/frame/base/bli_malloc.h b/frame/base/bli_malloc.h index bd2a8cc9a..8cb9945bf 100644 --- a/frame/base/bli_malloc.h +++ b/frame/base/bli_malloc.h @@ -42,6 +42,7 @@ void* bli_malloc_pool( size_t size ); void bli_free_pool( void* p ); void* bli_malloc_intl( size_t size ); +void* bli_calloc_intl( size_t size ); void bli_free_intl( void* p ); void* bli_malloc_user( size_t size ); diff --git a/frame/base/bli_membrk.c b/frame/base/bli_membrk.c index 210c04be1..16578de65 100644 --- a/frame/base/bli_membrk.c +++ b/frame/base/bli_membrk.c @@ -403,7 +403,7 @@ void bli_membrk_compute_pool_block_sizes cntx_t* cntx ) { - const ind_t im = bli_cntx_get_ind_method( cntx ); + const ind_t im = bli_cntx_method( cntx ); siz_t bs_cand_a = 0; siz_t bs_cand_b = 0; diff --git a/frame/base/bli_memsys.c b/frame/base/bli_memsys.c index f60412d40..95b32c688 100644 --- a/frame/base/bli_memsys.c +++ b/frame/base/bli_memsys.c @@ -54,17 +54,17 @@ static bool_t bli_memsys_is_init = FALSE; void bli_memsys_init( void ) { - cntx_t cntx; + cntx_t* cntx_p; // If the initialization flag is TRUE, we know the API is already // initialized, so we can return early. if ( bli_memsys_is_init == TRUE ) return; - // Create and initialize a context for gemm so we have something - // to pass into bli_membrk_init_pools(). We use BLIS_DOUBLE for - // the datatype, but the dt argument is actually only used when - // initializing contexts for induced methods. - bli_gemm_cntx_init( BLIS_DOUBLE, &cntx ); + // Query a native context so we have something to pass into + // bli_membrk_init_pools(). We use BLIS_DOUBLE for the datatype, + // but the dt argument is actually only used when initializing + // contexts for induced methods. + cntx_p = bli_gks_query_cntx(); #ifdef BLIS_ENABLE_OPENMP _Pragma( "omp critical (mem)" ) @@ -83,7 +83,7 @@ void bli_memsys_init( void ) if ( bli_memsys_is_init == FALSE ) { // Initialize the global membrk_t object and its memory pools. - bli_membrk_init( &cntx, &global_membrk ); + bli_membrk_init( cntx_p, &global_membrk ); // After initialization, mark the API as initialized. bli_memsys_is_init = TRUE; @@ -94,9 +94,6 @@ void bli_memsys_init( void ) #ifdef BLIS_ENABLE_PTHREADS pthread_mutex_unlock( &mem_manager_mutex ); #endif - - // Finalize the temporary gemm context. - bli_gemm_cntx_finalize( &cntx ); } void bli_memsys_reinit( cntx_t* cntx ) diff --git a/frame/1/kernels/old/bli_swapv_ref.h b/frame/base/old/bli_cntx_init_custom.c similarity index 85% rename from frame/1/kernels/old/bli_swapv_ref.h rename to frame/base/old/bli_cntx_init_custom.c index eec6a52e8..d09897380 100644 --- a/frame/1/kernels/old/bli_swapv_ref.h +++ b/frame/base/old/bli_cntx_init_custom.c @@ -32,16 +32,13 @@ */ +#include "blis.h" -#undef GENTPROT2 -#define GENTPROT2( ctype_x, ctype_y, chx, chy, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - dim_t n, \ - ctype_x* x, inc_t incx, \ - ctype_y* y, inc_t incy \ - ); - -INSERT_GENTPROT2_BASIC( swapv_ref ) +void bli_cntx_init_custom( cntx_t* cntx ) +{ + // Set default kernel blocksizes and functions. The developer should + // have #define'd any macros in bli_kernel.h corresponding to blocksizes + // and kernels that were customized. + bli_cntx_init_defaults( cntx ); +} diff --git a/frame/compat/check/bla_gemm_check.c b/frame/compat/check/bla_gemm_check.c index 63ed6d09b..75d6c00e0 100644 --- a/frame/compat/check/bla_gemm_check.c +++ b/frame/compat/check/bla_gemm_check.c @@ -56,18 +56,12 @@ void bla_gemm_check f77_int ta, tb; f77_int nrowa, nrowb; - nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 - ); - notb = PASTEF770(lsame)( transb, "N", (ftnlen)1, (ftnlen)1 - ); - conja = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 - ); - conjb = PASTEF770(lsame)( transb, "C", (ftnlen)1, (ftnlen)1 - ); - ta = PASTEF770(lsame)( transa, "T", (ftnlen)1, (ftnlen)1 - ); - tb = PASTEF770(lsame)( transb, "T", (ftnlen)1, (ftnlen)1 - ); + nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 ); + notb = PASTEF770(lsame)( transb, "N", (ftnlen)1, (ftnlen)1 ); + conja = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 ); + conjb = PASTEF770(lsame)( transb, "C", (ftnlen)1, (ftnlen)1 ); + ta = PASTEF770(lsame)( transa, "T", (ftnlen)1, (ftnlen)1 ); + tb = PASTEF770(lsame)( transb, "T", (ftnlen)1, (ftnlen)1 ); if ( nota ) { nrowa = *m; } else { nrowa = *k; } diff --git a/frame/compat/check/bla_gemv_check.c b/frame/compat/check/bla_gemv_check.c index a731c6f62..8d6fdadc9 100644 --- a/frame/compat/check/bla_gemv_check.c +++ b/frame/compat/check/bla_gemv_check.c @@ -51,12 +51,9 @@ void bla_gemv_check f77_int info = 0; f77_int nota, ta, conja; - nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 - ); - ta = PASTEF770(lsame)( transa, "T", (ftnlen)1, (ftnlen)1 - ); - conja = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 - ); + nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 ); + ta = PASTEF770(lsame)( transa, "T", (ftnlen)1, (ftnlen)1 ); + conja = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 ); if ( !nota && !ta && !conja ) diff --git a/frame/compat/check/bla_hemm_check.c b/frame/compat/check/bla_hemm_check.c index 6f8ffa07b..522370d2f 100644 --- a/frame/compat/check/bla_hemm_check.c +++ b/frame/compat/check/bla_hemm_check.c @@ -54,14 +54,10 @@ void bla_hemm_check f77_int lower, upper; f77_int nrowa; - left = PASTEF770(lsame)( sidea, "L", (ftnlen)1, (ftnlen)1 - ); - right = PASTEF770(lsame)( sidea, "R", (ftnlen)1, (ftnlen)1 - ); - lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 - ); - upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 - ); + left = PASTEF770(lsame)( sidea, "L", (ftnlen)1, (ftnlen)1 ); + right = PASTEF770(lsame)( sidea, "R", (ftnlen)1, (ftnlen)1 ); + lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 ); + upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 ); if ( left ) { nrowa = *m; } else { nrowa = *n; } diff --git a/frame/compat/check/bla_hemv_check.c b/frame/compat/check/bla_hemv_check.c index c671f6f4d..ac6104db6 100644 --- a/frame/compat/check/bla_hemv_check.c +++ b/frame/compat/check/bla_hemv_check.c @@ -50,10 +50,8 @@ void bla_hemv_check f77_int info = 0; f77_int lower, upper; - lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 - ); - upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 - ); + lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 ); + upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 ); if ( !lower && !upper ) diff --git a/frame/compat/check/bla_her2_check.c b/frame/compat/check/bla_her2_check.c index 7e1f41fde..ddc3b3727 100644 --- a/frame/compat/check/bla_her2_check.c +++ b/frame/compat/check/bla_her2_check.c @@ -50,10 +50,8 @@ void bla_her2_check f77_int info = 0; f77_int lower, upper; - lower = PASTEF770(lsame)( uploc, "L", (ftnlen)1, (ftnlen)1 - ); - upper = PASTEF770(lsame)( uploc, "U", (ftnlen)1, (ftnlen)1 - ); + lower = PASTEF770(lsame)( uploc, "L", (ftnlen)1, (ftnlen)1 ); + upper = PASTEF770(lsame)( uploc, "U", (ftnlen)1, (ftnlen)1 ); if ( !lower && !upper ) diff --git a/frame/compat/check/bla_her2k_check.c b/frame/compat/check/bla_her2k_check.c index 61b8ce7d4..8c9dad5af 100644 --- a/frame/compat/check/bla_her2k_check.c +++ b/frame/compat/check/bla_her2k_check.c @@ -54,14 +54,10 @@ void bla_her2k_check f77_int lower, upper; f77_int nrowa; - nota = PASTEF770(lsame)( trans, "N", (ftnlen)1, (ftnlen)1 - ); - conja = PASTEF770(lsame)( trans, "C", (ftnlen)1, (ftnlen)1 - ); - lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 - ); - upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 - ); + nota = PASTEF770(lsame)( trans, "N", (ftnlen)1, (ftnlen)1 ); + conja = PASTEF770(lsame)( trans, "C", (ftnlen)1, (ftnlen)1 ); + lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 ); + upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 ); if ( nota ) { nrowa = *m; } else { nrowa = *k; } diff --git a/frame/compat/check/bla_her_check.c b/frame/compat/check/bla_her_check.c index 9a42a71c0..b3a0a287c 100644 --- a/frame/compat/check/bla_her_check.c +++ b/frame/compat/check/bla_her_check.c @@ -49,10 +49,8 @@ void bla_her_check f77_int info = 0; f77_int lower, upper; - lower = PASTEF770(lsame)( uploc, "L", (ftnlen)1, (ftnlen)1 - ); - upper = PASTEF770(lsame)( uploc, "U", (ftnlen)1, (ftnlen)1 - ); + lower = PASTEF770(lsame)( uploc, "L", (ftnlen)1, (ftnlen)1 ); + upper = PASTEF770(lsame)( uploc, "U", (ftnlen)1, (ftnlen)1 ); if ( !lower && !upper ) diff --git a/frame/compat/check/bla_herk_check.c b/frame/compat/check/bla_herk_check.c index 836c4dcdf..0bb47ebc0 100644 --- a/frame/compat/check/bla_herk_check.c +++ b/frame/compat/check/bla_herk_check.c @@ -53,14 +53,10 @@ void bla_herk_check f77_int lower, upper; f77_int nrowa; - nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 - ); - conja = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 - ); - lower = PASTEF770(lsame)( uploc, "L", (ftnlen)1, (ftnlen)1 - ); - upper = PASTEF770(lsame)( uploc, "U", (ftnlen)1, (ftnlen)1 - ); + nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 ); + conja = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 ); + lower = PASTEF770(lsame)( uploc, "L", (ftnlen)1, (ftnlen)1 ); + upper = PASTEF770(lsame)( uploc, "U", (ftnlen)1, (ftnlen)1 ); if ( nota ) { nrowa = *m; } else { nrowa = *k; } diff --git a/frame/compat/check/bla_symm_check.c b/frame/compat/check/bla_symm_check.c index 4576a2387..2cffc921b 100644 --- a/frame/compat/check/bla_symm_check.c +++ b/frame/compat/check/bla_symm_check.c @@ -50,16 +50,16 @@ void bla_symm_check ) { bla_hemm_check - ( - dt_str, - op_str, - sidea, - uploa, - m, - n, - lda, - ldb, - ldc + ( + dt_str, + op_str, + sidea, + uploa, + m, + n, + lda, + ldb, + ldc ); } diff --git a/frame/compat/check/bla_symv_check.c b/frame/compat/check/bla_symv_check.c index 25875c234..9ad0423ff 100644 --- a/frame/compat/check/bla_symv_check.c +++ b/frame/compat/check/bla_symv_check.c @@ -48,15 +48,15 @@ void bla_symv_check ) { bla_hemv_check - ( - dt_str, - op_str, - uploa, - m, - lda, - incx, - incy - ); + ( + dt_str, + op_str, + uploa, + m, + lda, + incx, + incy + ); } #endif diff --git a/frame/compat/check/bla_syr2_check.c b/frame/compat/check/bla_syr2_check.c index 0f56b9796..a20881f3e 100644 --- a/frame/compat/check/bla_syr2_check.c +++ b/frame/compat/check/bla_syr2_check.c @@ -48,15 +48,15 @@ void bla_syr2_check ) { bla_her2_check - ( - dt_str, - op_str, - uploc, - m, - incx, - incy, - lda - ); + ( + dt_str, + op_str, + uploc, + m, + incx, + incy, + lda + ); } #endif diff --git a/frame/compat/check/bla_syr2k_check.c b/frame/compat/check/bla_syr2k_check.c index f47ed6358..aa0c3f254 100644 --- a/frame/compat/check/bla_syr2k_check.c +++ b/frame/compat/check/bla_syr2k_check.c @@ -54,16 +54,11 @@ void bla_syr2k_check f77_int lower, upper; f77_int nrowa; - nota = PASTEF770(lsame)( trans, "N", (ftnlen)1, (ftnlen)1 - ); - ta = PASTEF770(lsame)( trans, "T", (ftnlen)1, (ftnlen)1 - ); - cta = PASTEF770(lsame)( trans, "C", (ftnlen)1, (ftnlen)1 - ); - lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 - ); - upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 - ); + nota = PASTEF770(lsame)( trans, "N", (ftnlen)1, (ftnlen)1 ); + ta = PASTEF770(lsame)( trans, "T", (ftnlen)1, (ftnlen)1 ); + cta = PASTEF770(lsame)( trans, "C", (ftnlen)1, (ftnlen)1 ); + lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 ); + upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 ); if ( nota ) { nrowa = *m; } else { nrowa = *k; } diff --git a/frame/compat/check/bla_syr_check.c b/frame/compat/check/bla_syr_check.c index af4a76f12..092897afe 100644 --- a/frame/compat/check/bla_syr_check.c +++ b/frame/compat/check/bla_syr_check.c @@ -47,14 +47,14 @@ void bla_syr_check ) { bla_her_check - ( - dt_str, - op_str, - uploc, - m, - incx, - lda - ); + ( + dt_str, + op_str, + uploc, + m, + incx, + lda + ); } #endif diff --git a/frame/compat/check/bla_syrk_check.c b/frame/compat/check/bla_syrk_check.c index 2addb151e..5d5bfca6c 100644 --- a/frame/compat/check/bla_syrk_check.c +++ b/frame/compat/check/bla_syrk_check.c @@ -53,16 +53,11 @@ void bla_syrk_check f77_int lower, upper; f77_int nrowa; - nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 - ); - ta = PASTEF770(lsame)( transa, "T", (ftnlen)1, (ftnlen)1 - ); - cta = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 - ); - lower = PASTEF770(lsame)( uploc, "L", (ftnlen)1, (ftnlen)1 - ); - upper = PASTEF770(lsame)( uploc, "U", (ftnlen)1, (ftnlen)1 - ); + nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 ); + ta = PASTEF770(lsame)( transa, "T", (ftnlen)1, (ftnlen)1 ); + cta = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 ); + lower = PASTEF770(lsame)( uploc, "L", (ftnlen)1, (ftnlen)1 ); + upper = PASTEF770(lsame)( uploc, "U", (ftnlen)1, (ftnlen)1 ); if ( nota ) { nrowa = *m; } else { nrowa = *k; } diff --git a/frame/compat/check/bla_trmm_check.c b/frame/compat/check/bla_trmm_check.c index 6f1568eaf..1d36dd3f7 100644 --- a/frame/compat/check/bla_trmm_check.c +++ b/frame/compat/check/bla_trmm_check.c @@ -57,24 +57,15 @@ void bla_trmm_check f77_int unita, nonua; f77_int nrowa; - left = PASTEF770(lsame)( sidea, "L", (ftnlen)1, (ftnlen)1 - ); - right = PASTEF770(lsame)( sidea, "R", (ftnlen)1, (ftnlen)1 - ); - lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 - ); - upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 - ); - nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 - ); - ta = PASTEF770(lsame)( transa, "T", (ftnlen)1, (ftnlen)1 - ); - conja = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 - ); - unita = PASTEF770(lsame)( diaga, "U", (ftnlen)1, (ftnlen)1 - ); - nonua = PASTEF770(lsame)( diaga, "N", (ftnlen)1, (ftnlen)1 - ); + left = PASTEF770(lsame)( sidea, "L", (ftnlen)1, (ftnlen)1 ); + right = PASTEF770(lsame)( sidea, "R", (ftnlen)1, (ftnlen)1 ); + lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 ); + upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 ); + nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 ); + ta = PASTEF770(lsame)( transa, "T", (ftnlen)1, (ftnlen)1 ); + conja = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 ); + unita = PASTEF770(lsame)( diaga, "U", (ftnlen)1, (ftnlen)1 ); + nonua = PASTEF770(lsame)( diaga, "N", (ftnlen)1, (ftnlen)1 ); if ( left ) { nrowa = *m; } else { nrowa = *n; } diff --git a/frame/compat/check/bla_trmv_check.c b/frame/compat/check/bla_trmv_check.c index 9f8a8ba36..c14a70c10 100644 --- a/frame/compat/check/bla_trmv_check.c +++ b/frame/compat/check/bla_trmv_check.c @@ -53,20 +53,13 @@ void bla_trmv_check f77_int nota, ta, conja; f77_int unita, nonua; - lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 - ); - upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 - ); - nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 - ); - ta = PASTEF770(lsame)( transa, "T", (ftnlen)1, (ftnlen)1 - ); - conja = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 - ); - unita = PASTEF770(lsame)( diaga, "U", (ftnlen)1, (ftnlen)1 - ); - nonua = PASTEF770(lsame)( diaga, "N", (ftnlen)1, (ftnlen)1 - ); + lower = PASTEF770(lsame)( uploa, "L", (ftnlen)1, (ftnlen)1 ); + upper = PASTEF770(lsame)( uploa, "U", (ftnlen)1, (ftnlen)1 ); + nota = PASTEF770(lsame)( transa, "N", (ftnlen)1, (ftnlen)1 ); + ta = PASTEF770(lsame)( transa, "T", (ftnlen)1, (ftnlen)1 ); + conja = PASTEF770(lsame)( transa, "C", (ftnlen)1, (ftnlen)1 ); + unita = PASTEF770(lsame)( diaga, "U", (ftnlen)1, (ftnlen)1 ); + nonua = PASTEF770(lsame)( diaga, "N", (ftnlen)1, (ftnlen)1 ); if ( !lower && !upper ) diff --git a/frame/compat/check/bla_trsm_check.c b/frame/compat/check/bla_trsm_check.c index 2f200baa7..e87774d46 100644 --- a/frame/compat/check/bla_trsm_check.c +++ b/frame/compat/check/bla_trsm_check.c @@ -51,18 +51,18 @@ void bla_trsm_check ) { bla_trmm_check - ( - dt_str, - op_str, - sidea, - uploa, - transa, - diaga, - m, - n, - lda, - ldb - ); + ( + dt_str, + op_str, + sidea, + uploa, + transa, + diaga, + m, + n, + lda, + ldb + ); } #endif diff --git a/frame/compat/check/bla_trsv_check.c b/frame/compat/check/bla_trsv_check.c index 0b6b66062..f27eabecc 100644 --- a/frame/compat/check/bla_trsv_check.c +++ b/frame/compat/check/bla_trsv_check.c @@ -49,16 +49,16 @@ void bla_trsv_check ) { bla_trmv_check - ( - dt_str, - op_str, - uploa, - transa, - diaga, - m, - lda, - incx - ); + ( + dt_str, + op_str, + uploa, + transa, + diaga, + m, + lda, + incx + ); } #endif diff --git a/frame/compat/f2c/bla_lsame.c b/frame/compat/f2c/bla_lsame.c index 7b109ab43..206c73023 100644 --- a/frame/compat/f2c/bla_lsame.c +++ b/frame/compat/f2c/bla_lsame.c @@ -43,9 +43,9 @@ #ifdef LAPACK_ILP64 -long PASTEF770(lsame)(char *ca, char *cb, long ca_len, long cb_len) +long PASTEF770(lsame)(const char *ca, const char *cb, long ca_len, long cb_len) #else -int PASTEF770(lsame)(char *ca, char *cb, int ca_len, int cb_len) +int PASTEF770(lsame)(const char *ca, const char *cb, int ca_len, int cb_len) #endif { /* System generated locals */ diff --git a/frame/compat/f2c/bla_lsame.h b/frame/compat/f2c/bla_lsame.h index e8f63f488..faf92fcec 100644 --- a/frame/compat/f2c/bla_lsame.h +++ b/frame/compat/f2c/bla_lsame.h @@ -35,9 +35,9 @@ #ifdef BLIS_ENABLE_BLAS2BLIS #ifdef LAPACK_ILP64 -long PASTEF770(lsame)(char *ca, char *cb, long ca_len, long cb_len); +long PASTEF770(lsame)(const char *ca, const char *cb, long ca_len, long cb_len); #else -int PASTEF770(lsame)(char *ca, char *cb, int ca_len, int cb_len); +int PASTEF770(lsame)(const char *ca, const char *cb, int ca_len, int cb_len); #endif #endif diff --git a/frame/include/bli_arch_config.h b/frame/include/bli_arch_config.h new file mode 100644 index 000000000..339cb1f1c --- /dev/null +++ b/frame/include/bli_arch_config.h @@ -0,0 +1,248 @@ +/* + + BLIS + An object-based framework for developing high-performance BLAS-like + libraries. + + Copyright (C) 2014, The University of Texas at Austin + Copyright (C) 2016 Hewlett Packard Enterprise Development LP + + 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_ARCH_CONFIG_H +#define BLIS_ARCH_CONFIG_H + +// +// -- Context initialization prototypes ---------------------------------------- +// + +// -- Intel64 architectures -- + +#ifdef BLIS_CONFIG_KNL +CNTX_INIT_PROTS( knl ) +#endif +#ifdef BLIS_CONFIG_KNC +CNTX_INIT_PROTS( knc ) +#endif +#ifdef BLIS_CONFIG_HASWELL +CNTX_INIT_PROTS( haswell ) +#endif +#ifdef BLIS_CONFIG_SANDYBRIDGE +CNTX_INIT_PROTS( sandybridge ) +#endif +#ifdef BLIS_CONFIG_PENRYN +CNTX_INIT_PROTS( penryn ) +#endif + +// -- AMD64 architectures -- + +#ifdef BLIS_CONFIG_ZEN +CNTX_INIT_PROTS( zen ) +#endif +#ifdef BLIS_CONFIG_EXCAVATOR +CNTX_INIT_PROTS( excavator ) +#endif +#ifdef BLIS_CONFIG_STEAMROLLER +CNTX_INIT_PROTS( steamroller ) +#endif +#ifdef BLIS_CONFIG_PILEDRIVER +CNTX_INIT_PROTS( piledriver ) +#endif +#ifdef BLIS_CONFIG_BULLDOZER +CNTX_INIT_PROTS( bulldozer ) +#endif + +// -- ARM architectures -- + +#ifdef BLIS_CONFIG_CORTEXA57 +CNTX_INIT_PROTS( cortexa57 ) +#endif +#ifdef BLIS_CONFIG_CORTEXA15 +CNTX_INIT_PROTS( cortexa15 ) +#endif +#ifdef BLIS_CONFIG_CORTEXA9 +CNTX_INIT_PROTS( cortexa9 ) +#endif + +// -- IBM BG/Q -- + +#ifdef BLIS_CONFIG_POWER7 +CNTX_INIT_PROTS( power7 ) +#endif +#ifdef BLIS_CONFIG_BGQ +CNTX_INIT_PROTS( bgq ) +#endif + +// -- Generic -- + +#ifdef BLIS_CONFIG_GENERIC +CNTX_INIT_PROTS( generic ) +#endif + + +// +// -- Architecture family-specific headers ------------------------------------- +// + +// -- x86_64 families -- + +#ifdef BLIS_FAMILY_INTEL64 +#include "bli_family_intel64.h" +#endif +#ifdef BLIS_FAMILY_AMD64 +#include "bli_family_amd64.h" +#endif +#ifdef BLIS_FAMILY_X86_64 +#include "bli_family_x86_64.h" +#endif + +// -- Intel64 architectures -- + +#ifdef BLIS_FAMILY_KNL +#include "bli_family_knl.h" +#endif +#ifdef BLIS_FAMILY_KNC +#include "bli_family_knc.h" +#endif +#ifdef BLIS_FAMILY_HASWELL +#include "bli_family_haswell.h" +#endif +#ifdef BLIS_FAMILY_SANDYBRIDGE +#include "bli_family_sandybridge.h" +#endif +#ifdef BLIS_FAMILY_PENRYN +#include "bli_family_penryn.h" +#endif + +// -- AMD64 architectures -- + +#ifdef BLIS_FAMILY_ZEN +#include "bli_family_zen.h" +#endif +#ifdef BLIS_FAMILY_EXCAVATOR +#include "bli_family_excavator.h" +#endif +#ifdef BLIS_FAMILY_STEAMROLLER +#include "bli_family_steamroller.h" +#endif +#ifdef BLIS_FAMILY_PILEDRIVER +#include "bli_family_piledriver.h" +#endif +#ifdef BLIS_FAMILY_BULLDOZER +#include "bli_family_bulldozer.h" +#endif + +// -- ARM architectures -- + +#ifdef BLIS_FAMILY_CORTEXA57 +#include "bli_family_cortexa57.h" +#endif +#ifdef BLIS_FAMILY_CORTEXA15 +#include "bli_family_cortexa15.h" +#endif +#ifdef BLIS_FAMILY_CORTEXA9 +#include "bli_family_cortexa9.h" +#endif + +// -- IBM BG/Q -- + +#ifdef BLIS_FAMILY_POWER7 +#include "bli_family_power7.h" +#endif +#ifdef BLIS_FAMILY_BGQ +#include "bli_family_bgq.h" +#endif + +// -- Generic -- + +#ifdef BLIS_FAMILY_GENERIC +#include "bli_family_generic.h" +#endif + + +// +// -- kernel set prototypes ---------------------------------------------------- +// + +// -- Intel64 architectures -- + +#ifdef BLIS_KERNELS_KNL +#include "bli_kernels_knl.h" +#endif +#ifdef BLIS_KERNELS_KNC +#include "bli_kernels_knc.h" +#endif +#ifdef BLIS_KERNELS_HASWELL +#include "bli_kernels_haswell.h" +#endif +#ifdef BLIS_KERNELS_SANDYBRIDGE +#include "bli_kernels_sandybridge.h" +#endif +#ifdef BLIS_KERNELS_PENRYN +#include "bli_kernels_penryn.h" +#endif + +// -- AMD64 architectures -- + +//#ifdef BLIS_KERNELS_ZEN +//#include "bli_kernels_zen.h" +//#endif +//#ifdef BLIS_KERNELS_EXCAVATOR +//#include "bli_kernels_excavator.h" +//#endif +//#ifdef BLIS_KERNELS_STEAMROLLER +//#include "bli_kernels_steamroller.h" +//#endif +#ifdef BLIS_KERNELS_PILEDRIVER +#include "bli_kernels_piledriver.h" +#endif +#ifdef BLIS_KERNELS_BULLDOZER +#include "bli_kernels_bulldozer.h" +#endif + +// -- ARM architectures -- + +#ifdef BLIS_KERNELS_ARMV8A +#include "bli_kernels_armv8a.h" +#endif +#ifdef BLIS_KERNELS_ARMV7A +#include "bli_kernels_armv7a.h" +#endif + +// -- IBM BG/Q -- + +#ifdef BLIS_KERNELS_POWER7 +#include "bli_kernels_power7.h" +#endif +#ifdef BLIS_KERNELS_BGQ +#include "bli_kernels_bgq.h" +#endif + + + +#endif + diff --git a/frame/include/bli_arch_config_pre.h b/frame/include/bli_arch_config_pre.h new file mode 100644 index 000000000..984a04acf --- /dev/null +++ b/frame/include/bli_arch_config_pre.h @@ -0,0 +1,74 @@ +/* + + 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_ARCH_CONFIG_PRE_H +#define BLIS_ARCH_CONFIG_PRE_H + + +// -- Naming-related kernel definitions ---------------------------------------- + +// The default suffix appended to reference kernels. +#define BLIS_REF_SUFFIX _ref + +// A suffix used for labeling certain induced method aware functions. +#define BLIS_IND_SUFFIX _ind + +// Add an underscore to the BLIS kernel set string, if it was defined. +#ifdef BLIS_CNAME +#define BLIS_CNAME_INFIX PASTECH(_,BLIS_CNAME) +#endif + +// -- Prototype-generating macro definitions ----------------------------------- + +// Prototype-generating macro for bli_cntx_init_*() functions. +#define CNTX_INIT_PROTS( archname ) \ +\ +void PASTEMAC(cntx_init_,archname) \ + ( \ + cntx_t* cntx \ + ); \ +void PASTEMAC2(cntx_init_,archname,BLIS_REF_SUFFIX) \ + ( \ + cntx_t* cntx \ + ); \ +void PASTEMAC2(cntx_init_,archname,BLIS_IND_SUFFIX) \ + ( \ + ind_t method, \ + num_t dt, \ + cntx_t* cntx \ + ); + + +#endif + diff --git a/frame/include/bli_f2c.h b/frame/include/bli_f2c.h index 9f5e5a918..24a10c59e 100644 --- a/frame/include/bli_f2c.h +++ b/frame/include/bli_f2c.h @@ -17,9 +17,9 @@ typedef f77_int bla_logical; //typedef short int shortlogical; //typedef char logical1; //typedef char integer1; -#ifdef INTEGER_STAR_8 /* Adjust for integer*8. */ -typedef long long longint; /* system-dependent */ -typedef unsigned long long ulongint; /* system-dependent */ +#ifdef INTEGER_STAR_8 // Adjust for integer*8. +typedef long long longint; // system-dependent +typedef unsigned long long ulongint; // system-dependent #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) #define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) #endif @@ -32,15 +32,15 @@ typedef unsigned long long ulongint; /* system-dependent */ #define FALSE_ (0) #endif -/* Extern is for use with -E */ +// Extern is for use with -E #ifndef Extern #define Extern extern #endif -/* I/O stuff */ +// I/O stuff #ifdef f2c_i2 -/* for -i2 */ +// for -i2 typedef short flag; typedef short ftnlen; typedef short ftnint; @@ -85,7 +85,7 @@ typedef long int ftnint; #define bit_set(a,b) ((a) | ((uinteger)1 << (b))) #endif -/* undef any lower-case symbols that your C compiler predefines, e.g.: */ +// undef any lower-case symbols that your C compiler predefines, e.g.: #ifndef Skip_f2c_Undefs #undef cray diff --git a/frame/include/bli_gentfunc_macro_defs.h b/frame/include/bli_gentfunc_macro_defs.h index 5fac6b977..6d980b1fa 100644 --- a/frame/include/bli_gentfunc_macro_defs.h +++ b/frame/include/bli_gentfunc_macro_defs.h @@ -248,6 +248,13 @@ GENTFUNCCO( dcomplex, double, z, d, tfuncname, varname ) GENTFUNCCO( scomplex, float, c, s, tfuncname, varname1, varname2 ) \ GENTFUNCCO( dcomplex, double, z, d, tfuncname, varname1, varname2 ) +// -- (three auxiliary arguments) -- + +#define INSERT_GENTFUNCCO_BASIC3( tfuncname, varname1, varname2, varname3 ) \ +\ +GENTFUNCCO( scomplex, float, c, s, tfuncname, varname1, varname2, varname3 ) \ +GENTFUNCCO( dcomplex, double, z, d, tfuncname, varname1, varname2, varname3 ) + // -- Basic one-operand macro with integer instance -- @@ -395,88 +402,6 @@ GENTFUNC2( dcomplex, scomplex, z, c, tfuncname, varname ) \ -// -- Basic two-operand with union of operands -- - -// -- (no auxiliary arguments) -- - -#define INSERT_GENTFUNC2U_BASIC0( tfuncname ) \ -\ -GENTFUNC2U( float, float, float, s, s, s, tfuncname ) \ -GENTFUNC2U( double, double, double, d, d, d, tfuncname ) \ -GENTFUNC2U( scomplex, scomplex, scomplex, c, c, c, tfuncname ) \ -GENTFUNC2U( dcomplex, dcomplex, dcomplex, z, z, z, tfuncname ) - -// -- (one auxiliary argument) -- - -#define INSERT_GENTFUNC2U_BASIC( tfuncname, varname ) \ -\ -GENTFUNC2U( float, float, float, s, s, s, tfuncname, varname ) \ -GENTFUNC2U( double, double, double, d, d, d, tfuncname, varname ) \ -GENTFUNC2U( scomplex, scomplex, scomplex, c, c, c, tfuncname, varname ) \ -GENTFUNC2U( dcomplex, dcomplex, dcomplex, z, z, z, tfuncname, varname ) - - - -// -- Mixed domain two-operand with union of operands -- - -// -- (no auxiliary arguments) -- - -#define INSERT_GENTFUNC2U_MIX_D0( tfuncname ) \ -\ -GENTFUNC2U( float, scomplex, scomplex, s, c, c, tfuncname ) \ -GENTFUNC2U( scomplex, float, scomplex, c, s, c, tfuncname ) \ -\ -GENTFUNC2U( double, dcomplex, dcomplex, d, z, z, tfuncname ) \ -GENTFUNC2U( dcomplex, double, dcomplex, z, d, z, tfuncname ) - -// -- (one auxiliary argument) -- - -#define INSERT_GENTFUNC2U_MIX_D( tfuncname, varname ) \ -\ -GENTFUNC2U( float, scomplex, scomplex, s, c, c, tfuncname, varname ) \ -GENTFUNC2U( scomplex, float, scomplex, c, s, c, tfuncname, varname ) \ -\ -GENTFUNC2U( double, dcomplex, dcomplex, d, z, z, tfuncname, varname ) \ -GENTFUNC2U( dcomplex, double, dcomplex, z, d, z, tfuncname, varname ) - - - -// -- Mixed precision two-operand with union of operands -- - -// -- (no auxiliary arguments) -- - -#define INSERT_GENTFUNC2U_MIX_P0( tfuncname ) \ -\ -GENTFUNC2U( float, double, double, s, d, d, tfuncname ) \ -GENTFUNC2U( float, dcomplex, dcomplex, s, z, z, tfuncname ) \ -\ -GENTFUNC2U( double, float, double, d, s, d, tfuncname ) \ -GENTFUNC2U( double, scomplex, dcomplex, d, c, z, tfuncname ) \ -\ -GENTFUNC2U( scomplex, double, dcomplex, c, d, z, tfuncname ) \ -GENTFUNC2U( scomplex, dcomplex, dcomplex, c, z, z, tfuncname ) \ -\ -GENTFUNC2U( dcomplex, float, dcomplex, z, s, z, tfuncname ) \ -GENTFUNC2U( dcomplex, scomplex, dcomplex, z, c, z, tfuncname ) - -// -- (one auxiliary argument) -- - -#define INSERT_GENTFUNC2U_MIX_P( tfuncname, varname ) \ -\ -GENTFUNC2U( float, double, double, s, d, d, tfuncname, varname ) \ -GENTFUNC2U( float, dcomplex, dcomplex, s, z, z, tfuncname, varname ) \ -\ -GENTFUNC2U( double, float, double, d, s, d, tfuncname, varname ) \ -GENTFUNC2U( double, scomplex, dcomplex, d, c, z, tfuncname, varname ) \ -\ -GENTFUNC2U( scomplex, double, dcomplex, c, d, z, tfuncname, varname ) \ -GENTFUNC2U( scomplex, dcomplex, dcomplex, c, z, z, tfuncname, varname ) \ -\ -GENTFUNC2U( dcomplex, float, dcomplex, z, s, z, tfuncname, varname ) \ -GENTFUNC2U( dcomplex, scomplex, dcomplex, z, c, z, tfuncname, varname ) - - - // -- Basic two-operand with real projection of first operand -- // -- (no auxiliary arguments) -- diff --git a/frame/include/bli_gentprot_macro_defs.h b/frame/include/bli_gentprot_macro_defs.h index 06955283a..5d685cc56 100644 --- a/frame/include/bli_gentprot_macro_defs.h +++ b/frame/include/bli_gentprot_macro_defs.h @@ -32,6 +32,7 @@ */ + #ifndef BLIS_GENTPROT_MACRO_DEFS_H #define BLIS_GENTPROT_MACRO_DEFS_H @@ -128,19 +129,132 @@ GENTPROTSCAL( double, dcomplex, d, z, blasname ) // -- Basic one-operand macro -- +// -- (no auxiliary arguments) -- -#define INSERT_GENTPROT_BASIC( funcname ) \ +#define INSERT_GENTPROT_BASIC0( tfuncname ) \ \ -GENTPROT( float, s, funcname ) \ -GENTPROT( double, d, funcname ) \ -GENTPROT( scomplex, c, funcname ) \ -GENTPROT( dcomplex, z, funcname ) +GENTPROT( float, s, tfuncname ) \ +GENTPROT( double, d, tfuncname ) \ +GENTPROT( scomplex, c, tfuncname ) \ +GENTPROT( dcomplex, z, tfuncname ) + +// -- (one auxiliary argument) -- + +#define INSERT_GENTPROT_BASIC( tfuncname, varname ) \ +\ +GENTPROT( float, s, tfuncname, varname ) \ +GENTPROT( double, d, tfuncname, varname ) \ +GENTPROT( scomplex, c, tfuncname, varname ) \ +GENTPROT( dcomplex, z, tfuncname, varname ) + +// -- (two auxiliary arguments) -- + +#define INSERT_GENTPROT_BASIC2( tfuncname, varname1, varname2 ) \ +\ +GENTPROT( float, s, tfuncname, varname1, varname2 ) \ +GENTPROT( double, d, tfuncname, varname1, varname2 ) \ +GENTPROT( scomplex, c, tfuncname, varname1, varname2 ) \ +GENTPROT( dcomplex, z, tfuncname, varname1, varname2 ) + +// -- (three auxiliary arguments) -- + +#define INSERT_GENTPROT_BASIC3( tfuncname, varname1, varname2, varname3 ) \ +\ +GENTPROT( float, s, tfuncname, varname1, varname2, varname3 ) \ +GENTPROT( double, d, tfuncname, varname1, varname2, varname3 ) \ +GENTPROT( scomplex, c, tfuncname, varname1, varname2, varname3 ) \ +GENTPROT( dcomplex, z, tfuncname, varname1, varname2, varname3 ) + +// -- (four auxiliary arguments) -- + +#define INSERT_GENTPROT_BASIC4( tfuncname, varname1, varname2, varname3, varname4 ) \ +\ +GENTPROT( float, s, tfuncname, varname1, varname2, varname3, varname4 ) \ +GENTPROT( double, d, tfuncname, varname1, varname2, varname3, varname4 ) \ +GENTPROT( scomplex, c, tfuncname, varname1, varname2, varname3, varname4 ) \ +GENTPROT( dcomplex, z, tfuncname, varname1, varname2, varname3, varname4 ) + + + +// -- Basic one-operand with real projection -- + +// -- (no auxiliary arguments) -- + +#define INSERT_GENTPROTR_BASIC0( tfuncname ) \ +\ +GENTPROTR( float, float, s, s, tfuncname ) \ +GENTPROTR( double, double, d, d, tfuncname ) \ +GENTPROTR( scomplex, float, c, s, tfuncname ) \ +GENTPROTR( dcomplex, double, z, d, tfuncname ) + +// -- (one auxiliary argument) -- + +#define INSERT_GENTPROTR_BASIC( tfuncname, varname ) \ +\ +GENTPROTR( float, float, s, s, tfuncname, varname ) \ +GENTPROTR( double, double, d, d, tfuncname, varname ) \ +GENTPROTR( scomplex, float, c, s, tfuncname, varname ) \ +GENTPROTR( dcomplex, double, z, d, tfuncname, varname ) + +// -- (two auxiliary arguments) -- + +#define INSERT_GENTPROTR_BASIC2( tfuncname, varname1, varname2 ) \ +\ +GENTPROTR( float, float, s, s, tfuncname, varname1, varname2 ) \ +GENTPROTR( double, double, d, d, tfuncname, varname1, varname2 ) \ +GENTPROTR( scomplex, float, c, s, tfuncname, varname1, varname2 ) \ +GENTPROTR( dcomplex, double, z, d, tfuncname, varname1, varname2 ) + +// -- (three auxiliary arguments) -- + +#define INSERT_GENTPROTR_BASIC3( tfuncname, varname1, varname2, varname3 ) \ +\ +GENTPROTR( float, float, s, s, tfuncname, varname1, varname2, varname3 ) \ +GENTPROTR( double, double, d, d, tfuncname, varname1, varname2, varname3 ) \ +GENTPROTR( scomplex, float, c, s, tfuncname, varname1, varname2, varname3 ) \ +GENTPROTR( dcomplex, double, z, d, tfuncname, varname1, varname2, varname3 ) + +// -- (four auxiliary arguments) -- + +#define INSERT_GENTPROTR_BASIC4( tfuncname, varname1, varname2, varname3, varname4 ) \ +\ +GENTPROTR( float, float, s, s, tfuncname, varname1, varname2, varname3, varname4 ) \ +GENTPROTR( double, double, d, d, tfuncname, varname1, varname2, varname3, varname4 ) \ +GENTPROTR( scomplex, float, c, s, tfuncname, varname1, varname2, varname3, varname4 ) \ +GENTPROTR( dcomplex, double, z, d, tfuncname, varname1, varname2, varname3, varname4 ) + + + +// -- Basic one-operand macro with complex domain only and real projection -- + +// -- (no auxiliary arguments) -- + +#define INSERT_GENTPROTCO_BASIC0( tfuncname ) \ +\ +GENTPROTCO( scomplex, float, c, s, tfuncname ) \ +GENTPROTCO( dcomplex, double, z, d, tfuncname ) + +// -- (one auxiliary argument) -- + +#define INSERT_GENTPROTCO_BASIC( tfuncname, varname ) \ +\ +GENTPROTCO( scomplex, float, c, s, tfuncname, varname ) \ +GENTPROTCO( dcomplex, double, z, d, tfuncname, varname ) + +// -- (two auxiliary arguments) -- + +#define INSERT_GENTPROTCO_BASIC2( tfuncname, varname1, varname2 ) \ +\ +GENTPROTCO( scomplex, float, c, s, tfuncname, varname1, varname2 ) \ +GENTPROTCO( dcomplex, double, z, d, tfuncname, varname1, varname2 ) + // -- Basic one-operand macro with integer instance -- +// -- (no auxiliary arguments) -- -#define INSERT_GENTPROT_BASIC_I( funcname ) \ +#define INSERT_GENTPROT_BASIC0_I( funcname ) \ \ GENTPROT( float, s, funcname ) \ GENTPROT( double, d, funcname ) \ @@ -148,40 +262,43 @@ GENTPROT( scomplex, c, funcname ) \ GENTPROT( dcomplex, z, funcname ) \ GENTPROT( gint_t, i, funcname ) +// -- (one auxiliary argument) -- + +#define INSERT_GENTPROT_BASIC_I( tfuncname, varname ) \ +\ +GENTPROT( float, s, tfuncname, varname ) \ +GENTPROT( double, d, tfuncname, varname ) \ +GENTPROT( scomplex, c, tfuncname, varname ) \ +GENTPROT( dcomplex, z, tfuncname, varname ) \ +GENTPROT( gint_t, i, tfuncname, varname ) + + // -- Basic one-operand with integer projection -- +// -- (no auxiliary arguments) -- -#define INSERT_GENTPROTI_BASIC( funcname ) \ +#define INSERT_GENTPROTI_BASIC0( funcname ) \ \ GENTPROTI( float, gint_t, s, i, funcname ) \ GENTPROTI( double, gint_t, d, i, funcname ) \ GENTPROTI( scomplex, gint_t, c, i, funcname ) \ GENTPROTI( dcomplex, gint_t, z, i, funcname ) +// -- (one auxiliary argument) -- -// -- Basic one-operand with real projection -- - - -#define INSERT_GENTPROTR_BASIC( funcname ) \ +#define INSERT_GENTPROTI_BASIC( tfuncname, varname ) \ \ -GENTPROTR( float, float, s, s, funcname ) \ -GENTPROTR( double, double, d, d, funcname ) \ -GENTPROTR( scomplex, float, c, s, funcname ) \ -GENTPROTR( dcomplex, double, z, d, funcname ) +GENTPROTI( float, gint_t, s, i, tfuncname, varname ) \ +GENTPROTI( double, gint_t, d, i, tfuncname, varname ) \ +GENTPROTI( scomplex, gint_t, c, i, tfuncname, varname ) \ +GENTPROTI( dcomplex, gint_t, z, i, tfuncname, varname ) -// -- Basic one-operand macro with complex domain only and real projection -- - - -#define INSERT_GENTPROTCO_BASIC( funcname ) \ -\ -GENTPROTCO( scomplex, float, c, s, funcname ) \ -GENTPROTCO( dcomplex, double, z, d, funcname ) - // -- Basic one-operand with real and integer projections -- +// -- (no auxiliary arguments) -- #define INSERT_GENTPROTRI_BASIC( funcname ) \ \ @@ -198,19 +315,31 @@ GENTPROTRI( dcomplex, double, gint_t, z, d, i, funcname ) // -- Basic two-operand macro -- +// -- (no auxiliary arguments) -- -#define INSERT_GENTPROT2_BASIC( funcname ) \ +#define INSERT_GENTPROT2_BASIC0( funcname ) \ \ GENTPROT2( float, float, s, s, funcname ) \ GENTPROT2( double, double, d, d, funcname ) \ GENTPROT2( scomplex, scomplex, c, c, funcname ) \ GENTPROT2( dcomplex, dcomplex, z, z, funcname ) +// -- (one auxiliary argument) -- + +#define INSERT_GENTPROT2_BASIC( tfuncname, varname ) \ +\ +GENTPROT2( float, float, s, s, tfuncname, varname ) \ +GENTPROT2( double, double, d, d, tfuncname, varname ) \ +GENTPROT2( scomplex, scomplex, c, c, tfuncname, varname ) \ +GENTPROT2( dcomplex, dcomplex, z, z, tfuncname, varname ) + + // -- Mixed domain two-operand macro -- +// -- (no auxiliary arguments) -- -#define INSERT_GENTPROT2_MIX_D( funcname ) \ +#define INSERT_GENTPROT2_MIX_D0( funcname ) \ \ GENTPROT2( float, scomplex, s, c, funcname ) \ GENTPROT2( scomplex, float, c, s, funcname ) \ @@ -218,11 +347,23 @@ GENTPROT2( scomplex, float, c, s, funcname ) \ GENTPROT2( double, dcomplex, d, z, funcname ) \ GENTPROT2( dcomplex, double, z, d, funcname ) +// -- (one auxiliary argument) -- + +#define INSERT_GENTPROT2_MIX_D( tfuncname, varname ) \ +\ +GENTPROT2( float, scomplex, s, c, tfuncname, varname ) \ +GENTPROT2( scomplex, float, c, s, tfuncname, varname ) \ +\ +GENTPROT2( double, dcomplex, d, z, tfuncname, varname ) \ +GENTPROT2( dcomplex, double, z, d, tfuncname, varname ) + + // -- Mixed precision two-operand macro -- +// -- (no auxiliary arguments) -- -#define INSERT_GENTPROT2_MIX_P( funcname ) \ +#define INSERT_GENTPROT2_MIX_P0( funcname ) \ \ GENTPROT2( float, double, s, d, funcname ) \ GENTPROT2( float, dcomplex, s, z, funcname ) \ @@ -236,94 +377,107 @@ GENTPROT2( scomplex, dcomplex, c, z, funcname ) \ GENTPROT2( dcomplex, float, z, s, funcname ) \ GENTPROT2( dcomplex, scomplex, z, c, funcname ) \ +// -- (one auxiliary argument) -- - -// -- Basic two-operand with union of operands -- - - -#define INSERT_GENTPROT2U_BASIC( funcname ) \ +#define INSERT_GENTPROT2_MIX_P( tfuncname, varname ) \ \ -GENTPROT2U( float, float, float, s, s, s, funcname ) \ -GENTPROT2U( double, double, double, d, d, d, funcname ) \ -GENTPROT2U( scomplex, scomplex, scomplex, c, c, c, funcname ) \ -GENTPROT2U( dcomplex, dcomplex, dcomplex, z, z, z, funcname ) - - -// -- Mixed domain two-operand with union of operands -- - - -#define INSERT_GENTPROT2U_MIX_D( funcname ) \ +GENTPROT2( float, double, s, d, tfuncname, varname ) \ +GENTPROT2( float, dcomplex, s, z, tfuncname, varname ) \ \ -GENTPROT2U( float, scomplex, scomplex, s, c, c, funcname ) \ -GENTPROT2U( scomplex, float, scomplex, c, s, c, funcname ) \ +GENTPROT2( double, float, d, s, tfuncname, varname ) \ +GENTPROT2( double, scomplex, d, c, tfuncname, varname ) \ \ -GENTPROT2U( double, dcomplex, dcomplex, d, z, z, funcname ) \ -GENTPROT2U( dcomplex, double, dcomplex, z, d, z, funcname ) - - -// -- Mixed precision two-operand with union of operands -- - - -#define INSERT_GENTPROT2U_MIX_P( funcname ) \ +GENTPROT2( scomplex, double, c, d, tfuncname, varname ) \ +GENTPROT2( scomplex, dcomplex, c, z, tfuncname, varname ) \ \ -GENTPROT2U( float, double, double, s, d, d, funcname ) \ -GENTPROT2U( float, dcomplex, dcomplex, s, z, z, funcname ) \ -\ -GENTPROT2U( double, float, double, d, s, d, funcname ) \ -GENTPROT2U( double, scomplex, dcomplex, d, c, z, funcname ) \ -\ -GENTPROT2U( scomplex, double, dcomplex, c, d, z, funcname ) \ -GENTPROT2U( scomplex, dcomplex, dcomplex, c, z, z, funcname ) \ -\ -GENTPROT2U( dcomplex, float, dcomplex, z, s, z, funcname ) \ -GENTPROT2U( dcomplex, scomplex, dcomplex, z, c, z, funcname ) +GENTPROT2( dcomplex, float, z, s, tfuncname, varname ) \ +GENTPROT2( dcomplex, scomplex, z, c, tfuncname, varname ) \ // -- Basic two-operand with real projection of first operand -- +// -- (no auxiliary arguments) -- -#define INSERT_GENTPROT2R_BASIC( funcname ) \ +#define INSERT_GENTPROT2R_BASIC0( funcname ) \ \ GENTPROT2R( float, float, float, s, s, s, funcname ) \ GENTPROT2R( double, double, double, d, d, d, funcname ) \ GENTPROT2R( scomplex, scomplex, float, c, c, s, funcname ) \ GENTPROT2R( dcomplex, dcomplex, double, z, z, d, funcname ) +// -- (one auxiliary argument) -- + +#define INSERT_GENTPROT2R_BASIC( tfuncname, varname ) \ +\ +GENTPROT2R( float, float, float, s, s, s, tfuncname, varname ) \ +GENTPROT2R( double, double, double, d, d, d, tfuncname, varname ) \ +GENTPROT2R( scomplex, scomplex, float, c, c, s, tfuncname, varname ) \ +GENTPROT2R( dcomplex, dcomplex, double, z, z, d, tfuncname, varname ) + + // -- Mixed domain two-operand with real projection of first operand -- +// -- (no auxiliary arguments) -- -#define INSERT_GENTPROT2R_MIX_D( funcname ) \ +#define INSERT_GENTPROT2R_MIX_D0( tfuncname ) \ \ -GENTPROT2R( float, scomplex, float, s, c, s, funcname ) \ -GENTPROT2R( scomplex, float, float, c, s, s, funcname ) \ +GENTPROT2R( float, scomplex, float, s, c, s, tfuncname ) \ +GENTPROT2R( scomplex, float, float, c, s, s, tfuncname ) \ \ -GENTPROT2R( double, dcomplex, double, d, z, d, funcname ) \ -GENTPROT2R( dcomplex, double, double, z, d, d, funcname ) +GENTPROT2R( double, dcomplex, double, d, z, d, tfuncname ) \ +GENTPROT2R( dcomplex, double, double, z, d, d, tfuncname ) + +// -- (one auxiliary argument) -- + +#define INSERT_GENTPROT2R_MIX_D( tfuncname, varname ) \ +\ +GENTPROT2R( float, scomplex, float, s, c, s, tfuncname, varname ) \ +GENTPROT2R( scomplex, float, float, c, s, s, tfuncname, varname ) \ +\ +GENTPROT2R( double, dcomplex, double, d, z, d, tfuncname, varname ) \ +GENTPROT2R( dcomplex, double, double, z, d, d, tfuncname, varname ) + // -- Mixed precision two-operand with real projection of first operand -- +// -- (no auxiliary arguments) -- -#define INSERT_GENTPROT2R_MIX_P( funcname ) \ +#define INSERT_GENTPROT2R_MIX_P0( tfuncname ) \ \ -GENTPROT2R( float, double, float, s, d, s, funcname ) \ -GENTPROT2R( float, dcomplex, float, s, z, s, funcname ) \ +GENTPROT2R( float, double, float, s, d, s, tfuncname ) \ +GENTPROT2R( float, dcomplex, float, s, z, s, tfuncname ) \ \ -GENTPROT2R( double, float, double, d, s, d, funcname ) \ -GENTPROT2R( double, scomplex, double, d, c, d, funcname ) \ +GENTPROT2R( double, float, double, d, s, d, tfuncname ) \ +GENTPROT2R( double, scomplex, double, d, c, d, tfuncname ) \ \ -GENTPROT2R( scomplex, double, float, c, d, s, funcname ) \ -GENTPROT2R( scomplex, dcomplex, float, c, z, s, funcname ) \ +GENTPROT2R( scomplex, double, float, c, d, s, tfuncname ) \ +GENTPROT2R( scomplex, dcomplex, float, c, z, s, tfuncname ) \ \ -GENTPROT2R( dcomplex, float, double, z, s, d, funcname ) \ -GENTPROT2R( dcomplex, scomplex, double, z, c, d, funcname ) +GENTPROT2R( dcomplex, float, double, z, s, d, tfuncname ) \ +GENTPROT2R( dcomplex, scomplex, double, z, c, d, tfuncname ) + +// -- (one auxiliary argument) -- + +#define INSERT_GENTPROT2R_MIX_P( tfuncname, varname ) \ +\ +GENTPROT2R( float, double, float, s, d, s, tfuncname, varname ) \ +GENTPROT2R( float, dcomplex, float, s, z, s, tfuncname, varname ) \ +\ +GENTPROT2R( double, float, double, d, s, d, tfuncname, varname ) \ +GENTPROT2R( double, scomplex, double, d, c, d, tfuncname, varname ) \ +\ +GENTPROT2R( scomplex, double, float, c, d, s, tfuncname, varname ) \ +GENTPROT2R( scomplex, dcomplex, float, c, z, s, tfuncname, varname ) \ +\ +GENTPROT2R( dcomplex, float, double, z, s, d, tfuncname, varname ) \ +GENTPROT2R( dcomplex, scomplex, double, z, c, d, tfuncname, varname ) - -// -- Macros for functions with three primarcy operands ------------------------ +// -- Macros for functions with three primary operands ------------------------- // -- Basic three-operand macro -- diff --git a/frame/include/bli_kernel_macro_defs.h b/frame/include/bli_kernel_macro_defs.h index 3f9064c57..9ee0aa395 100644 --- a/frame/include/bli_kernel_macro_defs.h +++ b/frame/include/bli_kernel_macro_defs.h @@ -36,7 +36,26 @@ #define BLIS_KERNEL_MACRO_DEFS_H -// -- MEMORY ALLOCATION -------------------------------------------------------- +// -- Define default threading parameters -------------------------------------- + +#ifndef BLIS_DEFAULT_M_THREAD_RATIO +#define BLIS_DEFAULT_M_THREAD_RATIO 2 +#endif + +#ifndef BLIS_DEFAULT_N_THREAD_RATIO +#define BLIS_DEFAULT_N_THREAD_RATIO 1 +#endif + +#ifndef BLIS_DEFAULT_MR_THREAD_MAX +#define BLIS_DEFAULT_MR_THREAD_MAX 1 +#endif + +#ifndef BLIS_DEFAULT_NR_THREAD_MAX +#define BLIS_DEFAULT_NR_THREAD_MAX 4 +#endif + + +// -- Memory allocation -------------------------------------------------------- // Memory allocation functions. These macros define the three types of // malloc()-style functions, and their free() counterparts: one for each @@ -79,20 +98,27 @@ #define BLIS_FREE_USER free #endif +// -- Other system-related definitions ----------------------------------------- + // Size of a virtual memory page. This is used to align blocks within the // memory pools. #ifndef BLIS_PAGE_SIZE #define BLIS_PAGE_SIZE 4096 #endif -// Number of named SIMD vector registers available for use. +// The maximum number of named SIMD vector registers available for use. +// When configuring with umbrella configuration families, this should be +// set to the maximum number of registers across all sub-configurations in +// the family. #ifndef BLIS_SIMD_NUM_REGISTERS -#define BLIS_SIMD_NUM_REGISTERS 16 +#define BLIS_SIMD_NUM_REGISTERS 32 #endif -// Size (in bytes) of each SIMD vector. +// The maximum size (in bytes) of each SIMD vector. +// When configuring with umbrella configuration families, this should be +// set to the maximum SIMD size across all sub-configurations in the family. #ifndef BLIS_SIMD_SIZE -#define BLIS_SIMD_SIZE 32 +#define BLIS_SIMD_SIZE 64 #endif // Alignment size (in bytes) needed by the instruction set for aligned @@ -130,1321 +156,6 @@ #define BLIS_POOL_ADDR_ALIGN_SIZE BLIS_PAGE_SIZE -// -- Define row access bools -------------------------------------------------- -// In this section we consider each datatype-specific "prefers contiguous rows" -// macro. If it is defined, we re-define it to be 1 (TRUE); otherwise, we -// define it to be 0 (FALSE). - -// gemm micro-kernels - -#ifdef BLIS_SGEMM_UKERNEL_PREFERS_CONTIG_ROWS -#undef BLIS_SGEMM_UKERNEL_PREFERS_CONTIG_ROWS -#define BLIS_SGEMM_UKERNEL_PREFERS_CONTIG_ROWS 1 -#else -#define BLIS_SGEMM_UKERNEL_PREFERS_CONTIG_ROWS 0 -#endif - -#ifdef BLIS_DGEMM_UKERNEL_PREFERS_CONTIG_ROWS -#undef BLIS_DGEMM_UKERNEL_PREFERS_CONTIG_ROWS -#define BLIS_DGEMM_UKERNEL_PREFERS_CONTIG_ROWS 1 -#else -#define BLIS_DGEMM_UKERNEL_PREFERS_CONTIG_ROWS 0 -#endif - -#ifdef BLIS_CGEMM_UKERNEL_PREFERS_CONTIG_ROWS -#undef BLIS_CGEMM_UKERNEL_PREFERS_CONTIG_ROWS -#define BLIS_CGEMM_UKERNEL_PREFERS_CONTIG_ROWS 1 -#else -#define BLIS_CGEMM_UKERNEL_PREFERS_CONTIG_ROWS 0 -#endif - -#ifdef BLIS_ZGEMM_UKERNEL_PREFERS_CONTIG_ROWS -#undef BLIS_ZGEMM_UKERNEL_PREFERS_CONTIG_ROWS -#define BLIS_ZGEMM_UKERNEL_PREFERS_CONTIG_ROWS 1 -#else -#define BLIS_ZGEMM_UKERNEL_PREFERS_CONTIG_ROWS 0 -#endif - - -// -- Define default kernel names ---------------------------------------------- - -// In this section we consider each datatype-specific micro-kernel macro; -// if it is undefined, we define it to be the corresponding reference kernel. -// In the case of complex gemm micro-kernels, we also define special macros -// so that later on we can tell whether or not to employ the induced -// implementations. Note that in order to properly determine whether the -// induced method is a viable option, we need to be able to test the -// existence of the real gemm micro-kernels, which means we must consider -// the complex gemm micro-kernel cases *BEFORE* the real cases. - -// -// Level-3 -// - -// gemm micro-kernels - -#ifndef BLIS_CGEMM_UKERNEL -#define BLIS_CGEMM_UKERNEL BLIS_CGEMM_UKERNEL_REF -#ifdef BLIS_SGEMM_UKERNEL -#define BLIS_ENABLE_INDUCED_SCOMPLEX -#endif -#else -#endif - -#ifndef BLIS_ZGEMM_UKERNEL -#define BLIS_ZGEMM_UKERNEL BLIS_ZGEMM_UKERNEL_REF -#ifdef BLIS_DGEMM_UKERNEL -#define BLIS_ENABLE_INDUCED_DCOMPLEX -#endif -#endif - -#ifndef BLIS_SGEMM_UKERNEL -#define BLIS_SGEMM_UKERNEL BLIS_SGEMM_UKERNEL_REF -#endif - -#ifndef BLIS_DGEMM_UKERNEL -#define BLIS_DGEMM_UKERNEL BLIS_DGEMM_UKERNEL_REF -#endif - -// gemmtrsm_l micro-kernels - -#ifndef BLIS_SGEMMTRSM_L_UKERNEL -#define BLIS_SGEMMTRSM_L_UKERNEL BLIS_SGEMMTRSM_L_UKERNEL_REF -#endif - -#ifndef BLIS_DGEMMTRSM_L_UKERNEL -#define BLIS_DGEMMTRSM_L_UKERNEL BLIS_DGEMMTRSM_L_UKERNEL_REF -#endif - -#ifndef BLIS_CGEMMTRSM_L_UKERNEL -#define BLIS_CGEMMTRSM_L_UKERNEL BLIS_CGEMMTRSM_L_UKERNEL_REF -#endif - -#ifndef BLIS_ZGEMMTRSM_L_UKERNEL -#define BLIS_ZGEMMTRSM_L_UKERNEL BLIS_ZGEMMTRSM_L_UKERNEL_REF -#endif - -// gemmtrsm_u micro-kernels - -#ifndef BLIS_SGEMMTRSM_U_UKERNEL -#define BLIS_SGEMMTRSM_U_UKERNEL BLIS_SGEMMTRSM_U_UKERNEL_REF -#endif - -#ifndef BLIS_DGEMMTRSM_U_UKERNEL -#define BLIS_DGEMMTRSM_U_UKERNEL BLIS_DGEMMTRSM_U_UKERNEL_REF -#endif - -#ifndef BLIS_CGEMMTRSM_U_UKERNEL -#define BLIS_CGEMMTRSM_U_UKERNEL BLIS_CGEMMTRSM_U_UKERNEL_REF -#endif - -#ifndef BLIS_ZGEMMTRSM_U_UKERNEL -#define BLIS_ZGEMMTRSM_U_UKERNEL BLIS_ZGEMMTRSM_U_UKERNEL_REF -#endif - -// trsm_l micro-kernels - -#ifndef BLIS_STRSM_L_UKERNEL -#define BLIS_STRSM_L_UKERNEL BLIS_STRSM_L_UKERNEL_REF -#endif - -#ifndef BLIS_DTRSM_L_UKERNEL -#define BLIS_DTRSM_L_UKERNEL BLIS_DTRSM_L_UKERNEL_REF -#endif - -#ifndef BLIS_CTRSM_L_UKERNEL -#define BLIS_CTRSM_L_UKERNEL BLIS_CTRSM_L_UKERNEL_REF -#endif - -#ifndef BLIS_ZTRSM_L_UKERNEL -#define BLIS_ZTRSM_L_UKERNEL BLIS_ZTRSM_L_UKERNEL_REF -#endif - -// trsm_u micro-kernels - -#ifndef BLIS_STRSM_U_UKERNEL -#define BLIS_STRSM_U_UKERNEL BLIS_STRSM_U_UKERNEL_REF -#endif - -#ifndef BLIS_DTRSM_U_UKERNEL -#define BLIS_DTRSM_U_UKERNEL BLIS_DTRSM_U_UKERNEL_REF -#endif - -#ifndef BLIS_CTRSM_U_UKERNEL -#define BLIS_CTRSM_U_UKERNEL BLIS_CTRSM_U_UKERNEL_REF -#endif - -#ifndef BLIS_ZTRSM_U_UKERNEL -#define BLIS_ZTRSM_U_UKERNEL BLIS_ZTRSM_U_UKERNEL_REF -#endif - -// -// Level-1m -// - -// packm_2xk kernels - -#ifndef BLIS_SPACKM_2XK_KERNEL -#define BLIS_SPACKM_2XK_KERNEL BLIS_SPACKM_2XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_2XK_KERNEL -#define BLIS_DPACKM_2XK_KERNEL BLIS_DPACKM_2XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_2XK_KERNEL -#define BLIS_CPACKM_2XK_KERNEL BLIS_CPACKM_2XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_2XK_KERNEL -#define BLIS_ZPACKM_2XK_KERNEL BLIS_ZPACKM_2XK_KERNEL_REF -#endif - -// packm_3xk kernels - -#ifndef BLIS_SPACKM_3XK_KERNEL -#define BLIS_SPACKM_3XK_KERNEL BLIS_SPACKM_3XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_3XK_KERNEL -#define BLIS_DPACKM_3XK_KERNEL BLIS_DPACKM_3XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_3XK_KERNEL -#define BLIS_CPACKM_3XK_KERNEL BLIS_CPACKM_3XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_3XK_KERNEL -#define BLIS_ZPACKM_3XK_KERNEL BLIS_ZPACKM_3XK_KERNEL_REF -#endif - -// packm_4xk kernels - -#ifndef BLIS_SPACKM_4XK_KERNEL -#define BLIS_SPACKM_4XK_KERNEL BLIS_SPACKM_4XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_4XK_KERNEL -#define BLIS_DPACKM_4XK_KERNEL BLIS_DPACKM_4XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_4XK_KERNEL -#define BLIS_CPACKM_4XK_KERNEL BLIS_CPACKM_4XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_4XK_KERNEL -#define BLIS_ZPACKM_4XK_KERNEL BLIS_ZPACKM_4XK_KERNEL_REF -#endif - -// packm_6xk kernels - -#ifndef BLIS_SPACKM_6XK_KERNEL -#define BLIS_SPACKM_6XK_KERNEL BLIS_SPACKM_6XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_6XK_KERNEL -#define BLIS_DPACKM_6XK_KERNEL BLIS_DPACKM_6XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_6XK_KERNEL -#define BLIS_CPACKM_6XK_KERNEL BLIS_CPACKM_6XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_6XK_KERNEL -#define BLIS_ZPACKM_6XK_KERNEL BLIS_ZPACKM_6XK_KERNEL_REF -#endif - -// packm_8xk kernels - -#ifndef BLIS_SPACKM_8XK_KERNEL -#define BLIS_SPACKM_8XK_KERNEL BLIS_SPACKM_8XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_8XK_KERNEL -#define BLIS_DPACKM_8XK_KERNEL BLIS_DPACKM_8XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_8XK_KERNEL -#define BLIS_CPACKM_8XK_KERNEL BLIS_CPACKM_8XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_8XK_KERNEL -#define BLIS_ZPACKM_8XK_KERNEL BLIS_ZPACKM_8XK_KERNEL_REF -#endif - -// packm_10xk kernels - -#ifndef BLIS_SPACKM_10XK_KERNEL -#define BLIS_SPACKM_10XK_KERNEL BLIS_SPACKM_10XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_10XK_KERNEL -#define BLIS_DPACKM_10XK_KERNEL BLIS_DPACKM_10XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_10XK_KERNEL -#define BLIS_CPACKM_10XK_KERNEL BLIS_CPACKM_10XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_10XK_KERNEL -#define BLIS_ZPACKM_10XK_KERNEL BLIS_ZPACKM_10XK_KERNEL_REF -#endif - -// packm_12xk kernels - -#ifndef BLIS_SPACKM_12XK_KERNEL -#define BLIS_SPACKM_12XK_KERNEL BLIS_SPACKM_12XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_12XK_KERNEL -#define BLIS_DPACKM_12XK_KERNEL BLIS_DPACKM_12XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_12XK_KERNEL -#define BLIS_CPACKM_12XK_KERNEL BLIS_CPACKM_12XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_12XK_KERNEL -#define BLIS_ZPACKM_12XK_KERNEL BLIS_ZPACKM_12XK_KERNEL_REF -#endif - -// packm_14xk kernels - -#ifndef BLIS_SPACKM_14XK_KERNEL -#define BLIS_SPACKM_14XK_KERNEL BLIS_SPACKM_14XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_14XK_KERNEL -#define BLIS_DPACKM_14XK_KERNEL BLIS_DPACKM_14XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_14XK_KERNEL -#define BLIS_CPACKM_14XK_KERNEL BLIS_CPACKM_14XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_14XK_KERNEL -#define BLIS_ZPACKM_14XK_KERNEL BLIS_ZPACKM_14XK_KERNEL_REF -#endif - -// packm_16xk kernels - -#ifndef BLIS_SPACKM_16XK_KERNEL -#define BLIS_SPACKM_16XK_KERNEL BLIS_SPACKM_16XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_16XK_KERNEL -#define BLIS_DPACKM_16XK_KERNEL BLIS_DPACKM_16XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_16XK_KERNEL -#define BLIS_CPACKM_16XK_KERNEL BLIS_CPACKM_16XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_16XK_KERNEL -#define BLIS_ZPACKM_16XK_KERNEL BLIS_ZPACKM_16XK_KERNEL_REF -#endif - -// packm_24xk kernels - -#ifndef BLIS_SPACKM_24XK_KERNEL -#define BLIS_SPACKM_24XK_KERNEL BLIS_SPACKM_24XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_24XK_KERNEL -#define BLIS_DPACKM_24XK_KERNEL BLIS_DPACKM_24XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_24XK_KERNEL -#define BLIS_CPACKM_24XK_KERNEL BLIS_CPACKM_24XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_24XK_KERNEL -#define BLIS_ZPACKM_24XK_KERNEL BLIS_ZPACKM_24XK_KERNEL_REF -#endif - -// packm_30xk kernels - -#ifndef BLIS_SPACKM_30XK_KERNEL -#define BLIS_SPACKM_30XK_KERNEL BLIS_SPACKM_30XK_KERNEL_REF -#endif - -#ifndef BLIS_DPACKM_30XK_KERNEL -#define BLIS_DPACKM_30XK_KERNEL BLIS_DPACKM_30XK_KERNEL_REF -#endif - -#ifndef BLIS_CPACKM_30XK_KERNEL -#define BLIS_CPACKM_30XK_KERNEL BLIS_CPACKM_30XK_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_30XK_KERNEL -#define BLIS_ZPACKM_30XK_KERNEL BLIS_ZPACKM_30XK_KERNEL_REF -#endif - -// unpackm_2xk kernels - -#ifndef BLIS_SUNPACKM_2XK_KERNEL -#define BLIS_SUNPACKM_2XK_KERNEL BLIS_SUNPACKM_2XK_KERNEL_REF -#endif - -#ifndef BLIS_DUNPACKM_2XK_KERNEL -#define BLIS_DUNPACKM_2XK_KERNEL BLIS_DUNPACKM_2XK_KERNEL_REF -#endif - -#ifndef BLIS_CUNPACKM_2XK_KERNEL -#define BLIS_CUNPACKM_2XK_KERNEL BLIS_CUNPACKM_2XK_KERNEL_REF -#endif - -#ifndef BLIS_ZUNPACKM_2XK_KERNEL -#define BLIS_ZUNPACKM_2XK_KERNEL BLIS_ZUNPACKM_2XK_KERNEL_REF -#endif - -// unpackm_4xk kernels - -#ifndef BLIS_SUNPACKM_4XK_KERNEL -#define BLIS_SUNPACKM_4XK_KERNEL BLIS_SUNPACKM_4XK_KERNEL_REF -#endif - -#ifndef BLIS_DUNPACKM_4XK_KERNEL -#define BLIS_DUNPACKM_4XK_KERNEL BLIS_DUNPACKM_4XK_KERNEL_REF -#endif - -#ifndef BLIS_CUNPACKM_4XK_KERNEL -#define BLIS_CUNPACKM_4XK_KERNEL BLIS_CUNPACKM_4XK_KERNEL_REF -#endif - -#ifndef BLIS_ZUNPACKM_4XK_KERNEL -#define BLIS_ZUNPACKM_4XK_KERNEL BLIS_ZUNPACKM_4XK_KERNEL_REF -#endif - -// unpackm_6xk kernels - -#ifndef BLIS_SUNPACKM_6XK_KERNEL -#define BLIS_SUNPACKM_6XK_KERNEL BLIS_SUNPACKM_6XK_KERNEL_REF -#endif - -#ifndef BLIS_DUNPACKM_6XK_KERNEL -#define BLIS_DUNPACKM_6XK_KERNEL BLIS_DUNPACKM_6XK_KERNEL_REF -#endif - -#ifndef BLIS_CUNPACKM_6XK_KERNEL -#define BLIS_CUNPACKM_6XK_KERNEL BLIS_CUNPACKM_6XK_KERNEL_REF -#endif - -#ifndef BLIS_ZUNPACKM_6XK_KERNEL -#define BLIS_ZUNPACKM_6XK_KERNEL BLIS_ZUNPACKM_6XK_KERNEL_REF -#endif - -// unpackm_8xk kernels - -#ifndef BLIS_SUNPACKM_8XK_KERNEL -#define BLIS_SUNPACKM_8XK_KERNEL BLIS_SUNPACKM_8XK_KERNEL_REF -#endif - -#ifndef BLIS_DUNPACKM_8XK_KERNEL -#define BLIS_DUNPACKM_8XK_KERNEL BLIS_DUNPACKM_8XK_KERNEL_REF -#endif - -#ifndef BLIS_CUNPACKM_8XK_KERNEL -#define BLIS_CUNPACKM_8XK_KERNEL BLIS_CUNPACKM_8XK_KERNEL_REF -#endif - -#ifndef BLIS_ZUNPACKM_8XK_KERNEL -#define BLIS_ZUNPACKM_8XK_KERNEL BLIS_ZUNPACKM_8XK_KERNEL_REF -#endif - -// unpackm_10xk kernels - -#ifndef BLIS_SUNPACKM_10XK_KERNEL -#define BLIS_SUNPACKM_10XK_KERNEL BLIS_SUNPACKM_10XK_KERNEL_REF -#endif - -#ifndef BLIS_DUNPACKM_10XK_KERNEL -#define BLIS_DUNPACKM_10XK_KERNEL BLIS_DUNPACKM_10XK_KERNEL_REF -#endif - -#ifndef BLIS_CUNPACKM_10XK_KERNEL -#define BLIS_CUNPACKM_10XK_KERNEL BLIS_CUNPACKM_10XK_KERNEL_REF -#endif - -#ifndef BLIS_ZUNPACKM_10XK_KERNEL -#define BLIS_ZUNPACKM_10XK_KERNEL BLIS_ZUNPACKM_10XK_KERNEL_REF -#endif - -// unpackm_12xk kernels - -#ifndef BLIS_SUNPACKM_12XK_KERNEL -#define BLIS_SUNPACKM_12XK_KERNEL BLIS_SUNPACKM_12XK_KERNEL_REF -#endif - -#ifndef BLIS_DUNPACKM_12XK_KERNEL -#define BLIS_DUNPACKM_12XK_KERNEL BLIS_DUNPACKM_12XK_KERNEL_REF -#endif - -#ifndef BLIS_CUNPACKM_12XK_KERNEL -#define BLIS_CUNPACKM_12XK_KERNEL BLIS_CUNPACKM_12XK_KERNEL_REF -#endif - -#ifndef BLIS_ZUNPACKM_12XK_KERNEL -#define BLIS_ZUNPACKM_12XK_KERNEL BLIS_ZUNPACKM_12XK_KERNEL_REF -#endif - -// unpackm_14xk kernels - -#ifndef BLIS_SUNPACKM_14XK_KERNEL -#define BLIS_SUNPACKM_14XK_KERNEL BLIS_SUNPACKM_14XK_KERNEL_REF -#endif - -#ifndef BLIS_DUNPACKM_14XK_KERNEL -#define BLIS_DUNPACKM_14XK_KERNEL BLIS_DUNPACKM_14XK_KERNEL_REF -#endif - -#ifndef BLIS_CUNPACKM_14XK_KERNEL -#define BLIS_CUNPACKM_14XK_KERNEL BLIS_CUNPACKM_14XK_KERNEL_REF -#endif - -#ifndef BLIS_ZUNPACKM_14XK_KERNEL -#define BLIS_ZUNPACKM_14XK_KERNEL BLIS_ZUNPACKM_14XK_KERNEL_REF -#endif - -// unpackm_16xk kernels - -#ifndef BLIS_SUNPACKM_16XK_KERNEL -#define BLIS_SUNPACKM_16XK_KERNEL BLIS_SUNPACKM_16XK_KERNEL_REF -#endif - -#ifndef BLIS_DUNPACKM_16XK_KERNEL -#define BLIS_DUNPACKM_16XK_KERNEL BLIS_DUNPACKM_16XK_KERNEL_REF -#endif - -#ifndef BLIS_CUNPACKM_16XK_KERNEL -#define BLIS_CUNPACKM_16XK_KERNEL BLIS_CUNPACKM_16XK_KERNEL_REF -#endif - -#ifndef BLIS_ZUNPACKM_16XK_KERNEL -#define BLIS_ZUNPACKM_16XK_KERNEL BLIS_ZUNPACKM_16XK_KERNEL_REF -#endif - -// -// Level-1f -// - -// axpy2v kernels - -#ifndef BLIS_SAXPY2V_KERNEL -#define BLIS_SAXPY2V_KERNEL BLIS_SAXPY2V_KERNEL_REF -#endif - -#ifndef BLIS_DAXPY2V_KERNEL -#define BLIS_DAXPY2V_KERNEL BLIS_DAXPY2V_KERNEL_REF -#endif - -#ifndef BLIS_CAXPY2V_KERNEL -#define BLIS_CAXPY2V_KERNEL BLIS_CAXPY2V_KERNEL_REF -#endif - -#ifndef BLIS_ZAXPY2V_KERNEL -#define BLIS_ZAXPY2V_KERNEL BLIS_ZAXPY2V_KERNEL_REF -#endif - -// dotaxpyv kernels - -#ifndef BLIS_SDOTAXPYV_KERNEL -#define BLIS_SDOTAXPYV_KERNEL BLIS_SDOTAXPYV_KERNEL_REF -#endif - -#ifndef BLIS_DDOTAXPYV_KERNEL -#define BLIS_DDOTAXPYV_KERNEL BLIS_DDOTAXPYV_KERNEL_REF -#endif - -#ifndef BLIS_CDOTAXPYV_KERNEL -#define BLIS_CDOTAXPYV_KERNEL BLIS_CDOTAXPYV_KERNEL_REF -#endif - -#ifndef BLIS_ZDOTAXPYV_KERNEL -#define BLIS_ZDOTAXPYV_KERNEL BLIS_ZDOTAXPYV_KERNEL_REF -#endif - -// axpyf kernels - -#ifndef BLIS_SAXPYF_KERNEL -#define BLIS_SAXPYF_KERNEL BLIS_SAXPYF_KERNEL_REF -#endif - -#ifndef BLIS_DAXPYF_KERNEL -#define BLIS_DAXPYF_KERNEL BLIS_DAXPYF_KERNEL_REF -#endif - -#ifndef BLIS_CAXPYF_KERNEL -#define BLIS_CAXPYF_KERNEL BLIS_CAXPYF_KERNEL_REF -#endif - -#ifndef BLIS_ZAXPYF_KERNEL -#define BLIS_ZAXPYF_KERNEL BLIS_ZAXPYF_KERNEL_REF -#endif - -// dotxf kernels - -#ifndef BLIS_SDOTXF_KERNEL -#define BLIS_SDOTXF_KERNEL BLIS_SDOTXF_KERNEL_REF -#endif - -#ifndef BLIS_DDOTXF_KERNEL -#define BLIS_DDOTXF_KERNEL BLIS_DDOTXF_KERNEL_REF -#endif - -#ifndef BLIS_CDOTXF_KERNEL -#define BLIS_CDOTXF_KERNEL BLIS_CDOTXF_KERNEL_REF -#endif - -#ifndef BLIS_ZDOTXF_KERNEL -#define BLIS_ZDOTXF_KERNEL BLIS_ZDOTXF_KERNEL_REF -#endif - -// dotxaxpyf kernels - -#ifndef BLIS_SDOTXAXPYF_KERNEL -#define BLIS_SDOTXAXPYF_KERNEL BLIS_SDOTXAXPYF_KERNEL_REF -#endif - -#ifndef BLIS_DDOTXAXPYF_KERNEL -#define BLIS_DDOTXAXPYF_KERNEL BLIS_DDOTXAXPYF_KERNEL_REF -#endif - -#ifndef BLIS_CDOTXAXPYF_KERNEL -#define BLIS_CDOTXAXPYF_KERNEL BLIS_CDOTXAXPYF_KERNEL_REF -#endif - -#ifndef BLIS_ZDOTXAXPYF_KERNEL -#define BLIS_ZDOTXAXPYF_KERNEL BLIS_ZDOTXAXPYF_KERNEL_REF -#endif - -// -// Level-1v -// - -// amaxv kernels - -#ifndef BLIS_SAMAXV_KERNEL -#define BLIS_SAMAXV_KERNEL BLIS_SAMAXV_KERNEL_REF -#endif - -#ifndef BLIS_DAMAXV_KERNEL -#define BLIS_DAMAXV_KERNEL BLIS_DAMAXV_KERNEL_REF -#endif - -#ifndef BLIS_CAMAXV_KERNEL -#define BLIS_CAMAXV_KERNEL BLIS_CAMAXV_KERNEL_REF -#endif - -#ifndef BLIS_ZAMAXV_KERNEL -#define BLIS_ZAMAXV_KERNEL BLIS_ZAMAXV_KERNEL_REF -#endif - -// addv kernels - -#ifndef BLIS_SADDV_KERNEL -#define BLIS_SADDV_KERNEL BLIS_SADDV_KERNEL_REF -#endif - -#ifndef BLIS_DADDV_KERNEL -#define BLIS_DADDV_KERNEL BLIS_DADDV_KERNEL_REF -#endif - -#ifndef BLIS_CADDV_KERNEL -#define BLIS_CADDV_KERNEL BLIS_CADDV_KERNEL_REF -#endif - -#ifndef BLIS_ZADDV_KERNEL -#define BLIS_ZADDV_KERNEL BLIS_ZADDV_KERNEL_REF -#endif - -// axpbyv kernels - -#ifndef BLIS_SAXPBYV_KERNEL -#define BLIS_SAXPBYV_KERNEL BLIS_SAXPBYV_KERNEL_REF -#endif - -#ifndef BLIS_DAXPBYV_KERNEL -#define BLIS_DAXPBYV_KERNEL BLIS_DAXPBYV_KERNEL_REF -#endif - -#ifndef BLIS_CAXPBYV_KERNEL -#define BLIS_CAXPBYV_KERNEL BLIS_CAXPBYV_KERNEL_REF -#endif - -#ifndef BLIS_ZAXPBYV_KERNEL -#define BLIS_ZAXPBYV_KERNEL BLIS_ZAXPBYV_KERNEL_REF -#endif - -// axpyv kernels - -#ifndef BLIS_SAXPYV_KERNEL -#define BLIS_SAXPYV_KERNEL BLIS_SAXPYV_KERNEL_REF -#endif - -#ifndef BLIS_DAXPYV_KERNEL -#define BLIS_DAXPYV_KERNEL BLIS_DAXPYV_KERNEL_REF -#endif - -#ifndef BLIS_CAXPYV_KERNEL -#define BLIS_CAXPYV_KERNEL BLIS_CAXPYV_KERNEL_REF -#endif - -#ifndef BLIS_ZAXPYV_KERNEL -#define BLIS_ZAXPYV_KERNEL BLIS_ZAXPYV_KERNEL_REF -#endif - -// copyv kernels - -#ifndef BLIS_SCOPYV_KERNEL -#define BLIS_SCOPYV_KERNEL BLIS_SCOPYV_KERNEL_REF -#endif - -#ifndef BLIS_DCOPYV_KERNEL -#define BLIS_DCOPYV_KERNEL BLIS_DCOPYV_KERNEL_REF -#endif - -#ifndef BLIS_CCOPYV_KERNEL -#define BLIS_CCOPYV_KERNEL BLIS_CCOPYV_KERNEL_REF -#endif - -#ifndef BLIS_ZCOPYV_KERNEL -#define BLIS_ZCOPYV_KERNEL BLIS_ZCOPYV_KERNEL_REF -#endif - -// dotv kernels - -#ifndef BLIS_SDOTV_KERNEL -#define BLIS_SDOTV_KERNEL BLIS_SDOTV_KERNEL_REF -#endif - -#ifndef BLIS_DDOTV_KERNEL -#define BLIS_DDOTV_KERNEL BLIS_DDOTV_KERNEL_REF -#endif - -#ifndef BLIS_CDOTV_KERNEL -#define BLIS_CDOTV_KERNEL BLIS_CDOTV_KERNEL_REF -#endif - -#ifndef BLIS_ZDOTV_KERNEL -#define BLIS_ZDOTV_KERNEL BLIS_ZDOTV_KERNEL_REF -#endif - -// dotxv kernels - -#ifndef BLIS_SDOTXV_KERNEL -#define BLIS_SDOTXV_KERNEL BLIS_SDOTXV_KERNEL_REF -#endif - -#ifndef BLIS_DDOTXV_KERNEL -#define BLIS_DDOTXV_KERNEL BLIS_DDOTXV_KERNEL_REF -#endif - -#ifndef BLIS_CDOTXV_KERNEL -#define BLIS_CDOTXV_KERNEL BLIS_CDOTXV_KERNEL_REF -#endif - -#ifndef BLIS_ZDOTXV_KERNEL -#define BLIS_ZDOTXV_KERNEL BLIS_ZDOTXV_KERNEL_REF -#endif - -// invertv kernels - -#ifndef BLIS_SINVERTV_KERNEL -#define BLIS_SINVERTV_KERNEL BLIS_SINVERTV_KERNEL_REF -#endif - -#ifndef BLIS_DINVERTV_KERNEL -#define BLIS_DINVERTV_KERNEL BLIS_DINVERTV_KERNEL_REF -#endif - -#ifndef BLIS_CINVERTV_KERNEL -#define BLIS_CINVERTV_KERNEL BLIS_CINVERTV_KERNEL_REF -#endif - -#ifndef BLIS_ZINVERTV_KERNEL -#define BLIS_ZINVERTV_KERNEL BLIS_ZINVERTV_KERNEL_REF -#endif - -// scal2v kernels - -#ifndef BLIS_SSCAL2V_KERNEL -#define BLIS_SSCAL2V_KERNEL BLIS_SSCAL2V_KERNEL_REF -#endif - -#ifndef BLIS_DSCAL2V_KERNEL -#define BLIS_DSCAL2V_KERNEL BLIS_DSCAL2V_KERNEL_REF #endif -#ifndef BLIS_CSCAL2V_KERNEL -#define BLIS_CSCAL2V_KERNEL BLIS_CSCAL2V_KERNEL_REF -#endif - -#ifndef BLIS_ZSCAL2V_KERNEL -#define BLIS_ZSCAL2V_KERNEL BLIS_ZSCAL2V_KERNEL_REF -#endif - -// scalv kernels - -#ifndef BLIS_SSCALV_KERNEL -#define BLIS_SSCALV_KERNEL BLIS_SSCALV_KERNEL_REF -#endif - -#ifndef BLIS_DSCALV_KERNEL -#define BLIS_DSCALV_KERNEL BLIS_DSCALV_KERNEL_REF -#endif - -#ifndef BLIS_CSCALV_KERNEL -#define BLIS_CSCALV_KERNEL BLIS_CSCALV_KERNEL_REF -#endif - -#ifndef BLIS_ZSCALV_KERNEL -#define BLIS_ZSCALV_KERNEL BLIS_ZSCALV_KERNEL_REF -#endif - -// setv kernels - -#ifndef BLIS_SSETV_KERNEL -#define BLIS_SSETV_KERNEL BLIS_SSETV_KERNEL_REF -#endif - -#ifndef BLIS_DSETV_KERNEL -#define BLIS_DSETV_KERNEL BLIS_DSETV_KERNEL_REF -#endif - -#ifndef BLIS_CSETV_KERNEL -#define BLIS_CSETV_KERNEL BLIS_CSETV_KERNEL_REF -#endif - -#ifndef BLIS_ZSETV_KERNEL -#define BLIS_ZSETV_KERNEL BLIS_ZSETV_KERNEL_REF -#endif - -// subv kernels - -#ifndef BLIS_SSUBV_KERNEL -#define BLIS_SSUBV_KERNEL BLIS_SSUBV_KERNEL_REF -#endif - -#ifndef BLIS_DSUBV_KERNEL -#define BLIS_DSUBV_KERNEL BLIS_DSUBV_KERNEL_REF -#endif - -#ifndef BLIS_CSUBV_KERNEL -#define BLIS_CSUBV_KERNEL BLIS_CSUBV_KERNEL_REF -#endif - -#ifndef BLIS_ZSUBV_KERNEL -#define BLIS_ZSUBV_KERNEL BLIS_ZSUBV_KERNEL_REF -#endif - -// swapv kernels - -#ifndef BLIS_SSWAPV_KERNEL -#define BLIS_SSWAPV_KERNEL BLIS_SSWAPV_KERNEL_REF -#endif - -#ifndef BLIS_DSWAPV_KERNEL -#define BLIS_DSWAPV_KERNEL BLIS_DSWAPV_KERNEL_REF -#endif - -#ifndef BLIS_CSWAPV_KERNEL -#define BLIS_CSWAPV_KERNEL BLIS_CSWAPV_KERNEL_REF -#endif - -#ifndef BLIS_ZSWAPV_KERNEL -#define BLIS_ZSWAPV_KERNEL BLIS_ZSWAPV_KERNEL_REF -#endif - -// xpbyv kernels - -#ifndef BLIS_SXPBYV_KERNEL -#define BLIS_SXPBYV_KERNEL BLIS_SXPBYV_KERNEL_REF -#endif - -#ifndef BLIS_DXPBYV_KERNEL -#define BLIS_DXPBYV_KERNEL BLIS_DXPBYV_KERNEL_REF -#endif - -#ifndef BLIS_CXPBYV_KERNEL -#define BLIS_CXPBYV_KERNEL BLIS_CXPBYV_KERNEL_REF -#endif - -#ifndef BLIS_ZXPBYV_KERNEL -#define BLIS_ZXPBYV_KERNEL BLIS_ZXPBYV_KERNEL_REF -#endif - - -// -- Define default blocksize macros ------------------------------------------ - -// -// Define level-3 cache blocksizes. -// - -// Define MC minimum - -#ifndef BLIS_DEFAULT_MC_S -#define BLIS_DEFAULT_MC_S 512 -#endif - -#ifndef BLIS_DEFAULT_MC_D -#define BLIS_DEFAULT_MC_D 256 -#endif - -#ifndef BLIS_DEFAULT_MC_C -#define BLIS_DEFAULT_MC_C 256 -#endif - -#ifndef BLIS_DEFAULT_MC_Z -#define BLIS_DEFAULT_MC_Z 128 -#endif - -// Define KC minimum - -#ifndef BLIS_DEFAULT_KC_S -#define BLIS_DEFAULT_KC_S 256 -#endif - -#ifndef BLIS_DEFAULT_KC_D -#define BLIS_DEFAULT_KC_D 256 -#endif - -#ifndef BLIS_DEFAULT_KC_C -#define BLIS_DEFAULT_KC_C 256 -#endif - -#ifndef BLIS_DEFAULT_KC_Z -#define BLIS_DEFAULT_KC_Z 256 -#endif - -// Define NC minimum - -#ifndef BLIS_DEFAULT_NC_S -#define BLIS_DEFAULT_NC_S 4096 -#endif - -#ifndef BLIS_DEFAULT_NC_D -#define BLIS_DEFAULT_NC_D 4096 -#endif - -#ifndef BLIS_DEFAULT_NC_C -#define BLIS_DEFAULT_NC_C 4096 -#endif - -#ifndef BLIS_DEFAULT_NC_Z -#define BLIS_DEFAULT_NC_Z 4096 -#endif - -// Define MC maximum - -#ifndef BLIS_MAXIMUM_MC_S -#define BLIS_MAXIMUM_MC_S BLIS_DEFAULT_MC_S -#endif - -#ifndef BLIS_MAXIMUM_MC_D -#define BLIS_MAXIMUM_MC_D BLIS_DEFAULT_MC_D -#endif - -#ifndef BLIS_MAXIMUM_MC_C -#define BLIS_MAXIMUM_MC_C BLIS_DEFAULT_MC_C -#endif - -#ifndef BLIS_MAXIMUM_MC_Z -#define BLIS_MAXIMUM_MC_Z BLIS_DEFAULT_MC_Z -#endif - -// Define KC maximum - -#ifndef BLIS_MAXIMUM_KC_S -#define BLIS_MAXIMUM_KC_S BLIS_DEFAULT_KC_S -#endif - -#ifndef BLIS_MAXIMUM_KC_D -#define BLIS_MAXIMUM_KC_D BLIS_DEFAULT_KC_D -#endif - -#ifndef BLIS_MAXIMUM_KC_C -#define BLIS_MAXIMUM_KC_C BLIS_DEFAULT_KC_C -#endif - -#ifndef BLIS_MAXIMUM_KC_Z -#define BLIS_MAXIMUM_KC_Z BLIS_DEFAULT_KC_Z -#endif - -// Define NC maximum - -#ifndef BLIS_MAXIMUM_NC_S -#define BLIS_MAXIMUM_NC_S BLIS_DEFAULT_NC_S -#endif - -#ifndef BLIS_MAXIMUM_NC_D -#define BLIS_MAXIMUM_NC_D BLIS_DEFAULT_NC_D -#endif - -#ifndef BLIS_MAXIMUM_NC_C -#define BLIS_MAXIMUM_NC_C BLIS_DEFAULT_NC_C -#endif - -#ifndef BLIS_MAXIMUM_NC_Z -#define BLIS_MAXIMUM_NC_Z BLIS_DEFAULT_NC_Z -#endif - -// -// Define level-3 register blocksizes. -// - -// Define MR - -#ifndef BLIS_DEFAULT_MR_S -#define BLIS_DEFAULT_MR_S 8 -#endif - -#ifndef BLIS_DEFAULT_MR_D -#define BLIS_DEFAULT_MR_D 4 -#endif - -#ifndef BLIS_DEFAULT_MR_C -#define BLIS_DEFAULT_MR_C 4 -#endif - -#ifndef BLIS_DEFAULT_MR_Z -#define BLIS_DEFAULT_MR_Z 2 -#endif - -// Define NR - -#ifndef BLIS_DEFAULT_NR_S -#define BLIS_DEFAULT_NR_S 4 -#endif - -#ifndef BLIS_DEFAULT_NR_D -#define BLIS_DEFAULT_NR_D 4 -#endif - -#ifndef BLIS_DEFAULT_NR_C -#define BLIS_DEFAULT_NR_C 2 -#endif - -#ifndef BLIS_DEFAULT_NR_Z -#define BLIS_DEFAULT_NR_Z 2 -#endif - -// Define KR - -#ifndef BLIS_DEFAULT_KR_S -#define BLIS_DEFAULT_KR_S 1 -#endif - -#ifndef BLIS_DEFAULT_KR_D -#define BLIS_DEFAULT_KR_D 1 -#endif - -#ifndef BLIS_DEFAULT_KR_C -#define BLIS_DEFAULT_KR_C 1 -#endif - -#ifndef BLIS_DEFAULT_KR_Z -#define BLIS_DEFAULT_KR_Z 1 -#endif - -// Define MR packdim - -#ifndef BLIS_PACKDIM_MR_S -#define BLIS_PACKDIM_MR_S BLIS_DEFAULT_MR_S -#endif - -#ifndef BLIS_PACKDIM_MR_D -#define BLIS_PACKDIM_MR_D BLIS_DEFAULT_MR_D -#endif - -#ifndef BLIS_PACKDIM_MR_C -#define BLIS_PACKDIM_MR_C BLIS_DEFAULT_MR_C -#endif - -#ifndef BLIS_PACKDIM_MR_Z -#define BLIS_PACKDIM_MR_Z BLIS_DEFAULT_MR_Z -#endif - -// Define NR packdim - -#ifndef BLIS_PACKDIM_NR_S -#define BLIS_PACKDIM_NR_S BLIS_DEFAULT_NR_S -#endif - -#ifndef BLIS_PACKDIM_NR_D -#define BLIS_PACKDIM_NR_D BLIS_DEFAULT_NR_D -#endif - -#ifndef BLIS_PACKDIM_NR_C -#define BLIS_PACKDIM_NR_C BLIS_DEFAULT_NR_C -#endif - -#ifndef BLIS_PACKDIM_NR_Z -#define BLIS_PACKDIM_NR_Z BLIS_DEFAULT_NR_Z -#endif - -// Define KR packdim - -#ifndef BLIS_PACKDIM_KR_S -#define BLIS_PACKDIM_KR_S BLIS_DEFAULT_KR_S -#endif - -#ifndef BLIS_PACKDIM_KR_D -#define BLIS_PACKDIM_KR_D BLIS_DEFAULT_KR_D -#endif - -#ifndef BLIS_PACKDIM_KR_C -#define BLIS_PACKDIM_KR_C BLIS_DEFAULT_KR_C -#endif - -#ifndef BLIS_PACKDIM_KR_Z -#define BLIS_PACKDIM_KR_Z BLIS_DEFAULT_KR_Z -#endif - -// -// Define level-2 blocksizes. -// - -// NOTE: These values determine high-level cache blocking for level-2 -// operations ONLY. So, if gemv is performed with a 2000x2000 matrix A and -// M2 = N2 = 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.) - -#ifndef BLIS_DEFAULT_M2_S -#define BLIS_DEFAULT_M2_S 1000 -#endif - -#ifndef BLIS_DEFAULT_N2_S -#define BLIS_DEFAULT_N2_S 1000 -#endif - -#ifndef BLIS_DEFAULT_M2_D -#define BLIS_DEFAULT_M2_D 1000 -#endif - -#ifndef BLIS_DEFAULT_N2_D -#define BLIS_DEFAULT_N2_D 1000 -#endif - -#ifndef BLIS_DEFAULT_M2_C -#define BLIS_DEFAULT_M2_C 1000 -#endif - -#ifndef BLIS_DEFAULT_N2_C -#define BLIS_DEFAULT_N2_C 1000 -#endif - -#ifndef BLIS_DEFAULT_M2_Z -#define BLIS_DEFAULT_M2_Z 1000 -#endif - -#ifndef BLIS_DEFAULT_N2_Z -#define BLIS_DEFAULT_N2_Z 1000 -#endif - -// -// Define level-1f fusing factors. -// - -// Global level-1f fusing factors. - -#ifndef BLIS_DEFAULT_1F_S -#define BLIS_DEFAULT_1F_S 8 -#endif - -#ifndef BLIS_DEFAULT_1F_D -#define BLIS_DEFAULT_1F_D 4 -#endif - -#ifndef BLIS_DEFAULT_1F_C -#define BLIS_DEFAULT_1F_C 4 -#endif - -#ifndef BLIS_DEFAULT_1F_Z -#define BLIS_DEFAULT_1F_Z 2 -#endif - -// axpyf - -#ifndef BLIS_DEFAULT_AF_S -#define BLIS_DEFAULT_AF_S BLIS_DEFAULT_1F_S -#endif - -#ifndef BLIS_DEFAULT_AF_D -#define BLIS_DEFAULT_AF_D BLIS_DEFAULT_1F_D -#endif - -#ifndef BLIS_DEFAULT_AF_C -#define BLIS_DEFAULT_AF_C BLIS_DEFAULT_1F_C -#endif - -#ifndef BLIS_DEFAULT_AF_Z -#define BLIS_DEFAULT_AF_Z BLIS_DEFAULT_1F_Z -#endif - -// dotxf - -#ifndef BLIS_DEFAULT_DF_S -#define BLIS_DEFAULT_DF_S BLIS_DEFAULT_1F_S -#endif - -#ifndef BLIS_DEFAULT_DF_D -#define BLIS_DEFAULT_DF_D BLIS_DEFAULT_1F_D -#endif - -#ifndef BLIS_DEFAULT_DF_C -#define BLIS_DEFAULT_DF_C BLIS_DEFAULT_1F_C -#endif - -#ifndef BLIS_DEFAULT_DF_Z -#define BLIS_DEFAULT_DF_Z BLIS_DEFAULT_1F_Z -#endif - -// dotxaxpyf - -#ifndef BLIS_DEFAULT_XF_S -#define BLIS_DEFAULT_XF_S BLIS_DEFAULT_1F_S -#endif - -#ifndef BLIS_DEFAULT_XF_D -#define BLIS_DEFAULT_XF_D BLIS_DEFAULT_1F_D -#endif - -#ifndef BLIS_DEFAULT_XF_C -#define BLIS_DEFAULT_XF_C BLIS_DEFAULT_1F_C -#endif - -#ifndef BLIS_DEFAULT_XF_Z -#define BLIS_DEFAULT_XF_Z BLIS_DEFAULT_1F_Z -#endif - -// -// Define level-1v blocksizes. -// - -// NOTE: Register blocksizes for vectors are used when packing -// non-contiguous vectors. Similar to that of KR, they can -// typically be set to 1. - -#ifndef BLIS_DEFAULT_VF_S -#define BLIS_DEFAULT_VF_S 1 -#endif - -#ifndef BLIS_DEFAULT_VF_D -#define BLIS_DEFAULT_VF_D 1 -#endif - -#ifndef BLIS_DEFAULT_VF_C -#define BLIS_DEFAULT_VF_C 1 -#endif - -#ifndef BLIS_DEFAULT_VF_Z -#define BLIS_DEFAULT_VF_Z 1 -#endif - - -// -- Define default threading parameters -------------------------------------- - - -#ifndef BLIS_DEFAULT_M_THREAD_RATIO -#define BLIS_DEFAULT_M_THREAD_RATIO 2 -#endif - -#ifndef BLIS_DEFAULT_N_THREAD_RATIO -#define BLIS_DEFAULT_N_THREAD_RATIO 1 -#endif - -#ifndef BLIS_DEFAULT_MR_THREAD_MAX -#define BLIS_DEFAULT_MR_THREAD_MAX 1 -#endif - -#ifndef BLIS_DEFAULT_NR_THREAD_MAX -#define BLIS_DEFAULT_NR_THREAD_MAX 4 -#endif - - -// -- Kernel blocksize checks -------------------------------------------------- - -// Verify that cache blocksizes are whole multiples of register blocksizes. -// Specifically, verify that: -// - MC is a whole multiple of MR. -// - NC is a whole multiple of NR. -// - KC is a whole multiple of KR. -// These constraints are enforced because it makes it easier to handle diagonals -// in the macro-kernel implementations. Additionally, we optionally verify that: -// - MC is a whole multiple of NR. -// - NC is a whole multiple of MR. -// These latter constraints, guarded by #ifndef BLIS_RELAX_MCNR_NCMR_CONSTRAINTS -// below, are only enforced when we wish to be able to handle the trsm right- -// side case handling that swaps A and B, so that B is the triangular matrix, -// with NR blocking used to pack A and MR blocking used to pack B, with the -// arguments to the gemmtrsm microkernel swapped at the last minute, as the -// kernel is called. - -// -// MC must be a whole multiple of MR and NR. -// - -#if ( \ - ( BLIS_DEFAULT_MC_S % BLIS_DEFAULT_MR_S != 0 ) || \ - ( BLIS_DEFAULT_MC_D % BLIS_DEFAULT_MR_D != 0 ) || \ - ( BLIS_DEFAULT_MC_C % BLIS_DEFAULT_MR_C != 0 ) || \ - ( BLIS_DEFAULT_MC_Z % BLIS_DEFAULT_MR_Z != 0 ) \ - ) - #error "MC must be multiple of MR for all datatypes." -#endif - -#ifndef BLIS_RELAX_MCNR_NCMR_CONSTRAINTS -#if ( \ - ( BLIS_DEFAULT_MC_S % BLIS_DEFAULT_NR_S != 0 ) || \ - ( BLIS_DEFAULT_MC_D % BLIS_DEFAULT_NR_D != 0 ) || \ - ( BLIS_DEFAULT_MC_C % BLIS_DEFAULT_NR_C != 0 ) || \ - ( BLIS_DEFAULT_MC_Z % BLIS_DEFAULT_NR_Z != 0 ) \ - ) - #error "MC must be multiple of NR for all datatypes." -#endif -#endif - -// -// NC must be a whole multiple of NR and MR. -// - -#if ( \ - ( BLIS_DEFAULT_NC_S % BLIS_DEFAULT_NR_S != 0 ) || \ - ( BLIS_DEFAULT_NC_D % BLIS_DEFAULT_NR_D != 0 ) || \ - ( BLIS_DEFAULT_NC_C % BLIS_DEFAULT_NR_C != 0 ) || \ - ( BLIS_DEFAULT_NC_Z % BLIS_DEFAULT_NR_Z != 0 ) \ - ) - #error "NC must be multiple of NR for all datatypes." -#endif - -#ifndef BLIS_RELAX_MCNR_NCMR_CONSTRAINTS -#if ( \ - ( BLIS_DEFAULT_NC_S % BLIS_DEFAULT_MR_S != 0 ) || \ - ( BLIS_DEFAULT_NC_D % BLIS_DEFAULT_MR_D != 0 ) || \ - ( BLIS_DEFAULT_NC_C % BLIS_DEFAULT_MR_C != 0 ) || \ - ( BLIS_DEFAULT_NC_Z % BLIS_DEFAULT_MR_Z != 0 ) \ - ) - #error "NC must be multiple of MR for all datatypes." -#endif -#endif - -// -// KC must be a whole multiple of KR. -// - -#if ( \ - ( BLIS_DEFAULT_KC_S % BLIS_DEFAULT_KR_S != 0 ) || \ - ( BLIS_DEFAULT_KC_D % BLIS_DEFAULT_KR_D != 0 ) || \ - ( BLIS_DEFAULT_KC_C % BLIS_DEFAULT_KR_C != 0 ) || \ - ( BLIS_DEFAULT_KC_Z % BLIS_DEFAULT_KR_Z != 0 ) \ - ) - #error "KC must be multiple of KR for all datatypes." -#endif - - -#endif diff --git a/frame/include/bli_kernel_pre_macro_defs.h b/frame/include/bli_kernel_pre_macro_defs.h deleted file mode 100644 index a65fc435d..000000000 --- a/frame/include/bli_kernel_pre_macro_defs.h +++ /dev/null @@ -1,364 +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_PRE_MACRO_DEFS_H -#define BLIS_KERNEL_PRE_MACRO_DEFS_H - -// -- Reference kernel definitions --------------------------------------------- - -// -// Level-3 -// - -// gemm micro-kernels - -#define BLIS_SGEMM_UKERNEL_REF bli_sgemm_ukr_ref -#define BLIS_DGEMM_UKERNEL_REF bli_dgemm_ukr_ref -#define BLIS_CGEMM_UKERNEL_REF bli_cgemm_ukr_ref -#define BLIS_ZGEMM_UKERNEL_REF bli_zgemm_ukr_ref - -// gemmtrsm_l micro-kernels - -#define BLIS_SGEMMTRSM_L_UKERNEL_REF bli_sgemmtrsm_l_ukr_ref -#define BLIS_DGEMMTRSM_L_UKERNEL_REF bli_dgemmtrsm_l_ukr_ref -#define BLIS_CGEMMTRSM_L_UKERNEL_REF bli_cgemmtrsm_l_ukr_ref -#define BLIS_ZGEMMTRSM_L_UKERNEL_REF bli_zgemmtrsm_l_ukr_ref - -// gemmtrsm_u micro-kernels - -#define BLIS_SGEMMTRSM_U_UKERNEL_REF bli_sgemmtrsm_u_ukr_ref -#define BLIS_DGEMMTRSM_U_UKERNEL_REF bli_dgemmtrsm_u_ukr_ref -#define BLIS_CGEMMTRSM_U_UKERNEL_REF bli_cgemmtrsm_u_ukr_ref -#define BLIS_ZGEMMTRSM_U_UKERNEL_REF bli_zgemmtrsm_u_ukr_ref - -// trsm_l micro-kernels - -#define BLIS_STRSM_L_UKERNEL_REF bli_strsm_l_ukr_ref -#define BLIS_DTRSM_L_UKERNEL_REF bli_dtrsm_l_ukr_ref -#define BLIS_CTRSM_L_UKERNEL_REF bli_ctrsm_l_ukr_ref -#define BLIS_ZTRSM_L_UKERNEL_REF bli_ztrsm_l_ukr_ref - -// trsm_u micro-kernels - -#define BLIS_STRSM_U_UKERNEL_REF bli_strsm_u_ukr_ref -#define BLIS_DTRSM_U_UKERNEL_REF bli_dtrsm_u_ukr_ref -#define BLIS_CTRSM_U_UKERNEL_REF bli_ctrsm_u_ukr_ref -#define BLIS_ZTRSM_U_UKERNEL_REF bli_ztrsm_u_ukr_ref - -// -// Level-1m -// - -// packm_2xk kernels - -#define BLIS_SPACKM_2XK_KERNEL_REF bli_spackm_2xk_ref -#define BLIS_DPACKM_2XK_KERNEL_REF bli_dpackm_2xk_ref -#define BLIS_CPACKM_2XK_KERNEL_REF bli_cpackm_2xk_ref -#define BLIS_ZPACKM_2XK_KERNEL_REF bli_zpackm_2xk_ref - -// packm_3xk kernels - -#define BLIS_SPACKM_3XK_KERNEL_REF bli_spackm_3xk_ref -#define BLIS_DPACKM_3XK_KERNEL_REF bli_dpackm_3xk_ref -#define BLIS_CPACKM_3XK_KERNEL_REF bli_cpackm_3xk_ref -#define BLIS_ZPACKM_3XK_KERNEL_REF bli_zpackm_3xk_ref - -// packm_4xk kernels - -#define BLIS_SPACKM_4XK_KERNEL_REF bli_spackm_4xk_ref -#define BLIS_DPACKM_4XK_KERNEL_REF bli_dpackm_4xk_ref -#define BLIS_CPACKM_4XK_KERNEL_REF bli_cpackm_4xk_ref -#define BLIS_ZPACKM_4XK_KERNEL_REF bli_zpackm_4xk_ref - -// packm_6xk kernels - -#define BLIS_SPACKM_6XK_KERNEL_REF bli_spackm_6xk_ref -#define BLIS_DPACKM_6XK_KERNEL_REF bli_dpackm_6xk_ref -#define BLIS_CPACKM_6XK_KERNEL_REF bli_cpackm_6xk_ref -#define BLIS_ZPACKM_6XK_KERNEL_REF bli_zpackm_6xk_ref - -// packm_8xk kernels - -#define BLIS_SPACKM_8XK_KERNEL_REF bli_spackm_8xk_ref -#define BLIS_DPACKM_8XK_KERNEL_REF bli_dpackm_8xk_ref -#define BLIS_CPACKM_8XK_KERNEL_REF bli_cpackm_8xk_ref -#define BLIS_ZPACKM_8XK_KERNEL_REF bli_zpackm_8xk_ref - -// packm_10xk kernels - -#define BLIS_SPACKM_10XK_KERNEL_REF bli_spackm_10xk_ref -#define BLIS_DPACKM_10XK_KERNEL_REF bli_dpackm_10xk_ref -#define BLIS_CPACKM_10XK_KERNEL_REF bli_cpackm_10xk_ref -#define BLIS_ZPACKM_10XK_KERNEL_REF bli_zpackm_10xk_ref - -// packm_12xk kernels - -#define BLIS_SPACKM_12XK_KERNEL_REF bli_spackm_12xk_ref -#define BLIS_DPACKM_12XK_KERNEL_REF bli_dpackm_12xk_ref -#define BLIS_CPACKM_12XK_KERNEL_REF bli_cpackm_12xk_ref -#define BLIS_ZPACKM_12XK_KERNEL_REF bli_zpackm_12xk_ref - -// packm_14xk kernels - -#define BLIS_SPACKM_14XK_KERNEL_REF bli_spackm_14xk_ref -#define BLIS_DPACKM_14XK_KERNEL_REF bli_dpackm_14xk_ref -#define BLIS_CPACKM_14XK_KERNEL_REF bli_cpackm_14xk_ref -#define BLIS_ZPACKM_14XK_KERNEL_REF bli_zpackm_14xk_ref - -// packm_16xk kernels - -#define BLIS_SPACKM_16XK_KERNEL_REF bli_spackm_16xk_ref -#define BLIS_DPACKM_16XK_KERNEL_REF bli_dpackm_16xk_ref -#define BLIS_CPACKM_16XK_KERNEL_REF bli_cpackm_16xk_ref -#define BLIS_ZPACKM_16XK_KERNEL_REF bli_zpackm_16xk_ref - -// packm_24xk kernels - -#define BLIS_SPACKM_24XK_KERNEL_REF bli_spackm_24xk_ref -#define BLIS_DPACKM_24XK_KERNEL_REF bli_dpackm_24xk_ref -#define BLIS_CPACKM_24XK_KERNEL_REF bli_cpackm_24xk_ref -#define BLIS_ZPACKM_24XK_KERNEL_REF bli_zpackm_24xk_ref - -// packm_30xk kernels - -#define BLIS_SPACKM_30XK_KERNEL_REF bli_spackm_30xk_ref -#define BLIS_DPACKM_30XK_KERNEL_REF bli_dpackm_30xk_ref -#define BLIS_CPACKM_30XK_KERNEL_REF bli_cpackm_30xk_ref -#define BLIS_ZPACKM_30XK_KERNEL_REF bli_zpackm_30xk_ref - -// unpack_2xk kernels - -#define BLIS_SUNPACKM_2XK_KERNEL_REF bli_sunpackm_2xk_ref -#define BLIS_DUNPACKM_2XK_KERNEL_REF bli_dunpackm_2xk_ref -#define BLIS_CUNPACKM_2XK_KERNEL_REF bli_cunpackm_2xk_ref -#define BLIS_ZUNPACKM_2XK_KERNEL_REF bli_zunpackm_2xk_ref - -// unpack_4xk kernels - -#define BLIS_SUNPACKM_4XK_KERNEL_REF bli_sunpackm_4xk_ref -#define BLIS_DUNPACKM_4XK_KERNEL_REF bli_dunpackm_4xk_ref -#define BLIS_CUNPACKM_4XK_KERNEL_REF bli_cunpackm_4xk_ref -#define BLIS_ZUNPACKM_4XK_KERNEL_REF bli_zunpackm_4xk_ref - -// unpack_6xk kernels - -#define BLIS_SUNPACKM_6XK_KERNEL_REF bli_sunpackm_6xk_ref -#define BLIS_DUNPACKM_6XK_KERNEL_REF bli_dunpackm_6xk_ref -#define BLIS_CUNPACKM_6XK_KERNEL_REF bli_cunpackm_6xk_ref -#define BLIS_ZUNPACKM_6XK_KERNEL_REF bli_zunpackm_6xk_ref - -// unpack_8xk kernels - -#define BLIS_SUNPACKM_8XK_KERNEL_REF bli_sunpackm_8xk_ref -#define BLIS_DUNPACKM_8XK_KERNEL_REF bli_dunpackm_8xk_ref -#define BLIS_CUNPACKM_8XK_KERNEL_REF bli_cunpackm_8xk_ref -#define BLIS_ZUNPACKM_8XK_KERNEL_REF bli_zunpackm_8xk_ref - -// unpack_10xk kernels - -#define BLIS_SUNPACKM_10XK_KERNEL_REF bli_sunpackm_10xk_ref -#define BLIS_DUNPACKM_10XK_KERNEL_REF bli_dunpackm_10xk_ref -#define BLIS_CUNPACKM_10XK_KERNEL_REF bli_cunpackm_10xk_ref -#define BLIS_ZUNPACKM_10XK_KERNEL_REF bli_zunpackm_10xk_ref - -// unpack_12xk kernels - -#define BLIS_SUNPACKM_12XK_KERNEL_REF bli_sunpackm_12xk_ref -#define BLIS_DUNPACKM_12XK_KERNEL_REF bli_dunpackm_12xk_ref -#define BLIS_CUNPACKM_12XK_KERNEL_REF bli_cunpackm_12xk_ref -#define BLIS_ZUNPACKM_12XK_KERNEL_REF bli_zunpackm_12xk_ref - -// unpack_14xk kernels - -#define BLIS_SUNPACKM_14XK_KERNEL_REF bli_sunpackm_14xk_ref -#define BLIS_DUNPACKM_14XK_KERNEL_REF bli_dunpackm_14xk_ref -#define BLIS_CUNPACKM_14XK_KERNEL_REF bli_cunpackm_14xk_ref -#define BLIS_ZUNPACKM_14XK_KERNEL_REF bli_zunpackm_14xk_ref - -// unpack_16xk kernels - -#define BLIS_SUNPACKM_16XK_KERNEL_REF bli_sunpackm_16xk_ref -#define BLIS_DUNPACKM_16XK_KERNEL_REF bli_dunpackm_16xk_ref -#define BLIS_CUNPACKM_16XK_KERNEL_REF bli_cunpackm_16xk_ref -#define BLIS_ZUNPACKM_16XK_KERNEL_REF bli_zunpackm_16xk_ref - -// -// Level-1f -// - -// axpy2v kernels - -#define BLIS_SAXPY2V_KERNEL_REF bli_saxpy2v_ref -#define BLIS_DAXPY2V_KERNEL_REF bli_daxpy2v_ref -#define BLIS_CAXPY2V_KERNEL_REF bli_caxpy2v_ref -#define BLIS_ZAXPY2V_KERNEL_REF bli_zaxpy2v_ref - -// dotaxpyv kernels - -#define BLIS_SDOTAXPYV_KERNEL_REF bli_sdotaxpyv_ref -#define BLIS_DDOTAXPYV_KERNEL_REF bli_ddotaxpyv_ref -#define BLIS_CDOTAXPYV_KERNEL_REF bli_cdotaxpyv_ref -#define BLIS_ZDOTAXPYV_KERNEL_REF bli_zdotaxpyv_ref - -// axpyf kernels - -#define BLIS_SAXPYF_KERNEL_REF bli_saxpyf_ref -#define BLIS_DAXPYF_KERNEL_REF bli_daxpyf_ref -#define BLIS_CAXPYF_KERNEL_REF bli_caxpyf_ref -#define BLIS_ZAXPYF_KERNEL_REF bli_zaxpyf_ref - -// dotxf kernels - -#define BLIS_SDOTXF_KERNEL_REF bli_sdotxf_ref -#define BLIS_DDOTXF_KERNEL_REF bli_ddotxf_ref -#define BLIS_CDOTXF_KERNEL_REF bli_cdotxf_ref -#define BLIS_ZDOTXF_KERNEL_REF bli_zdotxf_ref - -// dotxaxpyf kernels - -//#define BLIS_SDOTXAXPYF_KERNEL_REF bli_sdotxaxpyf_ref_var1 -//#define BLIS_DDOTXAXPYF_KERNEL_REF bli_ddotxaxpyf_ref_var1 -//#define BLIS_CDOTXAXPYF_KERNEL_REF bli_cdotxaxpyf_ref_var1 -//#define BLIS_ZDOTXAXPYF_KERNEL_REF bli_zdotxaxpyf_ref_var1 -#define BLIS_SDOTXAXPYF_KERNEL_REF bli_sdotxaxpyf_ref_var2 -#define BLIS_DDOTXAXPYF_KERNEL_REF bli_ddotxaxpyf_ref_var2 -#define BLIS_CDOTXAXPYF_KERNEL_REF bli_cdotxaxpyf_ref_var2 -#define BLIS_ZDOTXAXPYF_KERNEL_REF bli_zdotxaxpyf_ref_var2 - -// -// Level-1v -// - -// addv kernels - -#define BLIS_SADDV_KERNEL_REF bli_saddv_ref -#define BLIS_DADDV_KERNEL_REF bli_daddv_ref -#define BLIS_CADDV_KERNEL_REF bli_caddv_ref -#define BLIS_ZADDV_KERNEL_REF bli_zaddv_ref - -// amaxv kernels - -#define BLIS_SAMAXV_KERNEL_REF bli_samaxv_ref -#define BLIS_DAMAXV_KERNEL_REF bli_damaxv_ref -#define BLIS_CAMAXV_KERNEL_REF bli_camaxv_ref -#define BLIS_ZAMAXV_KERNEL_REF bli_zamaxv_ref - -// axpbyv kernels - -#define BLIS_SAXPBYV_KERNEL_REF bli_saxpbyv_ref -#define BLIS_DAXPBYV_KERNEL_REF bli_daxpbyv_ref -#define BLIS_CAXPBYV_KERNEL_REF bli_caxpbyv_ref -#define BLIS_ZAXPBYV_KERNEL_REF bli_zaxpbyv_ref - -// axpyv kernels - -#define BLIS_SAXPYV_KERNEL_REF bli_saxpyv_ref -#define BLIS_DAXPYV_KERNEL_REF bli_daxpyv_ref -#define BLIS_CAXPYV_KERNEL_REF bli_caxpyv_ref -#define BLIS_ZAXPYV_KERNEL_REF bli_zaxpyv_ref - -// copyv kernels - -#define BLIS_SCOPYV_KERNEL_REF bli_scopyv_ref -#define BLIS_DCOPYV_KERNEL_REF bli_dcopyv_ref -#define BLIS_CCOPYV_KERNEL_REF bli_ccopyv_ref -#define BLIS_ZCOPYV_KERNEL_REF bli_zcopyv_ref - -// dotv kernels - -#define BLIS_SDOTV_KERNEL_REF bli_sdotv_ref -#define BLIS_DDOTV_KERNEL_REF bli_ddotv_ref -#define BLIS_CDOTV_KERNEL_REF bli_cdotv_ref -#define BLIS_ZDOTV_KERNEL_REF bli_zdotv_ref - -// dotxv kernels - -#define BLIS_SDOTXV_KERNEL_REF bli_sdotxv_ref -#define BLIS_DDOTXV_KERNEL_REF bli_ddotxv_ref -#define BLIS_CDOTXV_KERNEL_REF bli_cdotxv_ref -#define BLIS_ZDOTXV_KERNEL_REF bli_zdotxv_ref - -// invertv kernels - -#define BLIS_SINVERTV_KERNEL_REF bli_sinvertv_ref -#define BLIS_DINVERTV_KERNEL_REF bli_dinvertv_ref -#define BLIS_CINVERTV_KERNEL_REF bli_cinvertv_ref -#define BLIS_ZINVERTV_KERNEL_REF bli_zinvertv_ref - -// scal2v kernels - -#define BLIS_SSCAL2V_KERNEL_REF bli_sscal2v_ref -#define BLIS_DSCAL2V_KERNEL_REF bli_dscal2v_ref -#define BLIS_CSCAL2V_KERNEL_REF bli_cscal2v_ref -#define BLIS_ZSCAL2V_KERNEL_REF bli_zscal2v_ref - -// scalv kernels - -#define BLIS_SSCALV_KERNEL_REF bli_sscalv_ref -#define BLIS_DSCALV_KERNEL_REF bli_dscalv_ref -#define BLIS_CSCALV_KERNEL_REF bli_cscalv_ref -#define BLIS_ZSCALV_KERNEL_REF bli_zscalv_ref - -// setv kernels - -#define BLIS_SSETV_KERNEL_REF bli_ssetv_ref -#define BLIS_DSETV_KERNEL_REF bli_dsetv_ref -#define BLIS_CSETV_KERNEL_REF bli_csetv_ref -#define BLIS_ZSETV_KERNEL_REF bli_zsetv_ref - -// subv kernels - -#define BLIS_SSUBV_KERNEL_REF bli_ssubv_ref -#define BLIS_DSUBV_KERNEL_REF bli_dsubv_ref -#define BLIS_CSUBV_KERNEL_REF bli_csubv_ref -#define BLIS_ZSUBV_KERNEL_REF bli_zsubv_ref - -// swapv kernels - -#define BLIS_SSWAPV_KERNEL_REF bli_sswapv_ref -#define BLIS_DSWAPV_KERNEL_REF bli_dswapv_ref -#define BLIS_CSWAPV_KERNEL_REF bli_cswapv_ref -#define BLIS_ZSWAPV_KERNEL_REF bli_zswapv_ref - -// xpbyv kernels - -#define BLIS_SXPBYV_KERNEL_REF bli_sxpbyv_ref -#define BLIS_DXPBYV_KERNEL_REF bli_dxpbyv_ref -#define BLIS_CXPBYV_KERNEL_REF bli_cxpbyv_ref -#define BLIS_ZXPBYV_KERNEL_REF bli_zxpbyv_ref - - - -#endif - diff --git a/frame/include/bli_kernel_prototypes.h b/frame/include/bli_kernel_prototypes.h deleted file mode 100644 index 7894140a8..000000000 --- a/frame/include/bli_kernel_prototypes.h +++ /dev/null @@ -1,241 +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_PROTOTYPES_H -#define BLIS_KERNEL_PROTOTYPES_H - -// Generate prototypes for level-3 micro-kernels. - -// -// Level-3 -// - -#define bli_sgemm_ukr_name BLIS_SGEMM_UKERNEL -#define bli_dgemm_ukr_name BLIS_DGEMM_UKERNEL -#define bli_cgemm_ukr_name BLIS_CGEMM_UKERNEL -#define bli_zgemm_ukr_name BLIS_ZGEMM_UKERNEL - -#define bli_sgemmtrsm_l_ukr_name BLIS_SGEMMTRSM_L_UKERNEL -#define bli_dgemmtrsm_l_ukr_name BLIS_DGEMMTRSM_L_UKERNEL -#define bli_cgemmtrsm_l_ukr_name BLIS_CGEMMTRSM_L_UKERNEL -#define bli_zgemmtrsm_l_ukr_name BLIS_ZGEMMTRSM_L_UKERNEL - -#define bli_sgemmtrsm_u_ukr_name BLIS_SGEMMTRSM_U_UKERNEL -#define bli_dgemmtrsm_u_ukr_name BLIS_DGEMMTRSM_U_UKERNEL -#define bli_cgemmtrsm_u_ukr_name BLIS_CGEMMTRSM_U_UKERNEL -#define bli_zgemmtrsm_u_ukr_name BLIS_ZGEMMTRSM_U_UKERNEL - -#define bli_strsm_l_ukr_name BLIS_STRSM_L_UKERNEL -#define bli_dtrsm_l_ukr_name BLIS_DTRSM_L_UKERNEL -#define bli_ctrsm_l_ukr_name BLIS_CTRSM_L_UKERNEL -#define bli_ztrsm_l_ukr_name BLIS_ZTRSM_L_UKERNEL - -#define bli_strsm_u_ukr_name BLIS_STRSM_U_UKERNEL -#define bli_dtrsm_u_ukr_name BLIS_DTRSM_U_UKERNEL -#define bli_ctrsm_u_ukr_name BLIS_CTRSM_U_UKERNEL -#define bli_ztrsm_u_ukr_name BLIS_ZTRSM_U_UKERNEL - -#include "bli_l3_ukr.h" - -// -// Level-1m -// - -#define bli_spackm_2xk_ker_name BLIS_SPACKM_2XK_KERNEL -#define bli_dpackm_2xk_ker_name BLIS_DPACKM_2XK_KERNEL -#define bli_cpackm_2xk_ker_name BLIS_CPACKM_2XK_KERNEL -#define bli_zpackm_2xk_ker_name BLIS_ZPACKM_2XK_KERNEL - -#define bli_spackm_3xk_ker_name BLIS_SPACKM_3XK_KERNEL -#define bli_dpackm_3xk_ker_name BLIS_DPACKM_3XK_KERNEL -#define bli_cpackm_3xk_ker_name BLIS_CPACKM_3XK_KERNEL -#define bli_zpackm_3xk_ker_name BLIS_ZPACKM_3XK_KERNEL - -#define bli_spackm_4xk_ker_name BLIS_SPACKM_4XK_KERNEL -#define bli_dpackm_4xk_ker_name BLIS_DPACKM_4XK_KERNEL -#define bli_cpackm_4xk_ker_name BLIS_CPACKM_4XK_KERNEL -#define bli_zpackm_4xk_ker_name BLIS_ZPACKM_4XK_KERNEL - -#define bli_spackm_6xk_ker_name BLIS_SPACKM_6XK_KERNEL -#define bli_dpackm_6xk_ker_name BLIS_DPACKM_6XK_KERNEL -#define bli_cpackm_6xk_ker_name BLIS_CPACKM_6XK_KERNEL -#define bli_zpackm_6xk_ker_name BLIS_ZPACKM_6XK_KERNEL - -#define bli_spackm_8xk_ker_name BLIS_SPACKM_8XK_KERNEL -#define bli_dpackm_8xk_ker_name BLIS_DPACKM_8XK_KERNEL -#define bli_cpackm_8xk_ker_name BLIS_CPACKM_8XK_KERNEL -#define bli_zpackm_8xk_ker_name BLIS_ZPACKM_8XK_KERNEL - -#define bli_spackm_10xk_ker_name BLIS_SPACKM_10XK_KERNEL -#define bli_dpackm_10xk_ker_name BLIS_DPACKM_10XK_KERNEL -#define bli_cpackm_10xk_ker_name BLIS_CPACKM_10XK_KERNEL -#define bli_zpackm_10xk_ker_name BLIS_ZPACKM_10XK_KERNEL - -#define bli_spackm_12xk_ker_name BLIS_SPACKM_12XK_KERNEL -#define bli_dpackm_12xk_ker_name BLIS_DPACKM_12XK_KERNEL -#define bli_cpackm_12xk_ker_name BLIS_CPACKM_12XK_KERNEL -#define bli_zpackm_12xk_ker_name BLIS_ZPACKM_12XK_KERNEL - -#define bli_spackm_14xk_ker_name BLIS_SPACKM_14XK_KERNEL -#define bli_dpackm_14xk_ker_name BLIS_DPACKM_14XK_KERNEL -#define bli_cpackm_14xk_ker_name BLIS_CPACKM_14XK_KERNEL -#define bli_zpackm_14xk_ker_name BLIS_ZPACKM_14XK_KERNEL - -#define bli_spackm_16xk_ker_name BLIS_SPACKM_16XK_KERNEL -#define bli_dpackm_16xk_ker_name BLIS_DPACKM_16XK_KERNEL -#define bli_cpackm_16xk_ker_name BLIS_CPACKM_16XK_KERNEL -#define bli_zpackm_16xk_ker_name BLIS_ZPACKM_16XK_KERNEL - -#define bli_spackm_24xk_ker_name BLIS_SPACKM_24XK_KERNEL -#define bli_dpackm_24xk_ker_name BLIS_DPACKM_24XK_KERNEL -#define bli_cpackm_24xk_ker_name BLIS_CPACKM_24XK_KERNEL -#define bli_zpackm_24xk_ker_name BLIS_ZPACKM_24XK_KERNEL - -#define bli_spackm_30xk_ker_name BLIS_SPACKM_30XK_KERNEL -#define bli_dpackm_30xk_ker_name BLIS_DPACKM_30XK_KERNEL -#define bli_cpackm_30xk_ker_name BLIS_CPACKM_30XK_KERNEL -#define bli_zpackm_30xk_ker_name BLIS_ZPACKM_30XK_KERNEL - -#include "bli_l1m_ker.h" - -// -// Level-1f -// - -#define bli_saxpy2v_ker_name BLIS_SAXPY2V_KERNEL -#define bli_daxpy2v_ker_name BLIS_DAXPY2V_KERNEL -#define bli_caxpy2v_ker_name BLIS_CAXPY2V_KERNEL -#define bli_zaxpy2v_ker_name BLIS_ZAXPY2V_KERNEL - -#define bli_sdotaxpyv_ker_name BLIS_SDOTAXPYV_KERNEL -#define bli_ddotaxpyv_ker_name BLIS_DDOTAXPYV_KERNEL -#define bli_cdotaxpyv_ker_name BLIS_CDOTAXPYV_KERNEL -#define bli_zdotaxpyv_ker_name BLIS_ZDOTAXPYV_KERNEL - -#define bli_sdotxf_ker_name BLIS_SDOTXF_KERNEL -#define bli_ddotxf_ker_name BLIS_DDOTXF_KERNEL -#define bli_cdotxf_ker_name BLIS_CDOTXF_KERNEL -#define bli_zdotxf_ker_name BLIS_ZDOTXF_KERNEL - -#define bli_saxpyf_ker_name BLIS_SAXPYF_KERNEL -#define bli_daxpyf_ker_name BLIS_DAXPYF_KERNEL -#define bli_caxpyf_ker_name BLIS_CAXPYF_KERNEL -#define bli_zaxpyf_ker_name BLIS_ZAXPYF_KERNEL - -#define bli_sdotxaxpyf_ker_name BLIS_SDOTXAXPYF_KERNEL -#define bli_ddotxaxpyf_ker_name BLIS_DDOTXAXPYF_KERNEL -#define bli_cdotxaxpyf_ker_name BLIS_CDOTXAXPYF_KERNEL -#define bli_zdotxaxpyf_ker_name BLIS_ZDOTXAXPYF_KERNEL - -#include "bli_l1f_ker.h" - -// -// Level-1v -// - -#define bli_saddv_ker_name BLIS_SADDV_KERNEL -#define bli_daddv_ker_name BLIS_DADDV_KERNEL -#define bli_caddv_ker_name BLIS_CADDV_KERNEL -#define bli_zaddv_ker_name BLIS_ZADDV_KERNEL - -#define bli_samaxv_ker_name BLIS_SAMAXV_KERNEL -#define bli_damaxv_ker_name BLIS_DAMAXV_KERNEL -#define bli_camaxv_ker_name BLIS_CAMAXV_KERNEL -#define bli_zamaxv_ker_name BLIS_ZAMAXV_KERNEL - -#define bli_saxpbyv_ker_name BLIS_SAXPBYV_KERNEL -#define bli_daxpbyv_ker_name BLIS_DAXPBYV_KERNEL -#define bli_caxpbyv_ker_name BLIS_CAXPBYV_KERNEL -#define bli_zaxpbyv_ker_name BLIS_ZAXPBYV_KERNEL - -#define bli_saxpyv_ker_name BLIS_SAXPYV_KERNEL -#define bli_daxpyv_ker_name BLIS_DAXPYV_KERNEL -#define bli_caxpyv_ker_name BLIS_CAXPYV_KERNEL -#define bli_zaxpyv_ker_name BLIS_ZAXPYV_KERNEL - -#define bli_scopyv_ker_name BLIS_SCOPYV_KERNEL -#define bli_dcopyv_ker_name BLIS_DCOPYV_KERNEL -#define bli_ccopyv_ker_name BLIS_CCOPYV_KERNEL -#define bli_zcopyv_ker_name BLIS_ZCOPYV_KERNEL - -#define bli_sdotv_ker_name BLIS_SDOTV_KERNEL -#define bli_ddotv_ker_name BLIS_DDOTV_KERNEL -#define bli_cdotv_ker_name BLIS_CDOTV_KERNEL -#define bli_zdotv_ker_name BLIS_ZDOTV_KERNEL - -#define bli_sdotxv_ker_name BLIS_SDOTXV_KERNEL -#define bli_ddotxv_ker_name BLIS_DDOTXV_KERNEL -#define bli_cdotxv_ker_name BLIS_CDOTXV_KERNEL -#define bli_zdotxv_ker_name BLIS_ZDOTXV_KERNEL - -#define bli_sinvertv_ker_name BLIS_SINVERTV_KERNEL -#define bli_dinvertv_ker_name BLIS_DINVERTV_KERNEL -#define bli_cinvertv_ker_name BLIS_CINVERTV_KERNEL -#define bli_zinvertv_ker_name BLIS_ZINVERTV_KERNEL - -#define bli_sscalv_ker_name BLIS_SSCALV_KERNEL -#define bli_dscalv_ker_name BLIS_DSCALV_KERNEL -#define bli_cscalv_ker_name BLIS_CSCALV_KERNEL -#define bli_zscalv_ker_name BLIS_ZSCALV_KERNEL - -#define bli_sscal2v_ker_name BLIS_SSCAL2V_KERNEL -#define bli_dscal2v_ker_name BLIS_DSCAL2V_KERNEL -#define bli_cscal2v_ker_name BLIS_CSCAL2V_KERNEL -#define bli_zscal2v_ker_name BLIS_ZSCAL2V_KERNEL - -#define bli_ssetv_ker_name BLIS_SSETV_KERNEL -#define bli_dsetv_ker_name BLIS_DSETV_KERNEL -#define bli_csetv_ker_name BLIS_CSETV_KERNEL -#define bli_zsetv_ker_name BLIS_ZSETV_KERNEL - -#define bli_ssubv_ker_name BLIS_SSUBV_KERNEL -#define bli_dsubv_ker_name BLIS_DSUBV_KERNEL -#define bli_csubv_ker_name BLIS_CSUBV_KERNEL -#define bli_zsubv_ker_name BLIS_ZSUBV_KERNEL - -#define bli_sswapv_ker_name BLIS_SSWAPV_KERNEL -#define bli_dswapv_ker_name BLIS_DSWAPV_KERNEL -#define bli_cswapv_ker_name BLIS_CSWAPV_KERNEL -#define bli_zswapv_ker_name BLIS_ZSWAPV_KERNEL - -#define bli_sxpbyv_ker_name BLIS_SXPBYV_KERNEL -#define bli_dxpbyv_ker_name BLIS_DXPBYV_KERNEL -#define bli_cxpbyv_ker_name BLIS_CXPBYV_KERNEL -#define bli_zxpbyv_ker_name BLIS_ZXPBYV_KERNEL - -#include "bli_l1v_ker.h" - - -#endif - diff --git a/frame/include/bli_macro_defs.h b/frame/include/bli_macro_defs.h index d99be2345..e58821149 100644 --- a/frame/include/bli_macro_defs.h +++ b/frame/include/bli_macro_defs.h @@ -104,6 +104,9 @@ #define PASTECH2_(ch1,ch2,op) ch1 ## ch2 ## op #define PASTECH2(ch1,ch2,op) PASTECH2_(ch1,ch2,op) +#define PASTECH3_(ch1,ch2,ch3,op) ch1 ## ch2 ## ch3 ## op +#define PASTECH3(ch1,ch2,ch3,op) PASTECH3_(ch1,ch2,ch3,op) + #define MKSTR(s1) #s1 #define STRINGIFY_INT( s ) MKSTR( s ) diff --git a/frame/include/bli_type_defs.h b/frame/include/bli_type_defs.h index 517a17b13..c15b0ed17 100644 --- a/frame/include/bli_type_defs.h +++ b/frame/include/bli_type_defs.h @@ -583,8 +583,6 @@ typedef enum typedef enum { BLIS_3MH = 0, - BLIS_3M3, - BLIS_3M2, BLIS_3M1, BLIS_4MH, BLIS_4M1B, @@ -595,6 +593,16 @@ typedef enum #define BLIS_NUM_IND_METHODS (BLIS_NAT+1) +// These are used in bli_*_oapi.c to construct the ind_t values from +// the induced method substrings that go into function names. +#define bli_3mh BLIS_3MH +#define bli_3m1 BLIS_3M1 +#define bli_4mh BLIS_4MH +#define bli_4mb BLIS_4M1B +#define bli_4m1 BLIS_4M1A +#define bli_1m BLIS_1M +#define bli_nat BLIS_NAT + // -- Kernel ID types -- @@ -780,6 +788,10 @@ typedef enum typedef enum { + // NOTE: the level-3 blocksizes MUST be indexed starting at zero. + // At one point, we made this assumption in bli_cntx_set_blkszs() + // and friends. + BLIS_KR = 0, BLIS_MR, BLIS_NR, @@ -798,6 +810,41 @@ typedef enum #define BLIS_NUM_BLKSZS 11 +// -- Architecture ID type -- + +typedef enum +{ + // Intel + BLIS_ARCH_KNL = 0, + BLIS_ARCH_KNC, + BLIS_ARCH_HASWELL, + BLIS_ARCH_SANDYBRIDGE, + BLIS_ARCH_PENRYN, + + // AMD + BLIS_ARCH_ZEN, + BLIS_ARCH_EXCAVATOR, + BLIS_ARCH_STEAMROLLER, + BLIS_ARCH_PILEDRIVER, + BLIS_ARCH_BULLDOZER, + + // ARM + BLIS_ARCH_CORTEXA57, + BLIS_ARCH_CORTEXA15, + BLIS_ARCH_CORTEXA9, + + // IBM/Power + BLIS_ARCH_POWER7, + BLIS_ARCH_BGQ, + + // Generic architecture/configuration + BLIS_ARCH_GENERIC + +} arch_t; + +#define BLIS_NUM_ARCHS 16 + + // // -- BLIS misc. structure types ----------------------------------------------- // @@ -1153,7 +1200,18 @@ typedef enum // Object-related errors BLIS_EXPECTED_OBJECT_ALIAS = (-130), - BLIS_ERROR_CODE_MAX = (-140) + // Architecture-related errors + BLIS_INVALID_ARCH_ID = (-140), + + // Blocksize-related errors + BLIS_MC_DEF_NONMULTIPLE_OF_MR = (-150), + BLIS_MC_MAX_NONMULTIPLE_OF_MR = (-151), + BLIS_NC_DEF_NONMULTIPLE_OF_NR = (-152), + BLIS_NC_MAX_NONMULTIPLE_OF_NR = (-153), + BLIS_KC_DEF_NONMULTIPLE_OF_KR = (-154), + BLIS_KC_MAX_NONMULTIPLE_OF_KR = (-155), + + BLIS_ERROR_CODE_MAX = (-160) } err_t; #endif diff --git a/frame/include/blis.h b/frame/include/blis.h index 6c8104e31..84308bf45 100644 --- a/frame/include/blis.h +++ b/frame/include/blis.h @@ -79,17 +79,17 @@ extern "C" { #include "bli_extern_defs.h" -// -- BLIS kernel definitions -- +// -- BLIS architecture/kernel definitions -- -#include "bli_kernel.h" +#include "bli_l1v_ker_prot.h" +#include "bli_l1f_ker_prot.h" +#include "bli_l1m_ker_prot.h" +#include "bli_l3_ukr_prot.h" -#include "bli_kernel_pre_macro_defs.h" -#include "bli_kernel_ind_pre_macro_defs.h" +#include "bli_arch_config_pre.h" +#include "bli_arch_config.h" #include "bli_kernel_macro_defs.h" -#include "bli_kernel_ind_macro_defs.h" - -#include "bli_kernel_prototypes.h" // -- Base operation prototypes -- @@ -98,6 +98,9 @@ extern "C" { #include "bli_const.h" #include "bli_obj.h" #include "bli_obj_scalar.h" +#include "bli_blksz.h" +#include "bli_func.h" +#include "bli_mbool.h" #include "bli_cntx.h" #include "bli_gks.h" #include "bli_ind.h" @@ -108,9 +111,6 @@ extern "C" { #include "bli_part.h" #include "bli_prune.h" #include "bli_query.h" -#include "bli_blksz.h" -#include "bli_func.h" -#include "bli_mbool.h" #include "bli_auxinfo.h" #include "bli_param_map.h" #include "bli_clock.h" @@ -122,6 +122,8 @@ extern "C" { #include "bli_opid.h" #include "bli_cntl.h" #include "bli_info.h" +#include "bli_arch.h" +#include "bli_cpuid.h" // -- Level-0 operations -- diff --git a/frame/ind/bli_ind.c b/frame/ind/bli_ind.c index f0aec685b..ef201571b 100644 --- a/frame/ind/bli_ind.c +++ b/frame/ind/bli_ind.c @@ -39,8 +39,6 @@ static bool_t bli_ind_is_init = FALSE; static char* bli_ind_impl_str[BLIS_NUM_IND_METHODS] = { /* 3mh */ "3mh", -/* 3m2 */ "3m3", -/* 3m2 */ "3m2", /* 3m1 */ "3m1", /* 4mh */ "4mh", /* 4m1b */ "4m1b", @@ -56,14 +54,16 @@ void bli_ind_init( void ) // If the API is already initialized, return early. if ( bli_ind_is_initialized() ) return; -#ifdef BLIS_ENABLE_INDUCED_SCOMPLEX - //bli_ind_enable_dt( BLIS_4M1A, BLIS_SCOMPLEX ); - bli_ind_enable_dt( BLIS_1M, BLIS_SCOMPLEX ); -#endif -#ifdef BLIS_ENABLE_INDUCED_DCOMPLEX - //bli_ind_enable_dt( BLIS_4M1A, BLIS_DCOMPLEX ); - bli_ind_enable_dt( BLIS_1M, BLIS_DCOMPLEX ); -#endif + // Enable the default induced method (1m) if one or both complex domain + // gemm micro-kernels are unoptimized in the native context. + cntx_t* cntx = bli_gks_query_cntx(); + bool_t c_is_ref = bli_gks_cntx_l3_nat_ukr_is_ref + ( BLIS_SCOMPLEX, BLIS_GEMM_UKR, cntx ); + bool_t z_is_ref = bli_gks_cntx_l3_nat_ukr_is_ref + ( BLIS_DCOMPLEX, BLIS_GEMM_UKR, cntx ); + + if ( c_is_ref ) bli_ind_enable_dt( BLIS_1M, BLIS_SCOMPLEX ); + if ( z_is_ref ) bli_ind_enable_dt( BLIS_1M, BLIS_DCOMPLEX ); // Mark API as initialized. bli_ind_is_init = TRUE; diff --git a/frame/ind/bli_ind.h b/frame/ind/bli_ind.h index e0ceb383b..32e907e91 100644 --- a/frame/ind/bli_ind.h +++ b/frame/ind/bli_ind.h @@ -48,13 +48,7 @@ #include "bli_l3_ind_opt.h" // level-3 cntx initialization -#include "bli_gemmind_cntx.h" -#include "bli_trsmind_cntx.h" - -// level-3 ukernels -#include "bli_gemmind_ukr_ref.h" -#include "bli_gemmtrsmind_x_ukr_ref.h" -#include "bli_trsmind_x_ukr_ref.h" +#include "bli_cntx_ind_stage.h" void bli_ind_init( void ); diff --git a/frame/ind/bli_l3_ind.c b/frame/ind/bli_l3_ind.c index 0bf624a1e..7e0723f6b 100644 --- a/frame/ind/bli_l3_ind.c +++ b/frame/ind/bli_l3_ind.c @@ -39,10 +39,6 @@ static void* bli_l3_ind_oper_fp[BLIS_NUM_IND_METHODS][BLIS_NUM_LEVEL3_OPS] = /* gemm hemm herk her2k symm syrk, syr2k trmm3 trmm trsm */ /* 3mh */ { bli_gemm3mh, bli_hemm3mh, bli_herk3mh, bli_her2k3mh, bli_symm3mh, bli_syrk3mh, bli_syr2k3mh, bli_trmm33mh, NULL, NULL }, -/* 3m3 */ { bli_gemm3m3, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL }, -/* 3m2 */ { bli_gemm3m2, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL }, /* 3m1 */ { bli_gemm3m1, bli_hemm3m1, bli_herk3m1, bli_her2k3m1, bli_symm3m1, bli_syrk3m1, bli_syr2k3m1, bli_trmm33m1, bli_trmm3m1, bli_trsm3m1 }, /* 4mh */ { bli_gemm4mh, bli_hemm4mh, bli_herk4mh, bli_her2k4mh, bli_symm4mh, @@ -66,10 +62,6 @@ static bool_t bli_l3_ind_oper_st[BLIS_NUM_IND_METHODS][BLIS_NUM_LEVEL3_OPS][2] = /* c z */ /* 3mh */ { {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE} }, -/* 3m3 */ { {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, - {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE} }, -/* 3m2 */ { {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, - {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE} }, /* 3m1 */ { {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE} }, /* 4mh */ { {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, {FALSE,FALSE}, diff --git a/frame/ind/cntx/bli_cntx_ind_stage.c b/frame/ind/cntx/bli_cntx_ind_stage.c new file mode 100644 index 000000000..33ca04025 --- /dev/null +++ b/frame/ind/cntx/bli_cntx_ind_stage.c @@ -0,0 +1,148 @@ +/* + + 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" + +typedef void (*cntx_stage_ft)( dim_t stage, cntx_t* cntx ); + +static void* bli_cntx_ind_stage_fp[BLIS_NUM_IND_METHODS] = +{ +/* 3mh */ bli_cntx_3mh_stage, +/* 3m1 */ bli_cntx_3m1_stage, +/* 4mh */ bli_cntx_4mh_stage, +/* 4mb */ bli_cntx_4mb_stage, +/* 4m1 */ bli_cntx_4m1_stage, +/* 1m */ bli_cntx_1m_stage, +/* nat */ bli_cntx_nat_stage +}; + + +// ----------------------------------------------------------------------------- + +// Execute the context initialization/finalization function associated +// with a given induced method. + +void bli_cntx_ind_stage( ind_t method, dim_t stage, cntx_t* cntx ) +{ + cntx_stage_ft func = bli_cntx_ind_stage_fp[ method ]; + + func( stage, cntx ); +} + +// ----------------------------------------------------------------------------- + +// These functions modify a context, if needed, for the particular "stage" of +// the induced method execution. Some induced methods do not make use of this +// feature. NOTE: ANY INDUCED METHOD THAT HAS A NON-EMPTY _stage() FUNCTION +// IS NOT THREAT-SAFE FOR APPLICATION-LEVEL THREADING. + +// ----------------------------------------------------------------------------- + +void bli_cntx_3mh_stage( dim_t stage, cntx_t* cntx ) +{ + // Set the pack_t schemas as a function of the stage of execution. + if ( stage == 0 ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_RO, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_RO, cntx ); + } + else if ( stage == 1 ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_IO, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_IO, cntx ); + } + else // if ( stage == 2 ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_RPI, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_RPI, cntx ); + } +} + +// ----------------------------------------------------------------------------- + +void bli_cntx_3m1_stage( dim_t stage, cntx_t* cntx ) +{ +} + +// ----------------------------------------------------------------------------- + +void bli_cntx_4mh_stage( dim_t stage, cntx_t* cntx ) +{ + // Set the pack_t schemas as a function of the stage of execution. + if ( stage == 0 ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_RO, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_RO, cntx ); + } + else if ( stage == 1 ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_IO, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_IO, cntx ); + } + else if ( stage == 2 ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_RO, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_IO, cntx ); + } + else // if ( stage == 3 ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_IO, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_RO, cntx ); + } +} + +// ----------------------------------------------------------------------------- + +void bli_cntx_4mb_stage( dim_t stage, cntx_t* cntx ) +{ +} + +// ----------------------------------------------------------------------------- + +void bli_cntx_4m1_stage( dim_t stage, cntx_t* cntx ) +{ +} + +// ----------------------------------------------------------------------------- + +void bli_cntx_1m_stage( dim_t stage, cntx_t* cntx ) +{ +} + +// ----------------------------------------------------------------------------- + +void bli_cntx_nat_stage( dim_t stage, cntx_t* cntx ) +{ +} + diff --git a/frame/ind/cntx/bli_cntx_ind_stage.h b/frame/ind/cntx/bli_cntx_ind_stage.h new file mode 100644 index 000000000..c54fc2b23 --- /dev/null +++ b/frame/ind/cntx/bli_cntx_ind_stage.h @@ -0,0 +1,44 @@ +/* + + 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. + +*/ + +void bli_cntx_ind_stage( ind_t method, dim_t stage, cntx_t* cntx ); + +void bli_cntx_3mh_stage( dim_t stage, cntx_t* cntx ); +void bli_cntx_3m1_stage( dim_t stage, cntx_t* cntx ); +void bli_cntx_4mh_stage( dim_t stage, cntx_t* cntx ); +void bli_cntx_4mb_stage( dim_t stage, cntx_t* cntx ); +void bli_cntx_4m1_stage( dim_t stage, cntx_t* cntx ); +void bli_cntx_1m_stage( dim_t stage, cntx_t* cntx ); +void bli_cntx_nat_stage( dim_t stage, cntx_t* cntx ); + diff --git a/frame/ind/cntx/bli_gemmind_cntx.c b/frame/ind/cntx/old/bli_gemmind_cntx.c similarity index 100% rename from frame/ind/cntx/bli_gemmind_cntx.c rename to frame/ind/cntx/old/bli_gemmind_cntx.c diff --git a/frame/ind/cntx/bli_gemmind_cntx.h b/frame/ind/cntx/old/bli_gemmind_cntx.h similarity index 100% rename from frame/ind/cntx/bli_gemmind_cntx.h rename to frame/ind/cntx/old/bli_gemmind_cntx.h diff --git a/frame/ind/cntx/old/bli_ind_cntx_init.c b/frame/ind/cntx/old/bli_ind_cntx_init.c new file mode 100644 index 000000000..6f1c697e3 --- /dev/null +++ b/frame/ind/cntx/old/bli_ind_cntx_init.c @@ -0,0 +1,492 @@ +/* + + 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" + +typedef void (*cntx_init_ft)( arch_t id, num_t dt, cntx_t* cntx ); +typedef void (*cntx_finalize_ft)( cntx_t* cntx ); + +static void* bli_ind_cntx_init_fp[BLIS_NUM_IND_METHODS] = +{ +/* 3mh */ bli_3mh_cntx_init, +/* 3m1 */ bli_3m1_cntx_init, +/* 4mh */ bli_4mh_cntx_init, +/* 4mb */ bli_4mb_cntx_init, +/* 4m1 */ bli_4m1_cntx_init, +/* 1m */ bli_1m_cntx_init, +/* nat */ bli_nat_cntx_init +}; + +static void* bli_ind_cntx_finalize_fp[BLIS_NUM_IND_METHODS] = +{ +/* 3mh */ bli_3mh_cntx_finalize, +/* 3m1 */ bli_3m1_cntx_finalize, +/* 4mh */ bli_4mh_cntx_finalize, +/* 4mb */ bli_4mb_cntx_finalize, +/* 4m1 */ bli_4m1_cntx_finalize, +/* 1m */ bli_1m_cntx_finalize, +/* nat */ bli_nat_cntx_finalize +}; + + +// ----------------------------------------------------------------------------- + +// Use a datatype to find the highest priority available (ie: implemented +// and enabled) induced method, and then execute the context initialization/ +// finalization function associated with that induced method. + +#if 0 +void bli_gemmind_cntx_init_avail( num_t dt, cntx_t* cntx ) +{ + ind_t method = bli_ind_oper_find_avail( BLIS_GEMM, dt ); + + bli_gemmind_cntx_init( method, dt, cntx ); +} + +void bli_gemmind_cntx_finalize_avail( num_t dt, cntx_t* cntx ) +{ + ind_t method = bli_ind_oper_find_avail( BLIS_GEMM, dt ); + + bli_gemmind_cntx_finalize( method, cntx ); +} +#endif + +// ----------------------------------------------------------------------------- + +// Execute the context initialization/finalization function associated +// with a given induced method. + +void bli_ind_cntx_init( arch_t id, ind_t method, num_t dt, cntx_t* cntx ) +{ + cntx_init_ft func = bli_ind_cntx_init_get_func( method ); + + func( id, dt, cntx ); +} + +void bli_ind_cntx_finalize( ind_t method, cntx_t* cntx ) +{ + cntx_finalize_ft func = bli_ind_cntx_finalize_get_func( method ); + + func( cntx ); +} + +// ----------------------------------------------------------------------------- + +void* bli_ind_cntx_init_get_func( ind_t method ) +{ + return bli_ind_cntx_init_fp[ method ]; +} + +void* bli_ind_cntx_finalize_get_func( ind_t method ) +{ + return bli_ind_cntx_finalize_fp[ method ]; +} + +// ----------------------------------------------------------------------------- + +// These functions take a context, which is assumed to have been pre-initialized +// with values for native execution on the current hardware, and modify the +// context so that it is ready to be used for complex level-3 operations via +// one of the supported induced methods. + +// ----------------------------------------------------------------------------- + +void bli_3mh_cntx_init( arch_t id, num_t dt, cntx_t* cntx ) +{ + const ind_t method = BLIS_3MH; + + // Initialize the context with the virtual micro-kernel associated with + // the current induced method. + bli_cntx_set_default_l3_vir_ukrs( method, cntx ); + + // Initialize the context with packm kernels for use with the current + // induced method. + bli_cntx_set_default_packm_ind_kers( method, cntx ); + + // Modify the context with cache and register blocksizes (and multiples) + // appropriate for the current induced method. + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, BLIS_NR, 1.0, 1.0, + BLIS_KC, BLIS_KR, 1.0, 1.0, + BLIS_MC, BLIS_MR, 1.0, 1.0, + BLIS_NR, BLIS_NR, 1.0, 1.0, + BLIS_MR, BLIS_MR, 1.0, 1.0, + BLIS_KR, BLIS_KR, 1.0, 1.0, + cntx + ); + + // Set the pack_t schemas for the current induced method. + bli_cntx_set_pack_schema_a_block( 0, cntx ); // schema varies with _stage() + bli_cntx_set_pack_schema_b_panel( 0, cntx ); // schema varies with _stage() +} + +void bli_3mh_cntx_stage( dim_t stage, cntx_t* cntx ) +{ + // Set the pack_t schemas as a function of the stage of execution. + if ( stage == 0 ) + { + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_RO, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_RO, cntx ); + } + else if ( stage == 1 ) + { + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_IO, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_IO, cntx ); + } + else // if ( stage == 2 ) + { + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_RPI, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_RPI, cntx ); + } +} + +void bli_3mh_cntx_finalize( cntx_t* cntx ) +{ +} + +// ----------------------------------------------------------------------------- + +void bli_3m1_cntx_init( arch_t id, num_t dt, cntx_t* cntx ) +{ + const ind_t method = BLIS_3M1; + + // Initialize the context with the virtual micro-kernel associated with + // the current induced method. + //bli_cntx_set_l3_vir_ukrs( id, method, cntx ); + + // Initialize the context with packm kernels for use with the current + // induced method. + //bli_cntx_set_ind_packm_kers( id, method, cntx ); + + // Initialize the context with the level-3 virtual micro-kernels and + // packm kernels associated with the current induced method. + bli_cntx_set_ind_kers( id, method, cntx ); + + // Modify the context with cache and register blocksizes (and multiples) + // appropriate for the current induced method. + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, BLIS_NR, 1.0, 1.0, + BLIS_KC, BLIS_KR, 3.0, 3.0, + BLIS_MC, BLIS_MR, 1.0, 1.0, + BLIS_NR, BLIS_NR, 1.0, 1.0, + BLIS_MR, BLIS_MR, 1.0, 1.0, + BLIS_KR, BLIS_KR, 1.0, 1.0, + cntx + ); + + // Set the pack_t schemas for the current induced method. + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_3MI, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_3MI, cntx ); +} + +void bli_3m1_cntx_stage( dim_t stage, cntx_t* cntx ) +{ +} + +void bli_3m1_cntx_finalize( cntx_t* cntx ) +{ +} + +// ----------------------------------------------------------------------------- + +void bli_4mh_cntx_init( arch_t id, num_t dt, cntx_t* cntx ) +{ + const ind_t method = BLIS_4MH; + + // Initialize the context with the virtual micro-kernel associated with + // the current induced method. + bli_cntx_set_default_l3_vir_ukrs( method, cntx ); + + // Initialize the context with packm kernels for use with the current + // induced method. + bli_cntx_set_default_packm_ind_kers( method, cntx ); + + // Modify the context with cache and register blocksizes (and multiples) + // appropriate for the current induced method. + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, BLIS_NR, 1.0, 1.0, + BLIS_KC, BLIS_KR, 1.0, 1.0, + BLIS_MC, BLIS_MR, 1.0, 1.0, + BLIS_NR, BLIS_NR, 1.0, 1.0, + BLIS_MR, BLIS_MR, 1.0, 1.0, + BLIS_KR, BLIS_KR, 1.0, 1.0, + cntx + ); + + // Set the pack_t schemas for the current induced method. + bli_cntx_set_pack_schema_a_block( 0, cntx ); // schema varies with _stage() + bli_cntx_set_pack_schema_b_panel( 0, cntx ); // schema varies with _stage() +} + +void bli_4mh_cntx_stage( dim_t stage, cntx_t* cntx ) +{ + // Set the pack_t schemas as a function of the stage of execution. + if ( stage == 0 ) + { + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_RO, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_RO, cntx ); + } + else if ( stage == 1 ) + { + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_IO, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_IO, cntx ); + } + else if ( stage == 2 ) + { + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_RO, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_IO, cntx ); + } + else // if ( stage == 3 ) + { + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_IO, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_RO, cntx ); + } +} + +void bli_4mh_cntx_finalize( cntx_t* cntx ) +{ +} + +// ----------------------------------------------------------------------------- + +void bli_4mb_cntx_init( arch_t id, num_t dt, cntx_t* cntx ) +{ + const ind_t method = BLIS_4M1B; + + // Initialize the context with the virtual micro-kernel associated with + // the current induced method. + bli_cntx_set_default_l3_vir_ukrs( method, cntx ); + + // Initialize the context with packm kernels for use with the current + // induced method. + bli_cntx_set_default_packm_ind_kers( method, cntx ); + + // Modify the context with cache and register blocksizes (and multiples) + // appropriate for the current induced method. + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, BLIS_NR, 2.0, 2.0, + BLIS_KC, BLIS_KR, 1.0, 1.0, + BLIS_MC, BLIS_MR, 2.0, 2.0, + BLIS_NR, BLIS_NR, 1.0, 1.0, + BLIS_MR, BLIS_MR, 1.0, 1.0, + BLIS_KR, BLIS_KR, 1.0, 1.0, + cntx + ); + + // Set the pack_t schemas for the current induced method. + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_4MI, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_4MI, cntx ); +} + +void bli_4mb_cntx_stage( dim_t stage, cntx_t* cntx ) +{ +} + +void bli_4mb_cntx_finalize( cntx_t* cntx ) +{ +} + +// ----------------------------------------------------------------------------- + +void bli_4m1_cntx_init( arch_t id, num_t dt, cntx_t* cntx ) +{ + const ind_t method = BLIS_4M1A; + + // Initialize the context with the virtual micro-kernel associated with + // the current induced method. + bli_cntx_set_default_l3_vir_ukrs( method, cntx ); + + // Initialize the context with packm kernels for use with the current + // induced method. + bli_cntx_set_default_packm_ind_kers( method, cntx ); + + // Modify the context with cache and register blocksizes (and multiples) + // appropriate for the current induced method. + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, BLIS_NR, 1.0, 1.0, + BLIS_KC, BLIS_KR, 2.0, 2.0, + BLIS_MC, BLIS_MR, 1.0, 1.0, + BLIS_NR, BLIS_NR, 1.0, 1.0, + BLIS_MR, BLIS_MR, 1.0, 1.0, + BLIS_KR, BLIS_KR, 1.0, 1.0, + cntx + ); + + // Set the pack_t schemas for the current induced method. + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_4MI, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_4MI, cntx ); +} + +void bli_4m1_cntx_stage( dim_t stage, cntx_t* cntx ) +{ +} + +void bli_4m1_cntx_finalize( cntx_t* cntx ) +{ +} + +// ----------------------------------------------------------------------------- + +void bli_1m_cntx_init( arch_t id, num_t dt, cntx_t* cntx ) +{ + // Default to context for block-panel algorithm. + bli_1mbp_cntx_init( id, dt, cntx ); +} + +void bli_1mbp_cntx_init( arch_t id, num_t dt, cntx_t* cntx ) +{ + bli_1mxx_cntx_init( id, dt, FALSE, cntx ); +} + +void bli_1mpb_cntx_init( arch_t id, num_t dt, cntx_t* cntx ) +{ + bli_1mxx_cntx_init( id, dt, TRUE, cntx ); +} + +void bli_1mxx_cntx_init( arch_t id, num_t dt, bool_t is_pb, cntx_t* cntx ) +{ + const ind_t method = BLIS_1M; + + // Initialize the context with the virtual micro-kernel associated with + // the current induced method. + bli_cntx_set_default_l3_vir_ukrs( method, cntx ); + + // Initialize the context with packm kernels for use with the current + // induced method. + bli_cntx_set_default_packm_ind_kers( method, cntx ); + + // Initialize the blocksizes according to the micro-kernel preference as + // well as the algorithm. + if ( bli_cntx_l3_ukr_prefers_cols_dt( dt, BLIS_GEMM_UKR, cntx ) ) + { + // This branch is used for algorithms 1m_c_bp, 1m_r_pb. + + // Set the pack_t schemas for the c_bp or r_pb algorithms. + if ( !is_pb ) + { + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_1E, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_1R, cntx ); + } + else // if ( is_pb ) + { + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_ROW_PANELS_1R, cntx ); + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_COL_PANELS_1E, cntx ); + } + + // Modify the context with cache and register blocksizes (and multiples) + // appropriate for the current induced method. + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, BLIS_NR, 1.0, 1.0, + BLIS_KC, BLIS_KR, 2.0, 2.0, // halve kc... + BLIS_MC, BLIS_MR, 2.0, 2.0, // halve mc... + BLIS_NR, BLIS_NR, 1.0, 1.0, + BLIS_MR, BLIS_MR, 2.0, 1.0, // ...and mr (but NOT packmr) + BLIS_KR, BLIS_KR, 1.0, 1.0, + cntx + ); + } + else // if ( bli_cntx_l3_ukr_prefers_rows_dt( dt, BLIS_GEMM_UKR, cntx ) ) + { + // This branch is used for algorithms 1m_r_bp, 1m_c_pb. + + // Set the pack_t schemas for the r_bp or c_pb algorithms. + if ( !is_pb ) + { + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_ROW_PANELS_1R, cntx ); + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_COL_PANELS_1E, cntx ); + } + else // if ( is_pb ) + { + bli_cntx_set_pack_schema_b_panel( BLIS_PACKED_ROW_PANELS_1E, cntx ); + bli_cntx_set_pack_schema_a_block( BLIS_PACKED_COL_PANELS_1R, cntx ); + } + + // Modify the context with cache and register blocksizes (and multiples) + // appropriate for the current induced method. + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, BLIS_NR, 2.0, 2.0, // halve nc... + BLIS_KC, BLIS_KR, 2.0, 2.0, // halve kc... + BLIS_MC, BLIS_MR, 1.0, 1.0, + BLIS_NR, BLIS_NR, 2.0, 1.0, // ...and nr (but NOT packnr) + BLIS_MR, BLIS_MR, 1.0, 1.0, + BLIS_KR, BLIS_KR, 1.0, 1.0, + cntx + ); + } + + // Set the anti-preference field to TRUE when executing a panel-block + // algorithm, and FALSE otherwise. This will cause higher-level generic + // code to establish (if needed) disagreement between the storage of C and + // the micro-kernel output preference so that the two will come back into + // agreement in the panel-block macro-kernel (which implemented in terms + // of the block-panel macro-kernel with some induced transpositions). + bli_cntx_set_anti_pref( is_pb, cntx ); +} + +void bli_1m_cntx_stage( dim_t stage, cntx_t* cntx ) +{ +} + +void bli_1m_cntx_finalize( cntx_t* cntx ) +{ +} + +// ----------------------------------------------------------------------------- + +void bli_nat_cntx_init( arch_t id, num_t dt, cntx_t* cntx ) +{ +} + +void bli_nat_cntx_stage( dim_t stage, cntx_t* cntx ) +{ +} + +void bli_nat_cntx_finalize( cntx_t* cntx ) +{ +} + diff --git a/frame/ind/cntx/old/bli_ind_cntx_init.h b/frame/ind/cntx/old/bli_ind_cntx_init.h new file mode 100644 index 000000000..9f87cd028 --- /dev/null +++ b/frame/ind/cntx/old/bli_ind_cntx_init.h @@ -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. + +*/ + +#include "bli_ind_cntx_init.h" + +// ----------------------------------------------------------------------------- + +//void bli_ind_cntx_init_avail( num_t dt, cntx_t* cntx ); +//void bli_ind_cntx_finalize_avail( num_t dt, cntx_t* cntx ); + +void bli_ind_cntx_init( ind_t method, num_t dt, cntx_t* cntx ); +void bli_ind_cntx_finalize( ind_t method, cntx_t* cntx ); + +void* bli_ind_cntx_init_get_func( ind_t method ); +void* bli_ind_cntx_finalize_get_func( ind_t method ); + +// ----------------------------------------------------------------------------- + +void bli_3m1_cntx_init( num_t dt, cntx_t* cntx ); +void bli_3m1_cntx_stage( dim_t stage, cntx_t* cntx ); +void bli_3m1_cntx_finalize( cntx_t* cntx ); + +void bli_3mh_cntx_init( num_t dt, cntx_t* cntx ); +void bli_3mh_cntx_stage( dim_t stage, cntx_t* cntx ); +void bli_3mh_cntx_finalize( cntx_t* cntx ); + +void bli_4m1_cntx_init( num_t dt, cntx_t* cntx ); +void bli_4m1_cntx_stage( dim_t stage, cntx_t* cntx ); +void bli_4m1_cntx_finalize( cntx_t* cntx ); + +void bli_4mb_cntx_init( num_t dt, cntx_t* cntx ); +void bli_4mb_cntx_stage( dim_t stage, cntx_t* cntx ); +void bli_4mb_cntx_finalize( cntx_t* cntx ); + +void bli_4mh_cntx_init( num_t dt, cntx_t* cntx ); +void bli_4mh_cntx_stage( dim_t stage, cntx_t* cntx ); +void bli_4mh_cntx_finalize( cntx_t* cntx ); + +void bli_1m_cntx_init( num_t dt, cntx_t* cntx ); +void bli_1mbp_cntx_init( num_t dt, cntx_t* cntx ); +void bli_1mpb_cntx_init( num_t dt, cntx_t* cntx ); +void bli_1mxx_cntx_init( num_t dt, bool_t is_pb, cntx_t* cntx ); +void bli_1m_cntx_stage( dim_t stage, cntx_t* cntx ); +void bli_1m_cntx_finalize( cntx_t* cntx ); + +void bli_nat_cntx_init( num_t dt, cntx_t* cntx ); +void bli_nat_cntx_stage( dim_t stage, cntx_t* cntx ); +void bli_nat_cntx_finalize( cntx_t* cntx ); + diff --git a/frame/ind/cntx/bli_trsmind_cntx.c b/frame/ind/cntx/old/bli_trsmind_cntx.c similarity index 100% rename from frame/ind/cntx/bli_trsmind_cntx.c rename to frame/ind/cntx/old/bli_trsmind_cntx.c diff --git a/frame/ind/cntx/bli_trsmind_cntx.h b/frame/ind/cntx/old/bli_trsmind_cntx.h similarity index 100% rename from frame/ind/cntx/bli_trsmind_cntx.h rename to frame/ind/cntx/old/bli_trsmind_cntx.h diff --git a/frame/ind/include/bli_kernel_ind_pre_macro_defs.h b/frame/ind/include/bli_kernel_ind_pre_macro_defs.h deleted file mode 100644 index 47fbb4a28..000000000 --- a/frame/ind/include/bli_kernel_ind_pre_macro_defs.h +++ /dev/null @@ -1,175 +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. - -*/ - -#include "bli_packm_ind_pre_macro_defs.h" - -#ifndef BLIS_KERNEL_IND_PRE_MACRO_DEFS_H -#define BLIS_KERNEL_IND_PRE_MACRO_DEFS_H - -// -// Level-3 3mh -// - -// gemm3mh micro-kernels - -#define BLIS_CGEMM3MH_UKERNEL_REF bli_cgemm3mh_ukr_ref -#define BLIS_ZGEMM3MH_UKERNEL_REF bli_zgemm3mh_ukr_ref - -// -// Level-3 3m3 -// - -// gemm3m3 micro-kernels - -#define BLIS_CGEMM3M3_UKERNEL_REF bli_cgemm3m3_ukr_ref -#define BLIS_ZGEMM3M3_UKERNEL_REF bli_zgemm3m3_ukr_ref - -// -// Level-3 3m2 -// - -// gemm3m2 micro-kernels - -#define BLIS_CGEMM3M2_UKERNEL_REF bli_cgemm3m2_ukr_ref -#define BLIS_ZGEMM3M2_UKERNEL_REF bli_zgemm3m2_ukr_ref - -// -// Level-3 3m1 -// - -// gemm3m1 micro-kernels - -#define BLIS_CGEMM3M1_UKERNEL_REF bli_cgemm3m1_ukr_ref -#define BLIS_ZGEMM3M1_UKERNEL_REF bli_zgemm3m1_ukr_ref - -// gemmtrsm3m1_l micro-kernels - -#define BLIS_CGEMMTRSM3M1_L_UKERNEL_REF bli_cgemmtrsm3m1_l_ukr_ref -#define BLIS_ZGEMMTRSM3M1_L_UKERNEL_REF bli_zgemmtrsm3m1_l_ukr_ref - -// gemmtrsm3m1_u micro-kernels - -#define BLIS_CGEMMTRSM3M1_U_UKERNEL_REF bli_cgemmtrsm3m1_u_ukr_ref -#define BLIS_ZGEMMTRSM3M1_U_UKERNEL_REF bli_zgemmtrsm3m1_u_ukr_ref - -// trsm3m1_l micro-kernels - -#define BLIS_CTRSM3M1_L_UKERNEL_REF bli_ctrsm3m1_l_ukr_ref -#define BLIS_ZTRSM3M1_L_UKERNEL_REF bli_ztrsm3m1_l_ukr_ref - -// trsm3m1_u micro-kernels - -#define BLIS_CTRSM3M1_U_UKERNEL_REF bli_ctrsm3m1_u_ukr_ref -#define BLIS_ZTRSM3M1_U_UKERNEL_REF bli_ztrsm3m1_u_ukr_ref - -// -// Level-3 4mh -// - -// gemm4mh micro-kernels - -#define BLIS_CGEMM4MH_UKERNEL_REF bli_cgemm4mh_ukr_ref -#define BLIS_ZGEMM4MH_UKERNEL_REF bli_zgemm4mh_ukr_ref - -// -// Level-3 4mb -// - -// gemm4mb micro-kernels - -#define BLIS_CGEMM4MB_UKERNEL_REF bli_cgemm4mb_ukr_ref -#define BLIS_ZGEMM4MB_UKERNEL_REF bli_zgemm4mb_ukr_ref - -// -// Level-3 4m1 -// - -// gemm4m1 micro-kernels - -#define BLIS_CGEMM4M1_UKERNEL_REF bli_cgemm4m1_ukr_ref -#define BLIS_ZGEMM4M1_UKERNEL_REF bli_zgemm4m1_ukr_ref - -// gemmtrsm4m1_l micro-kernels - -#define BLIS_CGEMMTRSM4M1_L_UKERNEL_REF bli_cgemmtrsm4m1_l_ukr_ref -#define BLIS_ZGEMMTRSM4M1_L_UKERNEL_REF bli_zgemmtrsm4m1_l_ukr_ref - -// gemmtrsm4m1_u micro-kernels - -#define BLIS_CGEMMTRSM4M1_U_UKERNEL_REF bli_cgemmtrsm4m1_u_ukr_ref -#define BLIS_ZGEMMTRSM4M1_U_UKERNEL_REF bli_zgemmtrsm4m1_u_ukr_ref - -// trsm4m1_l micro-kernels - -#define BLIS_CTRSM4M1_L_UKERNEL_REF bli_ctrsm4m1_l_ukr_ref -#define BLIS_ZTRSM4M1_L_UKERNEL_REF bli_ztrsm4m1_l_ukr_ref - -// trsm4m1_u micro-kernels - -#define BLIS_CTRSM4M1_U_UKERNEL_REF bli_ctrsm4m1_u_ukr_ref -#define BLIS_ZTRSM4M1_U_UKERNEL_REF bli_ztrsm4m1_u_ukr_ref - -// -// Level-3 1m -// - -// gemm1m micro-kernels - -#define BLIS_CGEMM1M_UKERNEL_REF bli_cgemm1m_ukr_ref -#define BLIS_ZGEMM1M_UKERNEL_REF bli_zgemm1m_ukr_ref - -// gemmtrsm1m_l micro-kernels - -#define BLIS_CGEMMTRSM1M_L_UKERNEL_REF bli_cgemmtrsm1m_l_ukr_ref -#define BLIS_ZGEMMTRSM1M_L_UKERNEL_REF bli_zgemmtrsm1m_l_ukr_ref - -// gemmtrsm1m_u micro-kernels - -#define BLIS_CGEMMTRSM1M_U_UKERNEL_REF bli_cgemmtrsm1m_u_ukr_ref -#define BLIS_ZGEMMTRSM1M_U_UKERNEL_REF bli_zgemmtrsm1m_u_ukr_ref - -// trsm1m_l micro-kernels - -#define BLIS_CTRSM1M_L_UKERNEL_REF bli_ctrsm1m_l_ukr_ref -#define BLIS_ZTRSM1M_L_UKERNEL_REF bli_ztrsm1m_l_ukr_ref - -// trsm1m_u micro-kernels - -#define BLIS_CTRSM1M_U_UKERNEL_REF bli_ctrsm1m_u_ukr_ref -#define BLIS_ZTRSM1M_U_UKERNEL_REF bli_ztrsm1m_u_ukr_ref - - - -#endif - diff --git a/frame/ind/include/bli_packm_1er_macro_defs.h b/frame/ind/include/bli_packm_1er_macro_defs.h deleted file mode 100644 index fe550d1c5..000000000 --- a/frame/ind/include/bli_packm_1er_macro_defs.h +++ /dev/null @@ -1,241 +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_1ER_MACRO_DEFS_H -#define BLIS_KERNEL_1ER_MACRO_DEFS_H - - -// -- Define default 1e/1r-specific kernel names ------------------------------- - -// -// 1e -// - -// packm_2xk_1e kernels - -#ifndef BLIS_CPACKM_2XK_1E_KERNEL -#define BLIS_CPACKM_2XK_1E_KERNEL BLIS_CPACKM_2XK_1E_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_2XK_1E_KERNEL -#define BLIS_ZPACKM_2XK_1E_KERNEL BLIS_ZPACKM_2XK_1E_KERNEL_REF -#endif - -// packm_4xk_1e kernels - -#ifndef BLIS_CPACKM_4XK_1E_KERNEL -#define BLIS_CPACKM_4XK_1E_KERNEL BLIS_CPACKM_4XK_1E_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_4XK_1E_KERNEL -#define BLIS_ZPACKM_4XK_1E_KERNEL BLIS_ZPACKM_4XK_1E_KERNEL_REF -#endif - -// packm_6xk_1e kernels - -#ifndef BLIS_CPACKM_6XK_1E_KERNEL -#define BLIS_CPACKM_6XK_1E_KERNEL BLIS_CPACKM_6XK_1E_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_6XK_1E_KERNEL -#define BLIS_ZPACKM_6XK_1E_KERNEL BLIS_ZPACKM_6XK_1E_KERNEL_REF -#endif - -// packm_8xk_1e kernels - -#ifndef BLIS_CPACKM_8XK_1E_KERNEL -#define BLIS_CPACKM_8XK_1E_KERNEL BLIS_CPACKM_8XK_1E_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_8XK_1E_KERNEL -#define BLIS_ZPACKM_8XK_1E_KERNEL BLIS_ZPACKM_8XK_1E_KERNEL_REF -#endif - -// packm_10xk_1e kernels - -#ifndef BLIS_CPACKM_10XK_1E_KERNEL -#define BLIS_CPACKM_10XK_1E_KERNEL BLIS_CPACKM_10XK_1E_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_10XK_1E_KERNEL -#define BLIS_ZPACKM_10XK_1E_KERNEL BLIS_ZPACKM_10XK_1E_KERNEL_REF -#endif - -// packm_12xk_1e kernels - -#ifndef BLIS_CPACKM_12XK_1E_KERNEL -#define BLIS_CPACKM_12XK_1E_KERNEL BLIS_CPACKM_12XK_1E_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_12XK_1E_KERNEL -#define BLIS_ZPACKM_12XK_1E_KERNEL BLIS_ZPACKM_12XK_1E_KERNEL_REF -#endif - -// packm_14xk_1e kernels - -#ifndef BLIS_CPACKM_14XK_1E_KERNEL -#define BLIS_CPACKM_14XK_1E_KERNEL BLIS_CPACKM_14XK_1E_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_14XK_1E_KERNEL -#define BLIS_ZPACKM_14XK_1E_KERNEL BLIS_ZPACKM_14XK_1E_KERNEL_REF -#endif - -// packm_16xk_1e kernels - -#ifndef BLIS_CPACKM_16XK_1E_KERNEL -#define BLIS_CPACKM_16XK_1E_KERNEL BLIS_CPACKM_16XK_1E_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_16XK_1E_KERNEL -#define BLIS_ZPACKM_16XK_1E_KERNEL BLIS_ZPACKM_16XK_1E_KERNEL_REF -#endif - -// packm_30xk_1e kernels - -#ifndef BLIS_CPACKM_30XK_1E_KERNEL -#define BLIS_CPACKM_30XK_1E_KERNEL BLIS_CPACKM_30XK_1E_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_30XK_1E_KERNEL -#define BLIS_ZPACKM_30XK_1E_KERNEL BLIS_ZPACKM_30XK_1E_KERNEL_REF -#endif - -// -// 1r -// - -// packm_2xk_1r kernels - -#ifndef BLIS_CPACKM_2XK_1R_KERNEL -#define BLIS_CPACKM_2XK_1R_KERNEL BLIS_CPACKM_2XK_1R_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_2XK_1R_KERNEL -#define BLIS_ZPACKM_2XK_1R_KERNEL BLIS_ZPACKM_2XK_1R_KERNEL_REF -#endif - -// packm_3xk_1r kernels - -#ifndef BLIS_CPACKM_3XK_1R_KERNEL -#define BLIS_CPACKM_3XK_1R_KERNEL BLIS_CPACKM_3XK_1R_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_3XK_1R_KERNEL -#define BLIS_ZPACKM_3XK_1R_KERNEL BLIS_ZPACKM_3XK_1R_KERNEL_REF -#endif - -// packm_4xk_1r kernels - -#ifndef BLIS_CPACKM_4XK_1R_KERNEL -#define BLIS_CPACKM_4XK_1R_KERNEL BLIS_CPACKM_4XK_1R_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_4XK_1R_KERNEL -#define BLIS_ZPACKM_4XK_1R_KERNEL BLIS_ZPACKM_4XK_1R_KERNEL_REF -#endif - -// packm_6xk_1r kernels - -#ifndef BLIS_CPACKM_6XK_1R_KERNEL -#define BLIS_CPACKM_6XK_1R_KERNEL BLIS_CPACKM_6XK_1R_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_6XK_1R_KERNEL -#define BLIS_ZPACKM_6XK_1R_KERNEL BLIS_ZPACKM_6XK_1R_KERNEL_REF -#endif - -// packm_8xk_1r kernels - -#ifndef BLIS_CPACKM_8XK_1R_KERNEL -#define BLIS_CPACKM_8XK_1R_KERNEL BLIS_CPACKM_8XK_1R_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_8XK_1R_KERNEL -#define BLIS_ZPACKM_8XK_1R_KERNEL BLIS_ZPACKM_8XK_1R_KERNEL_REF -#endif - -// packm_10xk_1r kernels - -#ifndef BLIS_CPACKM_10XK_1R_KERNEL -#define BLIS_CPACKM_10XK_1R_KERNEL BLIS_CPACKM_10XK_1R_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_10XK_1R_KERNEL -#define BLIS_ZPACKM_10XK_1R_KERNEL BLIS_ZPACKM_10XK_1R_KERNEL_REF -#endif - -// packm_12xk_1r kernels - -#ifndef BLIS_CPACKM_12XK_1R_KERNEL -#define BLIS_CPACKM_12XK_1R_KERNEL BLIS_CPACKM_12XK_1R_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_12XK_1R_KERNEL -#define BLIS_ZPACKM_12XK_1R_KERNEL BLIS_ZPACKM_12XK_1R_KERNEL_REF -#endif - -// packm_14xk_1r kernels - -#ifndef BLIS_CPACKM_14XK_1R_KERNEL -#define BLIS_CPACKM_14XK_1R_KERNEL BLIS_CPACKM_14XK_1R_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_14XK_1R_KERNEL -#define BLIS_ZPACKM_14XK_1R_KERNEL BLIS_ZPACKM_14XK_1R_KERNEL_REF -#endif - -// packm_16xk_1r kernels - -#ifndef BLIS_CPACKM_16XK_1R_KERNEL -#define BLIS_CPACKM_16XK_1R_KERNEL BLIS_CPACKM_16XK_1R_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_16XK_1R_KERNEL -#define BLIS_ZPACKM_16XK_1R_KERNEL BLIS_ZPACKM_16XK_1R_KERNEL_REF -#endif - -// packm_30xk_1r kernels - -#ifndef BLIS_CPACKM_30XK_1R_KERNEL -#define BLIS_CPACKM_30XK_1R_KERNEL BLIS_CPACKM_30XK_1R_KERNEL_REF -#endif - -#ifndef BLIS_ZPACKM_30XK_1R_KERNEL -#define BLIS_ZPACKM_30XK_1R_KERNEL BLIS_ZPACKM_30XK_1R_KERNEL_REF -#endif - - - -#endif diff --git a/frame/ind/include/bli_packm_ind_pre_macro_defs.h b/frame/ind/include/bli_packm_ind_pre_macro_defs.h deleted file mode 100644 index 1bec1c5fd..000000000 --- a/frame/ind/include/bli_packm_ind_pre_macro_defs.h +++ /dev/null @@ -1,278 +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_PACKM_IND_PRE_MACRO_DEFS_H -#define BLIS_PACKM_IND_PRE_MACRO_DEFS_H - - -// packm_2xk_3mis kernels - -#define BLIS_CPACKM_2XK_3MIS_KERNEL_REF bli_cpackm_2xk_3mis_ref -#define BLIS_ZPACKM_2XK_3MIS_KERNEL_REF bli_zpackm_2xk_3mis_ref - -// packm_4xk_3mis kernels - -#define BLIS_CPACKM_4XK_3MIS_KERNEL_REF bli_cpackm_4xk_3mis_ref -#define BLIS_ZPACKM_4XK_3MIS_KERNEL_REF bli_zpackm_4xk_3mis_ref - -// packm_6xk_3mis kernels - -#define BLIS_CPACKM_6XK_3MIS_KERNEL_REF bli_cpackm_6xk_3mis_ref -#define BLIS_ZPACKM_6XK_3MIS_KERNEL_REF bli_zpackm_6xk_3mis_ref - -// packm_8xk_3mis kernels - -#define BLIS_CPACKM_8XK_3MIS_KERNEL_REF bli_cpackm_8xk_3mis_ref -#define BLIS_ZPACKM_8XK_3MIS_KERNEL_REF bli_zpackm_8xk_3mis_ref - -// packm_10xk_3mis kernels - -#define BLIS_CPACKM_10XK_3MIS_KERNEL_REF bli_cpackm_10xk_3mis_ref -#define BLIS_ZPACKM_10XK_3MIS_KERNEL_REF bli_zpackm_10xk_3mis_ref - -// packm_12xk_3mis kernels - -#define BLIS_CPACKM_12XK_3MIS_KERNEL_REF bli_cpackm_12xk_3mis_ref -#define BLIS_ZPACKM_12XK_3MIS_KERNEL_REF bli_zpackm_12xk_3mis_ref - -// packm_14xk_3mis kernels - -#define BLIS_CPACKM_14XK_3MIS_KERNEL_REF bli_cpackm_14xk_3mis_ref -#define BLIS_ZPACKM_14XK_3MIS_KERNEL_REF bli_zpackm_14xk_3mis_ref - -// packm_16xk_3mis kernels - -#define BLIS_CPACKM_16XK_3MIS_KERNEL_REF bli_cpackm_16xk_3mis_ref -#define BLIS_ZPACKM_16XK_3MIS_KERNEL_REF bli_zpackm_16xk_3mis_ref - -// packm_30xk_3mis kernels - -#define BLIS_CPACKM_30XK_3MIS_KERNEL_REF bli_cpackm_30xk_3mis_ref -#define BLIS_ZPACKM_30XK_3MIS_KERNEL_REF bli_zpackm_30xk_3mis_ref - - - -// packm_2xk_4mi kernels - -#define BLIS_CPACKM_2XK_4MI_KERNEL_REF bli_cpackm_2xk_4mi_ref -#define BLIS_ZPACKM_2XK_4MI_KERNEL_REF bli_zpackm_2xk_4mi_ref - -// packm_4xk_4mi kernels - -#define BLIS_CPACKM_4XK_4MI_KERNEL_REF bli_cpackm_4xk_4mi_ref -#define BLIS_ZPACKM_4XK_4MI_KERNEL_REF bli_zpackm_4xk_4mi_ref - -// packm_6xk_4mi kernels - -#define BLIS_CPACKM_6XK_4MI_KERNEL_REF bli_cpackm_6xk_4mi_ref -#define BLIS_ZPACKM_6XK_4MI_KERNEL_REF bli_zpackm_6xk_4mi_ref - -// packm_8xk_4mi kernels - -#define BLIS_CPACKM_8XK_4MI_KERNEL_REF bli_cpackm_8xk_4mi_ref -#define BLIS_ZPACKM_8XK_4MI_KERNEL_REF bli_zpackm_8xk_4mi_ref - -// packm_10xk_4mi kernels - -#define BLIS_CPACKM_10XK_4MI_KERNEL_REF bli_cpackm_10xk_4mi_ref -#define BLIS_ZPACKM_10XK_4MI_KERNEL_REF bli_zpackm_10xk_4mi_ref - -// packm_12xk_4mi kernels - -#define BLIS_CPACKM_12XK_4MI_KERNEL_REF bli_cpackm_12xk_4mi_ref -#define BLIS_ZPACKM_12XK_4MI_KERNEL_REF bli_zpackm_12xk_4mi_ref - -// packm_14xk_4mi kernels - -#define BLIS_CPACKM_14XK_4MI_KERNEL_REF bli_cpackm_14xk_4mi_ref -#define BLIS_ZPACKM_14XK_4MI_KERNEL_REF bli_zpackm_14xk_4mi_ref - -// packm_16xk_4mi kernels - -#define BLIS_CPACKM_16XK_4MI_KERNEL_REF bli_cpackm_16xk_4mi_ref -#define BLIS_ZPACKM_16XK_4MI_KERNEL_REF bli_zpackm_16xk_4mi_ref - -// packm_30xk_4mi kernels - -#define BLIS_CPACKM_30XK_4MI_KERNEL_REF bli_cpackm_30xk_4mi_ref -#define BLIS_ZPACKM_30XK_4MI_KERNEL_REF bli_zpackm_30xk_4mi_ref - - - -// packm_2xk_rih kernels - -#define BLIS_CPACKM_2XK_RIH_KERNEL_REF bli_cpackm_2xk_rih_ref -#define BLIS_ZPACKM_2XK_RIH_KERNEL_REF bli_zpackm_2xk_rih_ref - -// packm_4xk_rih kernels - -#define BLIS_CPACKM_4XK_RIH_KERNEL_REF bli_cpackm_4xk_rih_ref -#define BLIS_ZPACKM_4XK_RIH_KERNEL_REF bli_zpackm_4xk_rih_ref - -// packm_6xk_rih kernels - -#define BLIS_CPACKM_6XK_RIH_KERNEL_REF bli_cpackm_6xk_rih_ref -#define BLIS_ZPACKM_6XK_RIH_KERNEL_REF bli_zpackm_6xk_rih_ref - -// packm_8xk_rih kernels - -#define BLIS_CPACKM_8XK_RIH_KERNEL_REF bli_cpackm_8xk_rih_ref -#define BLIS_ZPACKM_8XK_RIH_KERNEL_REF bli_zpackm_8xk_rih_ref - -// packm_10xk_rih kernels - -#define BLIS_CPACKM_10XK_RIH_KERNEL_REF bli_cpackm_10xk_rih_ref -#define BLIS_ZPACKM_10XK_RIH_KERNEL_REF bli_zpackm_10xk_rih_ref - -// packm_12xk_rih kernels - -#define BLIS_CPACKM_12XK_RIH_KERNEL_REF bli_cpackm_12xk_rih_ref -#define BLIS_ZPACKM_12XK_RIH_KERNEL_REF bli_zpackm_12xk_rih_ref - -// packm_14xk_rih kernels - -#define BLIS_CPACKM_14XK_RIH_KERNEL_REF bli_cpackm_14xk_rih_ref -#define BLIS_ZPACKM_14XK_RIH_KERNEL_REF bli_zpackm_14xk_rih_ref - -// packm_16xk_rih kernels - -#define BLIS_CPACKM_16XK_RIH_KERNEL_REF bli_cpackm_16xk_rih_ref -#define BLIS_ZPACKM_16XK_RIH_KERNEL_REF bli_zpackm_16xk_rih_ref - -// packm_30xk_rih kernels - -#define BLIS_CPACKM_30XK_RIH_KERNEL_REF bli_cpackm_30xk_rih_ref -#define BLIS_ZPACKM_30XK_RIH_KERNEL_REF bli_zpackm_30xk_rih_ref - - - -// packm_2xk_1e kernels - -#define BLIS_CPACKM_2XK_1E_KERNEL_REF bli_cpackm_2xk_1e_ref -#define BLIS_ZPACKM_2XK_1E_KERNEL_REF bli_zpackm_2xk_1e_ref - -// packm_4xk_1e kernels - -#define BLIS_CPACKM_4XK_1E_KERNEL_REF bli_cpackm_4xk_1e_ref -#define BLIS_ZPACKM_4XK_1E_KERNEL_REF bli_zpackm_4xk_1e_ref - -// packm_6xk_1e kernels - -#define BLIS_CPACKM_6XK_1E_KERNEL_REF bli_cpackm_6xk_1e_ref -#define BLIS_ZPACKM_6XK_1E_KERNEL_REF bli_zpackm_6xk_1e_ref - -// packm_8xk_1e kernels - -#define BLIS_CPACKM_8XK_1E_KERNEL_REF bli_cpackm_8xk_1e_ref -#define BLIS_ZPACKM_8XK_1E_KERNEL_REF bli_zpackm_8xk_1e_ref - -// packm_10xk_1e kernels - -#define BLIS_CPACKM_10XK_1E_KERNEL_REF bli_cpackm_10xk_1e_ref -#define BLIS_ZPACKM_10XK_1E_KERNEL_REF bli_zpackm_10xk_1e_ref - -// packm_12xk_1e kernels - -#define BLIS_CPACKM_12XK_1E_KERNEL_REF bli_cpackm_12xk_1e_ref -#define BLIS_ZPACKM_12XK_1E_KERNEL_REF bli_zpackm_12xk_1e_ref - -// packm_14xk_1e kernels - -#define BLIS_CPACKM_14XK_1E_KERNEL_REF bli_cpackm_14xk_1e_ref -#define BLIS_ZPACKM_14XK_1E_KERNEL_REF bli_zpackm_14xk_1e_ref - -// packm_16xk_1e kernels - -#define BLIS_CPACKM_16XK_1E_KERNEL_REF bli_cpackm_16xk_1e_ref -#define BLIS_ZPACKM_16XK_1E_KERNEL_REF bli_zpackm_16xk_1e_ref - -// packm_30xk_1e kernels - -#define BLIS_CPACKM_30XK_1E_KERNEL_REF bli_cpackm_30xk_1e_ref -#define BLIS_ZPACKM_30XK_1E_KERNEL_REF bli_zpackm_30xk_1e_ref - -// packm_2xk_1r kernels - -#define BLIS_CPACKM_2XK_1R_KERNEL_REF bli_cpackm_2xk_1r_ref -#define BLIS_ZPACKM_2XK_1R_KERNEL_REF bli_zpackm_2xk_1r_ref - -// packm_3xk_1r kernels - -#define BLIS_CPACKM_3XK_1R_KERNEL_REF bli_cpackm_3xk_1r_ref -#define BLIS_ZPACKM_3XK_1R_KERNEL_REF bli_zpackm_3xk_1r_ref - -// packm_4xk_1r kernels - -#define BLIS_CPACKM_4XK_1R_KERNEL_REF bli_cpackm_4xk_1r_ref -#define BLIS_ZPACKM_4XK_1R_KERNEL_REF bli_zpackm_4xk_1r_ref - -// packm_6xk_1r kernels - -#define BLIS_CPACKM_6XK_1R_KERNEL_REF bli_cpackm_6xk_1r_ref -#define BLIS_ZPACKM_6XK_1R_KERNEL_REF bli_zpackm_6xk_1r_ref - -// packm_8xk_1r kernels - -#define BLIS_CPACKM_8XK_1R_KERNEL_REF bli_cpackm_8xk_1r_ref -#define BLIS_ZPACKM_8XK_1R_KERNEL_REF bli_zpackm_8xk_1r_ref - -// packm_10xk_1r kernels - -#define BLIS_CPACKM_10XK_1R_KERNEL_REF bli_cpackm_10xk_1r_ref -#define BLIS_ZPACKM_10XK_1R_KERNEL_REF bli_zpackm_10xk_1r_ref - -// packm_12xk_1r kernels - -#define BLIS_CPACKM_12XK_1R_KERNEL_REF bli_cpackm_12xk_1r_ref -#define BLIS_ZPACKM_12XK_1R_KERNEL_REF bli_zpackm_12xk_1r_ref - -// packm_14xk_1r kernels - -#define BLIS_CPACKM_14XK_1R_KERNEL_REF bli_cpackm_14xk_1r_ref -#define BLIS_ZPACKM_14XK_1R_KERNEL_REF bli_zpackm_14xk_1r_ref - -// packm_16xk_1r kernels - -#define BLIS_CPACKM_16XK_1R_KERNEL_REF bli_cpackm_16xk_1r_ref -#define BLIS_ZPACKM_16XK_1R_KERNEL_REF bli_zpackm_16xk_1r_ref - -// packm_30xk_1r kernels - -#define BLIS_CPACKM_30XK_1R_KERNEL_REF bli_cpackm_30xk_1r_ref -#define BLIS_ZPACKM_30XK_1R_KERNEL_REF bli_zpackm_30xk_1r_ref - - - -#endif - diff --git a/frame/ind/include/bli_kernel_1m_macro_defs.h b/frame/ind/include/old/bli_kernel_1m_macro_defs.h similarity index 81% rename from frame/ind/include/bli_kernel_1m_macro_defs.h rename to frame/ind/include/old/bli_kernel_1m_macro_defs.h index 4fc0ccb06..62c132304 100644 --- a/frame/ind/include/bli_kernel_1m_macro_defs.h +++ b/frame/ind/include/old/bli_kernel_1m_macro_defs.h @@ -55,51 +55,51 @@ // gemm4m1 micro-kernels #ifndef BLIS_CGEMM1M_UKERNEL -#define BLIS_CGEMM1M_UKERNEL BLIS_CGEMM1M_UKERNEL_REF +#define BLIS_CGEMM1M_UKERNEL BLIS_CGEMM1M_UKERNEL_VIR #endif #ifndef BLIS_ZGEMM1M_UKERNEL -#define BLIS_ZGEMM1M_UKERNEL BLIS_ZGEMM1M_UKERNEL_REF +#define BLIS_ZGEMM1M_UKERNEL BLIS_ZGEMM1M_UKERNEL_VIR #endif // gemmtrsm4m1_l micro-kernels #ifndef BLIS_CGEMMTRSM1M_L_UKERNEL -#define BLIS_CGEMMTRSM1M_L_UKERNEL BLIS_CGEMMTRSM1M_L_UKERNEL_REF +#define BLIS_CGEMMTRSM1M_L_UKERNEL BLIS_CGEMMTRSM1M_L_UKERNEL_VIR #endif #ifndef BLIS_ZGEMMTRSM1M_L_UKERNEL -#define BLIS_ZGEMMTRSM1M_L_UKERNEL BLIS_ZGEMMTRSM1M_L_UKERNEL_REF +#define BLIS_ZGEMMTRSM1M_L_UKERNEL BLIS_ZGEMMTRSM1M_L_UKERNEL_VIR #endif // gemmtrsm4m1_u micro-kernels #ifndef BLIS_CGEMMTRSM1M_U_UKERNEL -#define BLIS_CGEMMTRSM1M_U_UKERNEL BLIS_CGEMMTRSM1M_U_UKERNEL_REF +#define BLIS_CGEMMTRSM1M_U_UKERNEL BLIS_CGEMMTRSM1M_U_UKERNEL_VIR #endif #ifndef BLIS_ZGEMMTRSM1M_U_UKERNEL -#define BLIS_ZGEMMTRSM1M_U_UKERNEL BLIS_ZGEMMTRSM1M_U_UKERNEL_REF +#define BLIS_ZGEMMTRSM1M_U_UKERNEL BLIS_ZGEMMTRSM1M_U_UKERNEL_VIR #endif // trsm4m1_l micro-kernels #ifndef BLIS_CTRSM1M_L_UKERNEL -#define BLIS_CTRSM1M_L_UKERNEL BLIS_CTRSM1M_L_UKERNEL_REF +#define BLIS_CTRSM1M_L_UKERNEL BLIS_CTRSM1M_L_UKERNEL_VIR #endif #ifndef BLIS_ZTRSM1M_L_UKERNEL -#define BLIS_ZTRSM1M_L_UKERNEL BLIS_ZTRSM1M_L_UKERNEL_REF +#define BLIS_ZTRSM1M_L_UKERNEL BLIS_ZTRSM1M_L_UKERNEL_VIR #endif // trsm4m1_u micro-kernels #ifndef BLIS_CTRSM1M_U_UKERNEL -#define BLIS_CTRSM1M_U_UKERNEL BLIS_CTRSM1M_U_UKERNEL_REF +#define BLIS_CTRSM1M_U_UKERNEL BLIS_CTRSM1M_U_UKERNEL_VIR #endif #ifndef BLIS_ZTRSM1M_U_UKERNEL -#define BLIS_ZTRSM1M_U_UKERNEL BLIS_ZTRSM1M_U_UKERNEL_REF +#define BLIS_ZTRSM1M_U_UKERNEL BLIS_ZTRSM1M_U_UKERNEL_VIR #endif diff --git a/frame/ind/include/bli_kernel_3m1_macro_defs.h b/frame/ind/include/old/bli_kernel_3m1_macro_defs.h similarity index 89% rename from frame/ind/include/bli_kernel_3m1_macro_defs.h rename to frame/ind/include/old/bli_kernel_3m1_macro_defs.h index 4303e8fc8..c50c0d215 100644 --- a/frame/ind/include/bli_kernel_3m1_macro_defs.h +++ b/frame/ind/include/old/bli_kernel_3m1_macro_defs.h @@ -55,51 +55,51 @@ // gemm3m1 micro-kernels #ifndef BLIS_CGEMM3M1_UKERNEL -#define BLIS_CGEMM3M1_UKERNEL BLIS_CGEMM3M1_UKERNEL_REF +#define BLIS_CGEMM3M1_UKERNEL BLIS_CGEMM3M1_UKERNEL_VIR #endif #ifndef BLIS_ZGEMM3M1_UKERNEL -#define BLIS_ZGEMM3M1_UKERNEL BLIS_ZGEMM3M1_UKERNEL_REF +#define BLIS_ZGEMM3M1_UKERNEL BLIS_ZGEMM3M1_UKERNEL_VIR #endif // gemmtrsm3m1_l micro-kernels #ifndef BLIS_CGEMMTRSM3M1_L_UKERNEL -#define BLIS_CGEMMTRSM3M1_L_UKERNEL BLIS_CGEMMTRSM3M1_L_UKERNEL_REF +#define BLIS_CGEMMTRSM3M1_L_UKERNEL BLIS_CGEMMTRSM3M1_L_UKERNEL_VIR #endif #ifndef BLIS_ZGEMMTRSM3M1_L_UKERNEL -#define BLIS_ZGEMMTRSM3M1_L_UKERNEL BLIS_ZGEMMTRSM3M1_L_UKERNEL_REF +#define BLIS_ZGEMMTRSM3M1_L_UKERNEL BLIS_ZGEMMTRSM3M1_L_UKERNEL_VIR #endif // gemmtrsm3m1_u micro-kernels #ifndef BLIS_CGEMMTRSM3M1_U_UKERNEL -#define BLIS_CGEMMTRSM3M1_U_UKERNEL BLIS_CGEMMTRSM3M1_U_UKERNEL_REF +#define BLIS_CGEMMTRSM3M1_U_UKERNEL BLIS_CGEMMTRSM3M1_U_UKERNEL_VIR #endif #ifndef BLIS_ZGEMMTRSM3M1_U_UKERNEL -#define BLIS_ZGEMMTRSM3M1_U_UKERNEL BLIS_ZGEMMTRSM3M1_U_UKERNEL_REF +#define BLIS_ZGEMMTRSM3M1_U_UKERNEL BLIS_ZGEMMTRSM3M1_U_UKERNEL_VIR #endif // trsm3m1_l micro-kernels #ifndef BLIS_CTRSM3M1_L_UKERNEL -#define BLIS_CTRSM3M1_L_UKERNEL BLIS_CTRSM3M1_L_UKERNEL_REF +#define BLIS_CTRSM3M1_L_UKERNEL BLIS_CTRSM3M1_L_UKERNEL_VIR #endif #ifndef BLIS_ZTRSM3M1_L_UKERNEL -#define BLIS_ZTRSM3M1_L_UKERNEL BLIS_ZTRSM3M1_L_UKERNEL_REF +#define BLIS_ZTRSM3M1_L_UKERNEL BLIS_ZTRSM3M1_L_UKERNEL_VIR #endif // trsm3m1_u micro-kernels #ifndef BLIS_CTRSM3M1_U_UKERNEL -#define BLIS_CTRSM3M1_U_UKERNEL BLIS_CTRSM3M1_U_UKERNEL_REF +#define BLIS_CTRSM3M1_U_UKERNEL BLIS_CTRSM3M1_U_UKERNEL_VIR #endif #ifndef BLIS_ZTRSM3M1_U_UKERNEL -#define BLIS_ZTRSM3M1_U_UKERNEL BLIS_ZTRSM3M1_U_UKERNEL_REF +#define BLIS_ZTRSM3M1_U_UKERNEL BLIS_ZTRSM3M1_U_UKERNEL_VIR #endif diff --git a/frame/ind/include/bli_kernel_3m2_macro_defs.h b/frame/ind/include/old/bli_kernel_3m2_macro_defs.h similarity index 95% rename from frame/ind/include/bli_kernel_3m2_macro_defs.h rename to frame/ind/include/old/bli_kernel_3m2_macro_defs.h index 5c3c15ba9..b32bdd3ae 100644 --- a/frame/ind/include/bli_kernel_3m2_macro_defs.h +++ b/frame/ind/include/old/bli_kernel_3m2_macro_defs.h @@ -55,11 +55,11 @@ // gemm3m2 micro-kernels #ifndef BLIS_CGEMM3M2_UKERNEL -#define BLIS_CGEMM3M2_UKERNEL BLIS_CGEMM3M2_UKERNEL_REF +#define BLIS_CGEMM3M2_UKERNEL BLIS_CGEMM3M2_UKERNEL_VIR #endif #ifndef BLIS_ZGEMM3M2_UKERNEL -#define BLIS_ZGEMM3M2_UKERNEL BLIS_ZGEMM3M2_UKERNEL_REF +#define BLIS_ZGEMM3M2_UKERNEL BLIS_ZGEMM3M2_UKERNEL_VIR #endif diff --git a/frame/ind/include/bli_kernel_3m3_macro_defs.h b/frame/ind/include/old/bli_kernel_3m3_macro_defs.h similarity index 95% rename from frame/ind/include/bli_kernel_3m3_macro_defs.h rename to frame/ind/include/old/bli_kernel_3m3_macro_defs.h index fea2ef297..8982f0e45 100644 --- a/frame/ind/include/bli_kernel_3m3_macro_defs.h +++ b/frame/ind/include/old/bli_kernel_3m3_macro_defs.h @@ -55,11 +55,11 @@ // gemm3m2 micro-kernels #ifndef BLIS_CGEMM3M3_UKERNEL -#define BLIS_CGEMM3M3_UKERNEL BLIS_CGEMM3M3_UKERNEL_REF +#define BLIS_CGEMM3M3_UKERNEL BLIS_CGEMM3M3_UKERNEL_VIR #endif #ifndef BLIS_ZGEMM3M3_UKERNEL -#define BLIS_ZGEMM3M3_UKERNEL BLIS_ZGEMM3M3_UKERNEL_REF +#define BLIS_ZGEMM3M3_UKERNEL BLIS_ZGEMM3M3_UKERNEL_VIR #endif diff --git a/frame/ind/include/bli_kernel_3mh_macro_defs.h b/frame/ind/include/old/bli_kernel_3mh_macro_defs.h similarity index 95% rename from frame/ind/include/bli_kernel_3mh_macro_defs.h rename to frame/ind/include/old/bli_kernel_3mh_macro_defs.h index 4ea960b7e..ecf2256c3 100644 --- a/frame/ind/include/bli_kernel_3mh_macro_defs.h +++ b/frame/ind/include/old/bli_kernel_3mh_macro_defs.h @@ -55,11 +55,11 @@ // gemm3mh micro-kernels #ifndef BLIS_CGEMM3MH_UKERNEL -#define BLIS_CGEMM3MH_UKERNEL BLIS_CGEMM3MH_UKERNEL_REF +#define BLIS_CGEMM3MH_UKERNEL BLIS_CGEMM3MH_UKERNEL_VIR #endif #ifndef BLIS_ZGEMM3MH_UKERNEL -#define BLIS_ZGEMM3MH_UKERNEL BLIS_ZGEMM3MH_UKERNEL_REF +#define BLIS_ZGEMM3MH_UKERNEL BLIS_ZGEMM3MH_UKERNEL_VIR #endif diff --git a/frame/ind/include/bli_kernel_4m1_macro_defs.h b/frame/ind/include/old/bli_kernel_4m1_macro_defs.h similarity index 89% rename from frame/ind/include/bli_kernel_4m1_macro_defs.h rename to frame/ind/include/old/bli_kernel_4m1_macro_defs.h index 19b3d74a1..5dbc3a969 100644 --- a/frame/ind/include/bli_kernel_4m1_macro_defs.h +++ b/frame/ind/include/old/bli_kernel_4m1_macro_defs.h @@ -55,51 +55,51 @@ // gemm4m1 micro-kernels #ifndef BLIS_CGEMM4M1_UKERNEL -#define BLIS_CGEMM4M1_UKERNEL BLIS_CGEMM4M1_UKERNEL_REF +#define BLIS_CGEMM4M1_UKERNEL BLIS_CGEMM4M1_UKERNEL_VIR #endif #ifndef BLIS_ZGEMM4M1_UKERNEL -#define BLIS_ZGEMM4M1_UKERNEL BLIS_ZGEMM4M1_UKERNEL_REF +#define BLIS_ZGEMM4M1_UKERNEL BLIS_ZGEMM4M1_UKERNEL_VIR #endif // gemmtrsm4m1_l micro-kernels #ifndef BLIS_CGEMMTRSM4M1_L_UKERNEL -#define BLIS_CGEMMTRSM4M1_L_UKERNEL BLIS_CGEMMTRSM4M1_L_UKERNEL_REF +#define BLIS_CGEMMTRSM4M1_L_UKERNEL BLIS_CGEMMTRSM4M1_L_UKERNEL_VIR #endif #ifndef BLIS_ZGEMMTRSM4M1_L_UKERNEL -#define BLIS_ZGEMMTRSM4M1_L_UKERNEL BLIS_ZGEMMTRSM4M1_L_UKERNEL_REF +#define BLIS_ZGEMMTRSM4M1_L_UKERNEL BLIS_ZGEMMTRSM4M1_L_UKERNEL_VIR #endif // gemmtrsm4m1_u micro-kernels #ifndef BLIS_CGEMMTRSM4M1_U_UKERNEL -#define BLIS_CGEMMTRSM4M1_U_UKERNEL BLIS_CGEMMTRSM4M1_U_UKERNEL_REF +#define BLIS_CGEMMTRSM4M1_U_UKERNEL BLIS_CGEMMTRSM4M1_U_UKERNEL_VIR #endif #ifndef BLIS_ZGEMMTRSM4M1_U_UKERNEL -#define BLIS_ZGEMMTRSM4M1_U_UKERNEL BLIS_ZGEMMTRSM4M1_U_UKERNEL_REF +#define BLIS_ZGEMMTRSM4M1_U_UKERNEL BLIS_ZGEMMTRSM4M1_U_UKERNEL_VIR #endif // trsm4m1_l micro-kernels #ifndef BLIS_CTRSM4M1_L_UKERNEL -#define BLIS_CTRSM4M1_L_UKERNEL BLIS_CTRSM4M1_L_UKERNEL_REF +#define BLIS_CTRSM4M1_L_UKERNEL BLIS_CTRSM4M1_L_UKERNEL_VIR #endif #ifndef BLIS_ZTRSM4M1_L_UKERNEL -#define BLIS_ZTRSM4M1_L_UKERNEL BLIS_ZTRSM4M1_L_UKERNEL_REF +#define BLIS_ZTRSM4M1_L_UKERNEL BLIS_ZTRSM4M1_L_UKERNEL_VIR #endif // trsm4m1_u micro-kernels #ifndef BLIS_CTRSM4M1_U_UKERNEL -#define BLIS_CTRSM4M1_U_UKERNEL BLIS_CTRSM4M1_U_UKERNEL_REF +#define BLIS_CTRSM4M1_U_UKERNEL BLIS_CTRSM4M1_U_UKERNEL_VIR #endif #ifndef BLIS_ZTRSM4M1_U_UKERNEL -#define BLIS_ZTRSM4M1_U_UKERNEL BLIS_ZTRSM4M1_U_UKERNEL_REF +#define BLIS_ZTRSM4M1_U_UKERNEL BLIS_ZTRSM4M1_U_UKERNEL_VIR #endif diff --git a/frame/ind/include/bli_kernel_4mb_macro_defs.h b/frame/ind/include/old/bli_kernel_4mb_macro_defs.h similarity index 95% rename from frame/ind/include/bli_kernel_4mb_macro_defs.h rename to frame/ind/include/old/bli_kernel_4mb_macro_defs.h index edea2c4eb..8deaa8c65 100644 --- a/frame/ind/include/bli_kernel_4mb_macro_defs.h +++ b/frame/ind/include/old/bli_kernel_4mb_macro_defs.h @@ -55,11 +55,11 @@ // gemm4mb micro-kernels #ifndef BLIS_CGEMM4MB_UKERNEL -#define BLIS_CGEMM4MB_UKERNEL BLIS_CGEMM4MB_UKERNEL_REF +#define BLIS_CGEMM4MB_UKERNEL BLIS_CGEMM4MB_UKERNEL_VIR #endif #ifndef BLIS_ZGEMM4MB_UKERNEL -#define BLIS_ZGEMM4MB_UKERNEL BLIS_ZGEMM4MB_UKERNEL_REF +#define BLIS_ZGEMM4MB_UKERNEL BLIS_ZGEMM4MB_UKERNEL_VIR #endif diff --git a/frame/ind/include/bli_kernel_4mh_macro_defs.h b/frame/ind/include/old/bli_kernel_4mh_macro_defs.h similarity index 95% rename from frame/ind/include/bli_kernel_4mh_macro_defs.h rename to frame/ind/include/old/bli_kernel_4mh_macro_defs.h index 598e724d0..c7f4e396c 100644 --- a/frame/ind/include/bli_kernel_4mh_macro_defs.h +++ b/frame/ind/include/old/bli_kernel_4mh_macro_defs.h @@ -55,11 +55,11 @@ // gemm4mh micro-kernels #ifndef BLIS_CGEMM4MH_UKERNEL -#define BLIS_CGEMM4MH_UKERNEL BLIS_CGEMM4MH_UKERNEL_REF +#define BLIS_CGEMM4MH_UKERNEL BLIS_CGEMM4MH_UKERNEL_VIR #endif #ifndef BLIS_ZGEMM4MH_UKERNEL -#define BLIS_ZGEMM4MH_UKERNEL BLIS_ZGEMM4MH_UKERNEL_REF +#define BLIS_ZGEMM4MH_UKERNEL BLIS_ZGEMM4MH_UKERNEL_VIR #endif diff --git a/frame/ind/include/bli_kernel_ind_macro_defs.h b/frame/ind/include/old/bli_kernel_ind_macro_defs.h similarity index 96% rename from frame/ind/include/bli_kernel_ind_macro_defs.h rename to frame/ind/include/old/bli_kernel_ind_macro_defs.h index 55eeb010b..8ea27019c 100644 --- a/frame/ind/include/bli_kernel_ind_macro_defs.h +++ b/frame/ind/include/old/bli_kernel_ind_macro_defs.h @@ -35,8 +35,6 @@ // Virtual micro-kernel headers #include "bli_kernel_3mh_macro_defs.h" -#include "bli_kernel_3m3_macro_defs.h" -#include "bli_kernel_3m2_macro_defs.h" #include "bli_kernel_3m1_macro_defs.h" #include "bli_kernel_4mh_macro_defs.h" #include "bli_kernel_4mb_macro_defs.h" diff --git a/frame/ind/include/old/bli_packm_1er_macro_defs.h b/frame/ind/include/old/bli_packm_1er_macro_defs.h new file mode 100644 index 000000000..339086b3a --- /dev/null +++ b/frame/ind/include/old/bli_packm_1er_macro_defs.h @@ -0,0 +1,137 @@ +/* + + 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_1ER_MACRO_DEFS_H +#define BLIS_KERNEL_1ER_MACRO_DEFS_H + + +// -- Define default 1e/1r-specific kernel names ------------------------------- + +// +// 1e/1r +// + +// packm_2xk_1er kernels + +#ifndef BLIS_CPACKM_2XK_1ER_KERNEL +#define BLIS_CPACKM_2XK_1ER_KERNEL BLIS_CPACKM_2XK_1ER_KERNEL_REF +#endif + +#ifndef BLIS_ZPACKM_2XK_1ER_KERNEL +#define BLIS_ZPACKM_2XK_1ER_KERNEL BLIS_ZPACKM_2XK_1ER_KERNEL_REF +#endif + +// packm_4xk_1er kernels + +#ifndef BLIS_CPACKM_4XK_1ER_KERNEL +#define BLIS_CPACKM_4XK_1ER_KERNEL BLIS_CPACKM_4XK_1ER_KERNEL_REF +#endif + +#ifndef BLIS_ZPACKM_4XK_1ER_KERNEL +#define BLIS_ZPACKM_4XK_1ER_KERNEL BLIS_ZPACKM_4XK_1ER_KERNEL_REF +#endif + +// packm_6xk_1er kernels + +#ifndef BLIS_CPACKM_6XK_1ER_KERNEL +#define BLIS_CPACKM_6XK_1ER_KERNEL BLIS_CPACKM_6XK_1ER_KERNEL_REF +#endif + +#ifndef BLIS_ZPACKM_6XK_1ER_KERNEL +#define BLIS_ZPACKM_6XK_1ER_KERNEL BLIS_ZPACKM_6XK_1ER_KERNEL_REF +#endif + +// packm_8xk_1er kernels + +#ifndef BLIS_CPACKM_8XK_1ER_KERNEL +#define BLIS_CPACKM_8XK_1ER_KERNEL BLIS_CPACKM_8XK_1ER_KERNEL_REF +#endif + +#ifndef BLIS_ZPACKM_8XK_1ER_KERNEL +#define BLIS_ZPACKM_8XK_1ER_KERNEL BLIS_ZPACKM_8XK_1ER_KERNEL_REF +#endif + +// packm_10xk_1er kernels + +#ifndef BLIS_CPACKM_10XK_1ER_KERNEL +#define BLIS_CPACKM_10XK_1ER_KERNEL BLIS_CPACKM_10XK_1ER_KERNEL_REF +#endif + +#ifndef BLIS_ZPACKM_10XK_1ER_KERNEL +#define BLIS_ZPACKM_10XK_1ER_KERNEL BLIS_ZPACKM_10XK_1ER_KERNEL_REF +#endif + +// packm_12xk_1er kernels + +#ifndef BLIS_CPACKM_12XK_1ER_KERNEL +#define BLIS_CPACKM_12XK_1ER_KERNEL BLIS_CPACKM_12XK_1ER_KERNEL_REF +#endif + +#ifndef BLIS_ZPACKM_12XK_1ER_KERNEL +#define BLIS_ZPACKM_12XK_1ER_KERNEL BLIS_ZPACKM_12XK_1ER_KERNEL_REF +#endif + +// packm_14xk_1er kernels + +#ifndef BLIS_CPACKM_14XK_1ER_KERNEL +#define BLIS_CPACKM_14XK_1ER_KERNEL BLIS_CPACKM_14XK_1ER_KERNEL_REF +#endif + +#ifndef BLIS_ZPACKM_14XK_1ER_KERNEL +#define BLIS_ZPACKM_14XK_1ER_KERNEL BLIS_ZPACKM_14XK_1ER_KERNEL_REF +#endif + +// packm_16xk_1er kernels + +#ifndef BLIS_CPACKM_16XK_1ER_KERNEL +#define BLIS_CPACKM_16XK_1ER_KERNEL BLIS_CPACKM_16XK_1ER_KERNEL_REF +#endif + +#ifndef BLIS_ZPACKM_16XK_1ER_KERNEL +#define BLIS_ZPACKM_16XK_1ER_KERNEL BLIS_ZPACKM_16XK_1ER_KERNEL_REF +#endif + +// packm_30xk_1er kernels + +#ifndef BLIS_CPACKM_30XK_1ER_KERNEL +#define BLIS_CPACKM_30XK_1ER_KERNEL BLIS_CPACKM_30XK_1ER_KERNEL_REF +#endif + +#ifndef BLIS_ZPACKM_30XK_1ER_KERNEL +#define BLIS_ZPACKM_30XK_1ER_KERNEL BLIS_ZPACKM_30XK_1ER_KERNEL_REF +#endif + + +#endif + diff --git a/frame/ind/include/bli_packm_3mis_macro_defs.h b/frame/ind/include/old/bli_packm_3mis_macro_defs.h similarity index 100% rename from frame/ind/include/bli_packm_3mis_macro_defs.h rename to frame/ind/include/old/bli_packm_3mis_macro_defs.h diff --git a/frame/ind/include/bli_packm_4mi_macro_defs.h b/frame/ind/include/old/bli_packm_4mi_macro_defs.h similarity index 100% rename from frame/ind/include/bli_packm_4mi_macro_defs.h rename to frame/ind/include/old/bli_packm_4mi_macro_defs.h diff --git a/frame/ind/include/bli_packm_rih_macro_defs.h b/frame/ind/include/old/bli_packm_rih_macro_defs.h similarity index 100% rename from frame/ind/include/bli_packm_rih_macro_defs.h rename to frame/ind/include/old/bli_packm_rih_macro_defs.h diff --git a/frame/ind/oapi/bli_l3_3m4m1m_oapi.c b/frame/ind/oapi/bli_l3_3m4m1m_oapi.c index b99ebda39..8059f5301 100644 --- a/frame/ind/oapi/bli_l3_3m4m1m_oapi.c +++ b/frame/ind/oapi/bli_l3_3m4m1m_oapi.c @@ -49,10 +49,10 @@ void PASTEMAC(opname,imeth) \ cntx_t* cntx \ ) \ { \ + ind_t ind = PASTEMAC0(imeth); \ num_t dt = bli_obj_datatype( *c ); \ obj_t* beta_use = beta; \ \ - cntx_t* cntx_p; \ dim_t i; \ \ /* If the objects are in the real domain, execute the native @@ -78,14 +78,18 @@ void PASTEMAC(opname,imeth) \ } \ */ \ \ - /* Initialize a local context if the one provided is NULL. */ \ - bli_cntx_init_local_if2( cname, imeth, dt, cntx, cntx_p ); \ + /* Query a context for the current induced method. This context is + managed and cached by the gks and should not be freed by the caller. + Note that we pass in the datatype because it will be needed when + bli_gks_query_ind_cntx() eventually calls the bli_ind_cntx_init() + family of functions. */ \ + cntx = bli_gks_query_ind_cntx( ind, dt ); \ \ /* Some induced methods execute in multiple "stages". */ \ for ( i = 0; i < nstage; ++i ) \ { \ /* Prepare the context for the ith stage of computation. */ \ - PASTEMAC2(cname,imeth,_cntx_stage)( i, cntx_p ); \ + bli_cntx_ind_stage( ind, i, cntx ); \ \ /* For multi-stage methods, use BLIS_ONE as beta after the first stage. */ \ @@ -93,17 +97,12 @@ void PASTEMAC(opname,imeth) \ \ /* Invoke the operation's front end and request the default control tree. */ \ - PASTEMAC(opname,_front)( alpha, a, b, beta_use, c, cntx_p, NULL ); \ + PASTEMAC(opname,_front)( alpha, a, b, beta_use, c, cntx, NULL ); \ } \ -\ - /* Finalize the local context if it was initialized here. */ \ - bli_cntx_finalize_local_if2( cname, imeth, cntx ); \ } // gemm GENFRONT( gemm, gemm, 3mh, 3 ) -GENFRONT( gemm, gemm, 3m3, 1 ) -GENFRONT( gemm, gemm, 3m2, 1 ) GENFRONT( gemm, gemm, 3m1, 1 ) GENFRONT( gemm, gemm, 4mh, 4 ) GENFRONT( gemm, gemm, 4mb, 1 ) @@ -112,8 +111,6 @@ GENFRONT( gemm, gemm, 1m, 1 ) // her2k GENFRONT( her2k, gemm, 3mh, 3 ) -//GENFRONT( her2k, gemm, 3m3, 1 ) // Not implemented. -//GENFRONT( her2k, gemm, 3m2, 1 ) // Not implemented. GENFRONT( her2k, gemm, 3m1, 1 ) GENFRONT( her2k, gemm, 4mh, 4 ) //GENFRONT( her2k, gemm, 4mb, 1 ) // Not implemented. @@ -122,8 +119,6 @@ GENFRONT( her2k, gemm, 1m, 1 ) // syr2k GENFRONT( syr2k, gemm, 3mh, 3 ) -//GENFRONT( syr2k, gemm, 3m3, 1 ) // Not implemented. -//GENFRONT( syr2k, gemm, 3m2, 1 ) // Not implemented. GENFRONT( syr2k, gemm, 3m1, 1 ) GENFRONT( syr2k, gemm, 4mh, 4 ) //GENFRONT( syr2k, gemm, 4mb, 1 ) // Not implemented. @@ -147,10 +142,10 @@ void PASTEMAC(opname,imeth) \ cntx_t* cntx \ ) \ { \ + ind_t ind = PASTEMAC0(imeth); \ num_t dt = bli_obj_datatype( *c ); \ obj_t* beta_use = beta; \ \ - cntx_t* cntx_p; \ dim_t i; \ \ /* If the objects are in the real domain, execute the native @@ -161,14 +156,18 @@ void PASTEMAC(opname,imeth) \ return; \ } \ \ - /* Initialize a local context if the one provided is NULL. */ \ - bli_cntx_init_local_if2( cname, imeth, dt, cntx, cntx_p ); \ + /* Query a context for the current induced method. This context is + managed and cached by the gks and should not be freed by the caller. + Note that we pass in the datatype because it will be needed when + bli_gks_query_ind_cntx() eventually calls the bli_ind_cntx_init() + family of functions. */ \ + cntx = bli_gks_query_ind_cntx( ind, dt ); \ \ /* Some induced methods execute in multiple "stages". */ \ for ( i = 0; i < nstage; ++i ) \ { \ /* Prepare the context for the ith stage of computation. */ \ - PASTEMAC2(cname,imeth,_cntx_stage)( i, cntx_p ); \ + bli_cntx_ind_stage( ind, i, cntx ); \ \ /* For multi-stage methods, use BLIS_ONE as beta after the first stage. */ \ @@ -176,17 +175,12 @@ void PASTEMAC(opname,imeth) \ \ /* Invoke the operation's front end and request the default control tree. */ \ - PASTEMAC(opname,_front)( side, alpha, a, b, beta_use, c, cntx_p, NULL ); \ + PASTEMAC(opname,_front)( side, alpha, a, b, beta_use, c, cntx, NULL ); \ } \ -\ - /* Finalize the local context if it was initialized here. */ \ - bli_cntx_finalize_local_if2( cname, imeth, cntx ); \ } // hemm GENFRONT( hemm, gemm, 3mh, 3 ) -//GENFRONT( hemm, gemm, 3m3, 1 ) // Not implemented. -//GENFRONT( hemm, gemm, 3m2, 1 ) // Not implemented. GENFRONT( hemm, gemm, 3m1, 1 ) GENFRONT( hemm, gemm, 4mh, 4 ) //GENFRONT( hemm, gemm, 4mb, 1 ) // Not implemented. @@ -195,8 +189,6 @@ GENFRONT( hemm, gemm, 1m, 1 ) // symm GENFRONT( symm, gemm, 3mh, 3 ) -//GENFRONT( symm, gemm, 3m3, 1 ) // Not implemented. -//GENFRONT( symm, gemm, 3m2, 1 ) // Not implemented. GENFRONT( symm, gemm, 3m1, 1 ) GENFRONT( symm, gemm, 4mh, 4 ) //GENFRONT( symm, gemm, 4mb, 1 ) // Not implemented. @@ -205,8 +197,6 @@ GENFRONT( symm, gemm, 1m, 1 ) // trmm3 GENFRONT( trmm3, gemm, 3mh, 3 ) -//GENFRONT( trmm3, gemm, 3m3, 1 ) // Not implemented. -//GENFRONT( trmm3, gemm, 3m2, 1 ) // Not implemented. GENFRONT( trmm3, gemm, 3m1, 1 ) GENFRONT( trmm3, gemm, 4mh, 4 ) //GENFRONT( trmm3, gemm, 4mb, 1 ) // Not implemented. @@ -228,10 +218,10 @@ void PASTEMAC(opname,imeth) \ cntx_t* cntx \ ) \ { \ + ind_t ind = PASTEMAC0(imeth); \ num_t dt = bli_obj_datatype( *c ); \ obj_t* beta_use = beta; \ \ - cntx_t* cntx_p; \ dim_t i; \ \ /* If the objects are in the real domain, execute the native @@ -242,14 +232,18 @@ void PASTEMAC(opname,imeth) \ return; \ } \ \ - /* Initialize a local context if the one provided is NULL. */ \ - bli_cntx_init_local_if2( cname, imeth, dt, cntx, cntx_p ); \ + /* Query a context for the current induced method. This context is + managed and cached by the gks and should not be freed by the caller. + Note that we pass in the datatype because it will be needed when + bli_gks_query_ind_cntx() eventually calls the bli_ind_cntx_init() + family of functions. */ \ + cntx = bli_gks_query_ind_cntx( ind, dt ); \ \ /* Some induced methods execute in multiple "stages". */ \ for ( i = 0; i < nstage; ++i ) \ { \ /* Prepare the context for the ith stage of computation. */ \ - PASTEMAC2(cname,imeth,_cntx_stage)( i, cntx_p ); \ + bli_cntx_ind_stage( ind, i, cntx ); \ \ /* For multi-stage methods, use BLIS_ONE as beta after the first stage. */ \ @@ -257,17 +251,12 @@ void PASTEMAC(opname,imeth) \ \ /* Invoke the operation's front end and request the default control tree. */ \ - PASTEMAC(opname,_front)( alpha, a, beta_use, c, cntx_p, NULL ); \ + PASTEMAC(opname,_front)( alpha, a, beta_use, c, cntx, NULL ); \ } \ -\ - /* Finalize the local context if it was initialized here. */ \ - bli_cntx_finalize_local_if2( cname, imeth, cntx ); \ } // herk GENFRONT( herk, gemm, 3mh, 3 ) -//GENFRONT( herk, gemm, 3m3, 1 ) // Not implemented. -//GENFRONT( herk, gemm, 3m2, 1 ) // Not implemented. GENFRONT( herk, gemm, 3m1, 1 ) GENFRONT( herk, gemm, 4mh, 4 ) //GENFRONT( herk, gemm, 4mb, 1 ) // Not implemented. @@ -276,8 +265,6 @@ GENFRONT( herk, gemm, 1m, 1 ) // syrk GENFRONT( syrk, gemm, 3mh, 3 ) -//GENFRONT( syrk, gemm, 3m3, 1 ) // Not implemented. -//GENFRONT( syrk, gemm, 3m2, 1 ) // Not implemented. GENFRONT( syrk, gemm, 3m1, 1 ) GENFRONT( syrk, gemm, 4mh, 4 ) //GENFRONT( syrk, gemm, 4mb, 1 ) // Not implemented. @@ -299,9 +286,9 @@ void PASTEMAC(opname,imeth) \ cntx_t* cntx \ ) \ { \ + ind_t ind = PASTEMAC0(imeth); \ num_t dt = bli_obj_datatype( *b ); \ \ - cntx_t* cntx_p; \ dim_t i; \ \ /* If the objects are in the real domain, execute the native @@ -312,28 +299,27 @@ void PASTEMAC(opname,imeth) \ return; \ } \ \ - /* Initialize a local context if the one provided is NULL. */ \ - bli_cntx_init_local_if2( cname, imeth, dt, cntx, cntx_p ); \ + /* Query a context for the current induced method. This context is + managed and cached by the gks and should not be freed by the caller. + Note that we pass in the datatype because it will be needed when + bli_gks_query_ind_cntx() eventually calls the bli_ind_cntx_init() + family of functions. */ \ + cntx = bli_gks_query_ind_cntx( ind, dt ); \ \ /* Some induced methods execute in multiple "stages". */ \ for ( i = 0; i < nstage; ++i ) \ { \ /* Prepare the context for the ith stage of computation. */ \ - PASTEMAC2(cname,imeth,_cntx_stage)( i, cntx_p ); \ + bli_cntx_ind_stage( ind, i, cntx ); \ \ /* Invoke the operation's front end and request the default control tree. */ \ - PASTEMAC(opname,_front)( side, alpha, a, b, cntx_p, NULL ); \ + PASTEMAC(opname,_front)( side, alpha, a, b, cntx, NULL ); \ } \ -\ - /* Finalize the local context if it was initialized here. */ \ - bli_cntx_finalize_local_if2( cname, imeth, cntx ); \ } // trmm //GENFRONT( trmm, gemm, 3mh, 3 ) // Unimplementable. -//GENFRONT( trmm, gemm, 3m3, 1 ) // Unimplementable. -//GENFRONT( trmm, gemm, 3m2, 1 ) // Unimplementable. GENFRONT( trmm, gemm, 3m1, 1 ) //GENFRONT( trmm, gemm, 4mh, 4 ) // Unimplementable. //GENFRONT( trmm, gemm, 4mb, 1 ) // Unimplementable. @@ -355,9 +341,8 @@ void PASTEMAC(opname,imeth) \ cntx_t* cntx \ ) \ { \ + ind_t ind = PASTEMAC0(imeth); \ num_t dt = bli_obj_datatype( *b ); \ -\ - cntx_t* cntx_p; \ \ /* If the objects are in the real domain, execute the native implementation. */ \ @@ -367,8 +352,12 @@ void PASTEMAC(opname,imeth) \ return; \ } \ \ - /* Initialize a local context if the one provided is NULL. */ \ - bli_cntx_init_local_if2( cname, imeth, dt, cntx, cntx_p ); \ + /* Query a context for the current induced method. This context is + managed and cached by the gks and should not be freed by the caller. + Note that we pass in the datatype because it will be needed when + bli_gks_query_ind_cntx() eventually calls the bli_ind_cntx_init() + family of functions. */ \ + cntx = bli_gks_query_ind_cntx( ind, dt ); \ \ { \ /* NOTE: trsm cannot be implemented via any induced method that @@ -376,17 +365,12 @@ void PASTEMAC(opname,imeth) \ \ /* Invoke the operation's front end and request the default control tree. */ \ - PASTEMAC(opname,_front)( side, alpha, a, b, cntx_p, NULL ); \ + PASTEMAC(opname,_front)( side, alpha, a, b, cntx, NULL ); \ } \ -\ - /* Finalize the local context if it was initialized here. */ \ - bli_cntx_finalize_local_if2( cname, imeth, cntx ); \ } // trsm //GENFRONT( trmm, trsm, 3mh, 3 ) // Unimplementable. -//GENFRONT( trmm, trsm, 3m3, 1 ) // Unimplementable. -//GENFRONT( trmm, trsm, 3m2, 1 ) // Unimplementable. GENFRONT( trsm, trsm, 3m1, 1 ) //GENFRONT( trmm, trsm, 4mh, 4 ) // Unimplementable. //GENFRONT( trmm, trsm, 4mb, 1 ) // Unimplementable. diff --git a/frame/ind/oapi/bli_l3_ind_oapi.h b/frame/ind/oapi/bli_l3_ind_oapi.h index f5907d414..e7f11a5f0 100644 --- a/frame/ind/oapi/bli_l3_ind_oapi.h +++ b/frame/ind/oapi/bli_l3_ind_oapi.h @@ -75,8 +75,6 @@ void PASTEMAC(syr2k,imeth)( obj_t* alpha, obj_t* a, obj_t* b, obj_t void PASTEMAC(trmm3,imeth)( side_t side, obj_t* alpha, obj_t* a, obj_t* b, obj_t* beta, obj_t* c, cntx_t* cntx ); GENPROT_NO2OP( 3mh ) -GENPROT_NO2OP( 3m3 ) -GENPROT_NO2OP( 3m2 ) GENPROT_NO2OP( 4mh ) GENPROT_NO2OP( 4mb ) @@ -86,11 +84,13 @@ GENPROT_NO2OP( 4mb ) // (e.g., block-panel or panel-block). // +/* #undef GENPROT #define GENPROT( imeth, alg ) \ \ void PASTEMAC2(gemm,imeth,alg) ( obj_t* alpha, obj_t* a, obj_t* b, obj_t* beta, obj_t* c ); \ +*/ -GENPROT( 1m, bp ) -GENPROT( 1m, pb ) +//GENPROT( 1m, bp ) +//GENPROT( 1m, pb ) diff --git a/frame/ind/oapi/bli_l3_nat_oapi.c b/frame/ind/oapi/bli_l3_nat_oapi.c index c783714fe..5f88fc17c 100644 --- a/frame/ind/oapi/bli_l3_nat_oapi.c +++ b/frame/ind/oapi/bli_l3_nat_oapi.c @@ -55,21 +55,15 @@ void PASTEMAC(opname,imeth) \ cntx_t* cntx \ ) \ { \ - num_t dt = bli_obj_datatype( *c ); \ - cntx_t* cntx_p; \ -\ - /* Initialize a local context if the one provided is NULL. */ \ - bli_cntx_init_local_if2( cname, imeth, dt, cntx, cntx_p ); \ + /* Obtain a valid (native) context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Invoke the operation's front end with the appropriate control tree. */ \ PASTEMAC(opname,_front) \ ( \ - alpha, a, b, beta, c, cntx_p, NULL \ + alpha, a, b, beta, c, cntx, NULL \ ); \ -\ - /* Finalize the local context if it was initialized here. */ \ - bli_cntx_finalize_local_if2( cname, imeth, cntx ); \ } GENFRONT( gemm, gemm, nat ) @@ -93,21 +87,15 @@ void PASTEMAC(opname,imeth) \ cntx_t* cntx \ ) \ { \ - num_t dt = bli_obj_datatype( *c ); \ - cntx_t* cntx_p; \ -\ - /* Initialize a local context if the one provided is NULL. */ \ - bli_cntx_init_local_if2( cname, imeth, dt, cntx, cntx_p ); \ + /* Obtain a valid (native) context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Invoke the operation's front end with the appropriate control tree. */ \ PASTEMAC(opname,_front) \ ( \ - side, alpha, a, b, beta, c, cntx_p, NULL \ + side, alpha, a, b, beta, c, cntx, NULL \ ); \ -\ - /* Finalize the local context if it was initialized here. */ \ - bli_cntx_finalize_local_if2( cname, imeth, cntx ); \ } GENFRONT( hemm, gemm, nat ) @@ -129,21 +117,15 @@ void PASTEMAC(opname,imeth) \ cntx_t* cntx \ ) \ { \ - num_t dt = bli_obj_datatype( *c ); \ - cntx_t* cntx_p; \ -\ - /* Initialize a local context if the one provided is NULL. */ \ - bli_cntx_init_local_if2( cname, imeth, dt, cntx, cntx_p ); \ + /* Obtain a valid (native) context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Invoke the operation's front end with the appropriate control tree. */ \ PASTEMAC(opname,_front) \ ( \ - alpha, a, beta, c, cntx_p, NULL \ + alpha, a, beta, c, cntx, NULL \ ); \ -\ - /* Finalize the local context if it was initialized here. */ \ - bli_cntx_finalize_local_if2( cname, imeth, cntx ); \ } GENFRONT( herk, gemm, nat ) @@ -164,21 +146,15 @@ void PASTEMAC(opname,imeth) \ cntx_t* cntx \ ) \ { \ - num_t dt = bli_obj_datatype( *b ); \ - cntx_t* cntx_p; \ -\ - /* Initialize a local context if the one provided is NULL. */ \ - bli_cntx_init_local_if2( cname, imeth, dt, cntx, cntx_p ); \ + /* Obtain a valid (native) context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Invoke the operation's front end with the appropriate control tree. */ \ PASTEMAC(opname,_front) \ ( \ - side, alpha, a, b, cntx_p, NULL \ + side, alpha, a, b, cntx, NULL \ ); \ -\ - /* Finalize the local context if it was initialized here. */ \ - bli_cntx_finalize_local_if2( cname, imeth, cntx ); \ } GENFRONT( trmm, gemm, nat ) @@ -198,21 +174,15 @@ void PASTEMAC(opname,imeth) \ cntx_t* cntx \ ) \ { \ - num_t dt = bli_obj_datatype( *b ); \ - cntx_t* cntx_p; \ -\ - /* Initialize a local context if the one provided is NULL. */ \ - bli_cntx_init_local_if2( cname, imeth, dt, cntx, cntx_p ); \ + /* Obtain a valid (native) context from the gks if necessary. */ \ + if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \ \ /* Invoke the operation's front end with the appropriate control tree. */ \ PASTEMAC(opname,_front) \ ( \ - side, alpha, a, b, cntx_p, NULL \ + side, alpha, a, b, cntx, NULL \ ); \ -\ - /* Finalize the local context if it was initialized here. */ \ - bli_cntx_finalize_local_if2( cname, imeth, cntx ); \ } GENFRONT( trsm, trsm, nat ) diff --git a/frame/ind/oapi/bli_l3_1mbppb_oapi.c b/frame/ind/oapi/old/bli_l3_1mbppb_oapi.c similarity index 77% rename from frame/ind/oapi/bli_l3_1mbppb_oapi.c rename to frame/ind/oapi/old/bli_l3_1mbppb_oapi.c index e91f27ea2..2a8eb614b 100644 --- a/frame/ind/oapi/bli_l3_1mbppb_oapi.c +++ b/frame/ind/oapi/old/bli_l3_1mbppb_oapi.c @@ -49,7 +49,7 @@ void PASTEMAC2(opname,imeth,alg) \ ) \ { \ num_t dt = bli_obj_datatype( *c ); \ - cntx_t cntx; \ + cntx_t* cntx_p; \ cntl_t* cntl_p; \ \ /* If the objects are in the real domain, execute the native @@ -60,23 +60,32 @@ void PASTEMAC2(opname,imeth,alg) \ return; \ } \ \ - /* Initialize a local 1m context for the current algorithm (bp or pb). */ \ - PASTEMAC3(opname,imeth,alg,_cntx_init)( dt, &cntx ); \ + /* Query a context for the current induced method. This context is + managed and cached by the gks and should not be freed by the caller. + Note that we pass in the datatype because it will be needed when + bli_gks_query_ind_cntx() eventually calls the bli_ind_cntx_init() + family of functions. */ \ + cntx_p = bli_gks_query_ind_cntx( BLIS_1M, dt ); \ +\ + /* We're not supposed to modify contexts given to us by the gks, but + we're going to cheat in order to change the context to one for bp + or pb. (The default is bp.) NOTE: THIS IS NOT THREAD-SAFE FOR + APPLICATION-LEVEL THREADING. */ \ + if ( PASTEMAC2(opname,imeth,alg) == \ + PASTEMAC2(opname,imeth,pb) ) \ + PASTEMAC2(opname,pb,_cntx_init)( dt, cntx_p ); \ \ /* Create a control tree for the current algorithm (bp or pb). */ \ cntl_p = PASTEMAC2(opname,alg,_cntl_create)( BLIS_GEMM ); \ \ /* Invoke the operation's front end using the context and control tree we just created. */ \ - PASTEMAC(opname,_front)( alpha, a, b, beta, c, &cntx, cntl_p ); \ + PASTEMAC(opname,_front)( alpha, a, b, beta, c, cntx_p, cntl_p ); \ \ /* Free the control tree. Since the implementation will only make copies of it (and not use it directly) we do not need to supply a thread object. */ \ bli_cntl_free( cntl_p, NULL ); \ -\ - /* Finalize the local context. */ \ - PASTEMAC2(opname,imeth,_cntx_finalize)( &cntx ); \ } // gemm diff --git a/frame/ind/tapi/bli_l3_ind_tapi.c b/frame/ind/tapi/bli_l3_ind_tapi.c index d4425b5f6..927c423fc 100644 --- a/frame/ind/tapi/bli_l3_ind_tapi.c +++ b/frame/ind/tapi/bli_l3_ind_tapi.c @@ -84,8 +84,6 @@ void PASTEMAC(ch,opname) \ } INSERT_GENTFUNC_BASIC0( gemm3mh ) -INSERT_GENTFUNC_BASIC0( gemm3m3 ) -INSERT_GENTFUNC_BASIC0( gemm3m2 ) INSERT_GENTFUNC_BASIC0( gemm3m1 ) INSERT_GENTFUNC_BASIC0( gemm4mh ) INSERT_GENTFUNC_BASIC0( gemm4mb ) diff --git a/frame/ind/tapi/bli_l3_ind_tapi.h b/frame/ind/tapi/bli_l3_ind_tapi.h index 7aa886b3d..62575280f 100644 --- a/frame/ind/tapi/bli_l3_ind_tapi.h +++ b/frame/ind/tapi/bli_l3_ind_tapi.h @@ -51,14 +51,12 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( gemm3mh ) -INSERT_GENTPROT_BASIC( gemm3m3 ) -INSERT_GENTPROT_BASIC( gemm3m2 ) -INSERT_GENTPROT_BASIC( gemm3m1 ) -INSERT_GENTPROT_BASIC( gemm4mh ) -INSERT_GENTPROT_BASIC( gemm4mb ) -INSERT_GENTPROT_BASIC( gemm4m1 ) -INSERT_GENTPROT_BASIC( gemm1m ) +INSERT_GENTPROT_BASIC0( gemm3mh ) +INSERT_GENTPROT_BASIC0( gemm3m1 ) +INSERT_GENTPROT_BASIC0( gemm4mh ) +INSERT_GENTPROT_BASIC0( gemm4mb ) +INSERT_GENTPROT_BASIC0( gemm4m1 ) +INSERT_GENTPROT_BASIC0( gemm1m ) #undef GENTPROT @@ -80,11 +78,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( hemm3mh ) -INSERT_GENTPROT_BASIC( hemm3m1 ) -INSERT_GENTPROT_BASIC( hemm4mh ) -INSERT_GENTPROT_BASIC( hemm4m1 ) -INSERT_GENTPROT_BASIC( hemm1m ) +INSERT_GENTPROT_BASIC0( hemm3mh ) +INSERT_GENTPROT_BASIC0( hemm3m1 ) +INSERT_GENTPROT_BASIC0( hemm4mh ) +INSERT_GENTPROT_BASIC0( hemm4m1 ) +INSERT_GENTPROT_BASIC0( hemm1m ) #undef GENTPROTR @@ -105,11 +103,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( her2k3mh ) -INSERT_GENTPROTR_BASIC( her2k3m1 ) -INSERT_GENTPROTR_BASIC( her2k4mh ) -INSERT_GENTPROTR_BASIC( her2k4m1 ) -INSERT_GENTPROTR_BASIC( her2k1m ) +INSERT_GENTPROTR_BASIC0( her2k3mh ) +INSERT_GENTPROTR_BASIC0( her2k3m1 ) +INSERT_GENTPROTR_BASIC0( her2k4mh ) +INSERT_GENTPROTR_BASIC0( her2k4m1 ) +INSERT_GENTPROTR_BASIC0( her2k1m ) #undef GENTPROTR @@ -128,11 +126,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( herk3mh ) -INSERT_GENTPROTR_BASIC( herk3m1 ) -INSERT_GENTPROTR_BASIC( herk4mh ) -INSERT_GENTPROTR_BASIC( herk4m1 ) -INSERT_GENTPROTR_BASIC( herk1m ) +INSERT_GENTPROTR_BASIC0( herk3mh ) +INSERT_GENTPROTR_BASIC0( herk3m1 ) +INSERT_GENTPROTR_BASIC0( herk4mh ) +INSERT_GENTPROTR_BASIC0( herk4m1 ) +INSERT_GENTPROTR_BASIC0( herk1m ) #undef GENTPROT @@ -154,11 +152,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( symm3mh ) -INSERT_GENTPROT_BASIC( symm3m1 ) -INSERT_GENTPROT_BASIC( symm4mh ) -INSERT_GENTPROT_BASIC( symm4m1 ) -INSERT_GENTPROT_BASIC( symm1m ) +INSERT_GENTPROT_BASIC0( symm3mh ) +INSERT_GENTPROT_BASIC0( symm3m1 ) +INSERT_GENTPROT_BASIC0( symm4mh ) +INSERT_GENTPROT_BASIC0( symm4m1 ) +INSERT_GENTPROT_BASIC0( symm1m ) #undef GENTPROT @@ -179,11 +177,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( syr2k3mh ) -INSERT_GENTPROT_BASIC( syr2k3m1 ) -INSERT_GENTPROT_BASIC( syr2k4mh ) -INSERT_GENTPROT_BASIC( syr2k4m1 ) -INSERT_GENTPROT_BASIC( syr2k1m ) +INSERT_GENTPROT_BASIC0( syr2k3mh ) +INSERT_GENTPROT_BASIC0( syr2k3m1 ) +INSERT_GENTPROT_BASIC0( syr2k4mh ) +INSERT_GENTPROT_BASIC0( syr2k4m1 ) +INSERT_GENTPROT_BASIC0( syr2k1m ) #undef GENTPROT @@ -202,11 +200,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( syrk3mh ) -INSERT_GENTPROT_BASIC( syrk3m1 ) -INSERT_GENTPROT_BASIC( syrk4mh ) -INSERT_GENTPROT_BASIC( syrk4m1 ) -INSERT_GENTPROT_BASIC( syrk1m ) +INSERT_GENTPROT_BASIC0( syrk3mh ) +INSERT_GENTPROT_BASIC0( syrk3m1 ) +INSERT_GENTPROT_BASIC0( syrk4mh ) +INSERT_GENTPROT_BASIC0( syrk4m1 ) +INSERT_GENTPROT_BASIC0( syrk1m ) #undef GENTPROT @@ -229,11 +227,11 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( trmm33mh ) -INSERT_GENTPROT_BASIC( trmm33m1 ) -INSERT_GENTPROT_BASIC( trmm34mh ) -INSERT_GENTPROT_BASIC( trmm34m1 ) -INSERT_GENTPROT_BASIC( trmm31m ) +INSERT_GENTPROT_BASIC0( trmm33mh ) +INSERT_GENTPROT_BASIC0( trmm33m1 ) +INSERT_GENTPROT_BASIC0( trmm34mh ) +INSERT_GENTPROT_BASIC0( trmm34m1 ) +INSERT_GENTPROT_BASIC0( trmm31m ) #undef GENTPROT @@ -253,9 +251,9 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( trmm3m1 ) -INSERT_GENTPROT_BASIC( trmm4m1 ) -INSERT_GENTPROT_BASIC( trmm1m ) +INSERT_GENTPROT_BASIC0( trmm3m1 ) +INSERT_GENTPROT_BASIC0( trmm4m1 ) +INSERT_GENTPROT_BASIC0( trmm1m ) #undef GENTPROT @@ -275,7 +273,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( trsm3m1 ) -INSERT_GENTPROT_BASIC( trsm4m1 ) -INSERT_GENTPROT_BASIC( trsm1m ) +INSERT_GENTPROT_BASIC0( trsm3m1 ) +INSERT_GENTPROT_BASIC0( trsm4m1 ) +INSERT_GENTPROT_BASIC0( trsm1m ) diff --git a/frame/ind/ukernels/bli_l3_ind_ukr.h b/frame/ind/ukernels/bli_l3_ind_ukr.h new file mode 100644 index 000000000..9ed2fb243 --- /dev/null +++ b/frame/ind/ukernels/bli_l3_ind_ukr.h @@ -0,0 +1,107 @@ +/* + + 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. + +*/ + +// +// Define template prototypes for level-3 micro-kernels. +// + +// 1m micro-kernels + +#undef GENTPROT +#define GENTPROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + dim_t k, \ + ctype* restrict alpha, \ + ctype* restrict a, \ + ctype* restrict b, \ + ctype* restrict beta, \ + ctype* restrict c, inc_t rs_c, inc_t cs_c, \ + auxinfo_t* restrict data, \ + cntx_t* restrict cntx \ + ); + +INSERT_GENTPROT_BASIC0( gemm3mh_ukr_name ) +INSERT_GENTPROT_BASIC0( gemm3m1_ukr_name ) +INSERT_GENTPROT_BASIC0( gemm4mh_ukr_name ) +INSERT_GENTPROT_BASIC0( gemm4mb_ukr_name ) +INSERT_GENTPROT_BASIC0( gemm4m1_ukr_name ) +INSERT_GENTPROT_BASIC0( gemm1m_ukr_name ) + + +#undef GENTPROT +#define GENTPROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + dim_t k, \ + ctype* restrict alpha, \ + ctype* restrict a1x, \ + ctype* restrict a11, \ + ctype* restrict bx1, \ + ctype* restrict b11, \ + ctype* restrict c11, inc_t rs_c, inc_t cs_c, \ + auxinfo_t* restrict data, \ + cntx_t* restrict cntx \ + ); + +INSERT_GENTPROT_BASIC0( gemmtrsm3m1_l_ukr_name ) +INSERT_GENTPROT_BASIC0( gemmtrsm3m1_u_ukr_name ) +INSERT_GENTPROT_BASIC0( gemmtrsm4m1_l_ukr_name ) +INSERT_GENTPROT_BASIC0( gemmtrsm4m1_u_ukr_name ) +INSERT_GENTPROT_BASIC0( gemmtrsm1m_l_ukr_name ) +INSERT_GENTPROT_BASIC0( gemmtrsm1m_u_ukr_name ) + + +#undef GENTPROT +#define GENTPROT( ctype, ch, opname ) \ +\ +void PASTEMAC(ch,opname) \ + ( \ + ctype* restrict a, \ + ctype* restrict b, \ + ctype* restrict c, inc_t rs_c, inc_t cs_c, \ + auxinfo_t* restrict data, \ + cntx_t* restrict cntx \ + ); + +INSERT_GENTPROT_BASIC0( trsm3m1_l_ukr_name ) +INSERT_GENTPROT_BASIC0( trsm3m1_u_ukr_name ) +INSERT_GENTPROT_BASIC0( trsm4m1_l_ukr_name ) +INSERT_GENTPROT_BASIC0( trsm4m1_u_ukr_name ) +INSERT_GENTPROT_BASIC0( trsm1m_l_ukr_name ) +INSERT_GENTPROT_BASIC0( trsm1m_u_ukr_name ) + + diff --git a/frame/ind/ukernels/gemm/bli_gemm1m_ukr_ref.c.prev b/frame/ind/ukernels/gemm/old/bli_gemm1m_ukr_vir.c.prev similarity index 99% rename from frame/ind/ukernels/gemm/bli_gemm1m_ukr_ref.c.prev rename to frame/ind/ukernels/gemm/old/bli_gemm1m_ukr_vir.c.prev index 3760bdd7c..1e6331294 100644 --- a/frame/ind/ukernels/gemm/bli_gemm1m_ukr_ref.c.prev +++ b/frame/ind/ukernels/gemm/old/bli_gemm1m_ukr_vir.c.prev @@ -184,5 +184,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC( gemm1m_ukr_ref, BLIS_GEMM_UKR ) +INSERT_GENTFUNCCO_BASIC( gemm1m_ukr_vir, BLIS_GEMM_UKR ) diff --git a/frame/ind/ukernels/gemm/bli_gemm3m2_ukr_ref.c b/frame/ind/ukernels/gemm/old/bli_gemm3m2_ukr_vir.c similarity index 99% rename from frame/ind/ukernels/gemm/bli_gemm3m2_ukr_ref.c rename to frame/ind/ukernels/gemm/old/bli_gemm3m2_ukr_vir.c index 57c2488f0..737752930 100644 --- a/frame/ind/ukernels/gemm/bli_gemm3m2_ukr_ref.c +++ b/frame/ind/ukernels/gemm/old/bli_gemm3m2_ukr_vir.c @@ -306,5 +306,5 @@ void PASTEMAC(ch,varname) \ PASTEMAC(chr,fprintm)( stdout, "gemm3m2_ukr: a1", m, k, a_cast, 1, m, "%4.1f", "" );*/ \ } -INSERT_GENTFUNCCO_BASIC( gemm3m2_ukr_ref, BLIS_GEMM_UKR ) +INSERT_GENTFUNCCO_BASIC( gemm3m2_ukr_vir, BLIS_GEMM_UKR ) diff --git a/frame/ind/ukernels/gemm/bli_gemm3m3_ukr_ref.c b/frame/ind/ukernels/gemm/old/bli_gemm3m3_ukr_vir.c similarity index 99% rename from frame/ind/ukernels/gemm/bli_gemm3m3_ukr_ref.c rename to frame/ind/ukernels/gemm/old/bli_gemm3m3_ukr_vir.c index c999107fd..9187901b6 100644 --- a/frame/ind/ukernels/gemm/bli_gemm3m3_ukr_ref.c +++ b/frame/ind/ukernels/gemm/old/bli_gemm3m3_ukr_vir.c @@ -310,5 +310,5 @@ void PASTEMAC(ch,varname) \ PASTEMAC(chr,fprintm)( stdout, "gemm3m3_ukr: a1", m, k, a_cast, 1, m, "%4.1f", "" );*/ \ } -INSERT_GENTFUNCCO_BASIC( gemm3m3_ukr_ref, BLIS_GEMM_UKR ) +INSERT_GENTFUNCCO_BASIC( gemm3m3_ukr_vir, BLIS_GEMM_UKR ) diff --git a/frame/thread/bli_thrcomm_pthreads.c b/frame/thread/bli_thrcomm_pthreads.c index 540e161c8..e2fa35c35 100644 --- a/frame/thread/bli_thrcomm_pthreads.c +++ b/frame/thread/bli_thrcomm_pthreads.c @@ -149,6 +149,7 @@ void* bli_l3_thread_entry( void* data_void ) { thread_data_t* data = data_void; + l3int_t func = data->func; opid_t family = data->family; obj_t* alpha = data->alpha; obj_t* a = data->a; @@ -169,7 +170,7 @@ void* bli_l3_thread_entry( void* data_void ) // Create the root node of the current thread's thrinfo_t structure. bli_l3_thrinfo_create_root( id, gl_comm, cntx, cntl_use, &thread ); - data->func + func ( alpha, a, diff --git a/frame/util/bli_util_tapi.h b/frame/util/bli_util_tapi.h index 1f3d48a7c..3397ced6a 100644 --- a/frame/util/bli_util_tapi.h +++ b/frame/util/bli_util_tapi.h @@ -48,7 +48,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( asumv ) +INSERT_GENTPROTR_BASIC0( asumv ) #undef GENTPROT @@ -62,9 +62,9 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( mkherm ) -INSERT_GENTPROT_BASIC( mksymm ) -INSERT_GENTPROT_BASIC( mktrim ) +INSERT_GENTPROT_BASIC0( mkherm ) +INSERT_GENTPROT_BASIC0( mksymm ) +INSERT_GENTPROT_BASIC0( mktrim ) #undef GENTPROTR @@ -78,9 +78,9 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( norm1v ) -INSERT_GENTPROTR_BASIC( normfv ) -INSERT_GENTPROTR_BASIC( normiv ) +INSERT_GENTPROTR_BASIC0( norm1v ) +INSERT_GENTPROTR_BASIC0( normfv ) +INSERT_GENTPROTR_BASIC0( normiv ) #undef GENTPROTR @@ -98,9 +98,9 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( norm1m ) -INSERT_GENTPROTR_BASIC( normfm ) -INSERT_GENTPROTR_BASIC( normim ) +INSERT_GENTPROTR_BASIC0( norm1m ) +INSERT_GENTPROTR_BASIC0( normfm ) +INSERT_GENTPROTR_BASIC0( normim ) #undef GENTPROT @@ -115,7 +115,7 @@ void PASTEMAC(ch,opname) \ char* s2 \ ); -INSERT_GENTPROT_BASIC_I( printv ) +INSERT_GENTPROT_BASIC0_I( printv ) #undef GENTPROT @@ -131,7 +131,7 @@ void PASTEMAC(ch,opname) \ char* s2 \ ); -INSERT_GENTPROT_BASIC_I( printm ) +INSERT_GENTPROT_BASIC0_I( printm ) #undef GENTPROT @@ -144,8 +144,8 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( randv ) -INSERT_GENTPROT_BASIC( randnv ) +INSERT_GENTPROT_BASIC0( randv ) +INSERT_GENTPROT_BASIC0( randnv ) #undef GENTPROT @@ -161,8 +161,8 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( randm ) -INSERT_GENTPROT_BASIC( randnm ) +INSERT_GENTPROT_BASIC0( randm ) +INSERT_GENTPROT_BASIC0( randnm ) #undef GENTPROTR @@ -177,6 +177,6 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( sumsqv ) +INSERT_GENTPROTR_BASIC0( sumsqv ) diff --git a/frame/util/bli_util_unb_var1.h b/frame/util/bli_util_unb_var1.h index 09ca31d76..171f4c436 100644 --- a/frame/util/bli_util_unb_var1.h +++ b/frame/util/bli_util_unb_var1.h @@ -48,7 +48,7 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( asumv_unb_var1 ) +INSERT_GENTPROTR_BASIC0( asumv_unb_var1 ) #undef GENTPROT @@ -62,9 +62,9 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( mkherm_unb_var1 ) -INSERT_GENTPROT_BASIC( mksymm_unb_var1 ) -INSERT_GENTPROT_BASIC( mktrim_unb_var1 ) +INSERT_GENTPROT_BASIC0( mkherm_unb_var1 ) +INSERT_GENTPROT_BASIC0( mksymm_unb_var1 ) +INSERT_GENTPROT_BASIC0( mktrim_unb_var1 ) #undef GENTPROTR @@ -78,9 +78,9 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( norm1v_unb_var1 ) -INSERT_GENTPROTR_BASIC( normfv_unb_var1 ) -INSERT_GENTPROTR_BASIC( normiv_unb_var1 ) +INSERT_GENTPROTR_BASIC0( norm1v_unb_var1 ) +INSERT_GENTPROTR_BASIC0( normfv_unb_var1 ) +INSERT_GENTPROTR_BASIC0( normiv_unb_var1 ) #undef GENTPROTR @@ -98,9 +98,9 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( norm1m_unb_var1 ) -INSERT_GENTPROTR_BASIC( normfm_unb_var1 ) -INSERT_GENTPROTR_BASIC( normim_unb_var1 ) +INSERT_GENTPROTR_BASIC0( norm1m_unb_var1 ) +INSERT_GENTPROTR_BASIC0( normfm_unb_var1 ) +INSERT_GENTPROTR_BASIC0( normim_unb_var1 ) #undef GENTPROT @@ -116,7 +116,7 @@ void PASTEMAC(ch,opname) \ char* s2 \ ); -INSERT_GENTPROT_BASIC_I( fprintv ) +INSERT_GENTPROT_BASIC0_I( fprintv ) #undef GENTPROT @@ -133,7 +133,7 @@ void PASTEMAC(ch,opname) \ char* s2 \ ); -INSERT_GENTPROT_BASIC_I( fprintm ) +INSERT_GENTPROT_BASIC0_I( fprintm ) #undef GENTPROT @@ -146,8 +146,8 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( randv_unb_var1 ) -INSERT_GENTPROT_BASIC( randnv_unb_var1 ) +INSERT_GENTPROT_BASIC0( randv_unb_var1 ) +INSERT_GENTPROT_BASIC0( randnv_unb_var1 ) #undef GENTPROT @@ -163,8 +163,8 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROT_BASIC( randm_unb_var1 ) -INSERT_GENTPROT_BASIC( randnm_unb_var1 ) +INSERT_GENTPROT_BASIC0( randm_unb_var1 ) +INSERT_GENTPROT_BASIC0( randnm_unb_var1 ) #undef GENTPROTR @@ -179,5 +179,5 @@ void PASTEMAC(ch,varname) \ cntx_t* cntx \ ); -INSERT_GENTPROTR_BASIC( sumsqv_unb_var1 ) +INSERT_GENTPROTR_BASIC0( sumsqv_unb_var1 ) diff --git a/kernels/armv7a/3/bli_cgemm_kernel_2x2.S b/kernels/armv7a/3/bli_cgemm_armv7a_asm_2x2.S similarity index 99% rename from kernels/armv7a/3/bli_cgemm_kernel_2x2.S rename to kernels/armv7a/3/bli_cgemm_armv7a_asm_2x2.S index fd2be6fab..83194862f 100644 --- a/kernels/armv7a/3/bli_cgemm_kernel_2x2.S +++ b/kernels/armv7a/3/bli_cgemm_armv7a_asm_2x2.S @@ -1,5 +1,5 @@ -#define REALNAME bli_cgemm_kernel_2x2 +#define REALNAME bli_cgemm_armv7a_ker_2x2 #define STACKSIZE 256 diff --git a/kernels/armv7a/3/bli_dgemm_kernel_4x4.S b/kernels/armv7a/3/bli_dgemm_armv7a_asm_4x4.S similarity index 99% rename from kernels/armv7a/3/bli_dgemm_kernel_4x4.S rename to kernels/armv7a/3/bli_dgemm_armv7a_asm_4x4.S index fc0282846..3c06e7201 100644 --- a/kernels/armv7a/3/bli_dgemm_kernel_4x4.S +++ b/kernels/armv7a/3/bli_dgemm_armv7a_asm_4x4.S @@ -1,5 +1,5 @@ -#define REALNAME bli_dgemm_kernel_4x4 +#define REALNAME bli_dgemm_armv7a_ker_4x4 #define STACKSIZE 256 diff --git a/kernels/armv7a/3/bli_gemm_opt_4x4.c b/kernels/armv7a/3/bli_gemm_armv7a_asm_d4x4.c similarity index 88% rename from kernels/armv7a/3/bli_gemm_opt_4x4.c rename to kernels/armv7a/3/bli_gemm_armv7a_asm_d4x4.c index e93c7adbf..f3c91c95a 100644 --- a/kernels/armv7a/3/bli_gemm_opt_4x4.c +++ b/kernels/armv7a/3/bli_gemm_armv7a_asm_d4x4.c @@ -35,7 +35,7 @@ #include "blis.h" extern -void bli_sgemm_kernel_4x4 +void bli_sgemm_armv7a_ker_4x4 ( dim_t k, float* restrict alpha, @@ -46,7 +46,7 @@ void bli_sgemm_kernel_4x4 auxinfo_t* restrict data ); -void bli_sgemm_opt_4x4 +void bli_sgemm_armv7a_asm_4x4 ( dim_t k, float* restrict alpha, @@ -58,13 +58,13 @@ void bli_sgemm_opt_4x4 cntx_t* restrict cntx ) { - bli_sgemm_kernel_4x4( k, alpha, a, b, beta, c, rs_c, cs_c, data ); + bli_sgemm_armv7a_ker_4x4( k, alpha, a, b, beta, c, rs_c, cs_c, data ); } extern -void bli_dgemm_kernel_4x4 +void bli_dgemm_armv7a_ker_4x4 ( dim_t k, double* restrict alpha, @@ -75,7 +75,7 @@ void bli_dgemm_kernel_4x4 auxinfo_t* restrict data ); -void bli_dgemm_opt_4x4 +void bli_dgemm_armv7a_asm_4x4 ( dim_t k, double* restrict alpha, @@ -87,13 +87,13 @@ void bli_dgemm_opt_4x4 cntx_t* restrict cntx ) { - bli_dgemm_kernel_4x4( k, alpha, a, b, beta, c, rs_c, cs_c, data ); + bli_dgemm_armv7a_ker_4x4( k, alpha, a, b, beta, c, rs_c, cs_c, data ); } extern -void bli_cgemm_kernel_2x2 +void bli_cgemm_armv7a_ker_2x2 ( dim_t k, scomplex* restrict alpha, @@ -104,7 +104,7 @@ void bli_cgemm_kernel_2x2 auxinfo_t* restrict data ); -void bli_cgemm_opt_4x4 +void bli_cgemm_armv7a_asm_2x2 ( dim_t k, scomplex* restrict alpha, @@ -116,13 +116,13 @@ void bli_cgemm_opt_4x4 cntx_t* restrict cntx ) { - bli_cgemm_kernel_2x2( k, alpha, a, b, beta, c, rs_c, cs_c, data ); + bli_cgemm_armv7a_ker_2x2( k, alpha, a, b, beta, c, rs_c, cs_c, data ); } extern -void bli_zgemm_kernel_2x2 +void bli_zgemm_armv7a_ker_2x2 ( dim_t k, dcomplex* restrict alpha, @@ -133,7 +133,7 @@ void bli_zgemm_kernel_2x2 auxinfo_t* restrict data ); -void bli_zgemm_opt_4x4 +void bli_zgemm_armv7a_asm_2x2 ( dim_t k, dcomplex* restrict alpha, @@ -145,6 +145,6 @@ void bli_zgemm_opt_4x4 cntx_t* restrict cntx ) { - bli_zgemm_kernel_2x2( k, alpha, a, b, beta, c, rs_c, cs_c, data ); + bli_zgemm_armv7a_ker_2x2( k, alpha, a, b, beta, c, rs_c, cs_c, data ); } diff --git a/kernels/arm/3/bli_gemm_opt_4x4.c b/kernels/armv7a/3/bli_gemm_armv7a_int_d4x4.c similarity index 99% rename from kernels/arm/3/bli_gemm_opt_4x4.c rename to kernels/armv7a/3/bli_gemm_armv7a_int_d4x4.c index a709b5022..aa583d6b1 100644 --- a/kernels/arm/3/bli_gemm_opt_4x4.c +++ b/kernels/armv7a/3/bli_gemm_armv7a_int_d4x4.c @@ -35,7 +35,7 @@ #include "blis.h" #include "arm_neon.h" -void bli_sgemm_opt_4x4 +void bli_sgemm_armv7a_int_4x4 ( dim_t k, float* restrict alpha, @@ -266,7 +266,7 @@ void bli_sgemm_opt_4x4 } } -void bli_dgemm_opt_4x4 +void bli_dgemm_armv7a_int_4x4 ( dim_t k, double* restrict alpha, diff --git a/kernels/armv7a/3/bli_sgemm_kernel_4x4.S b/kernels/armv7a/3/bli_sgemm_armv7a_asm_4x4.S similarity index 99% rename from kernels/armv7a/3/bli_sgemm_kernel_4x4.S rename to kernels/armv7a/3/bli_sgemm_armv7a_asm_4x4.S index 0cbc30b83..995f56aa1 100644 --- a/kernels/armv7a/3/bli_sgemm_kernel_4x4.S +++ b/kernels/armv7a/3/bli_sgemm_armv7a_asm_4x4.S @@ -1,5 +1,5 @@ -#define REALNAME bli_sgemm_kernel_4x4 +#define REALNAME bli_sgemm_armv7a_ker_4x4 #define STACKSIZE 256 diff --git a/kernels/armv7a/3/bli_zgemm_kernel_2x2.S b/kernels/armv7a/3/bli_zgemm_armv7a_asm_2x2.S similarity index 99% rename from kernels/armv7a/3/bli_zgemm_kernel_2x2.S rename to kernels/armv7a/3/bli_zgemm_armv7a_asm_2x2.S index 042827d0e..d549e11c6 100644 --- a/kernels/armv7a/3/bli_zgemm_kernel_2x2.S +++ b/kernels/armv7a/3/bli_zgemm_armv7a_asm_2x2.S @@ -1,5 +1,5 @@ -#define REALNAME bli_zgemm_kernel_2x2 +#define REALNAME bli_zgemm_armv7a_ker_2x2 #define STACKSIZE 256 diff --git a/kernels/armv7a/bli_kernels_armv7a.h b/kernels/armv7a/bli_kernels_armv7a.h new file mode 100644 index 000000000..4abecf8f2 --- /dev/null +++ b/kernels/armv7a/bli_kernels_armv7a.h @@ -0,0 +1,41 @@ +/* + + 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. + +*/ + +GEMM_UKR_PROT( float, s, gemm_armv7a_asm_4x4 ) +GEMM_UKR_PROT( double, d, gemm_armv7a_asm_4x4 ) +GEMM_UKR_PROT( scomplex, c, gemm_armv7a_asm_2x2 ) +GEMM_UKR_PROT( dcomplex, z, gemm_armv7a_asm_2x2 ) + +GEMM_UKR_PROT( float, s, gemm_armv7a_int_4x4 ) +GEMM_UKR_PROT( double, d, gemm_armv7a_int_4x4 ) diff --git a/kernels/armv8a/3/bli_gemm_opt_4x4.c b/kernels/armv8a/3/bli_gemm_armv8a_opt_4x4.c similarity index 99% rename from kernels/armv8a/3/bli_gemm_opt_4x4.c rename to kernels/armv8a/3/bli_gemm_armv8a_opt_4x4.c index 479c2b624..cbaad740f 100644 --- a/kernels/armv8a/3/bli_gemm_opt_4x4.c +++ b/kernels/armv8a/3/bli_gemm_armv8a_opt_4x4.c @@ -50,7 +50,7 @@ * Tested on Juno board. Around 3.1 GFLOPS, 1 x A53 core @ 850 MHz. * Tested on Juno board. Around 12 GFLOPS, 4 x A53 cores @ 850 MHz. */ -void bli_sgemm_opt_8x12 +void bli_sgemm_armv8a_asm_8x12 ( dim_t k, float* restrict alpha, @@ -1101,7 +1101,7 @@ __asm__ volatile * Tested on Juno board. Around 1.5 GFLOPS, 1 x A53 core @ 850 MHz. * Tested on Juno board. Around 5.5 GFLOPS, 4 x A53 cores @ 850 MHz. */ -void bli_dgemm_opt_6x8 +void bli_dgemm_armv8a_asm_6x8 ( dim_t k, double* restrict alpha, @@ -2072,7 +2072,9 @@ __asm__ volatile } -void bli_cgemm_opt_4x4 + +#if 0 +void bli_cgemm_armv8a_opt_4x4 ( dim_t k, scomplex* restrict alpha, @@ -2098,7 +2100,7 @@ void bli_cgemm_opt_4x4 ); } -void bli_zgemm_opt_4x4 +void bli_zgemm_armv8a_opt_4x4 ( dim_t k, dcomplex* restrict alpha, @@ -2123,4 +2125,4 @@ void bli_zgemm_opt_4x4 cntx ); } - +#endif diff --git a/kernels/armv8a/bli_kernels_armv8a.h b/kernels/armv8a/bli_kernels_armv8a.h new file mode 100644 index 000000000..3654a0626 --- /dev/null +++ b/kernels/armv8a/bli_kernels_armv8a.h @@ -0,0 +1,36 @@ +/* + + 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. + +*/ + +GEMM_UKR_PROT( float, s, gemm_armv8a_asm_8x12 ) +GEMM_UKR_PROT( double, d, gemm_armv8a_asm_6x8 ) diff --git a/kernels/bgq/1/bli_axpyv_opt_var1.c b/kernels/bgq/1/bli_axpyv_bgq_int.c similarity index 99% rename from kernels/bgq/1/bli_axpyv_opt_var1.c rename to kernels/bgq/1/bli_axpyv_bgq_int.c index 7e2a5b6bd..8885d9817 100644 --- a/kernels/bgq/1/bli_axpyv_opt_var1.c +++ b/kernels/bgq/1/bli_axpyv_bgq_int.c @@ -34,7 +34,7 @@ #include "blis.h" -void bli_daxpyv_opt_var1 +void bli_daxpyv_bgq_int ( conj_t conjx, dim_t n, diff --git a/kernels/bgq/1/bli_dotv_opt_var1.c b/kernels/bgq/1/bli_dotv_bgq_int.c similarity index 99% rename from kernels/bgq/1/bli_dotv_opt_var1.c rename to kernels/bgq/1/bli_dotv_bgq_int.c index 1003c2aa0..96f2259aa 100644 --- a/kernels/bgq/1/bli_dotv_opt_var1.c +++ b/kernels/bgq/1/bli_dotv_bgq_int.c @@ -34,7 +34,7 @@ #include "blis.h" -void bli_ddotv_opt_var1 +void bli_ddotv_bgq_int ( conj_t conjx, conj_t conjy, diff --git a/kernels/bgq/1f/bli_axpyf_opt_var1.c b/kernels/bgq/1f/bli_axpyf_bgq_int.c similarity index 99% rename from kernels/bgq/1f/bli_axpyf_opt_var1.c rename to kernels/bgq/1f/bli_axpyf_bgq_int.c index 25ca9920d..9ea0fb674 100644 --- a/kernels/bgq/1f/bli_axpyf_opt_var1.c +++ b/kernels/bgq/1f/bli_axpyf_bgq_int.c @@ -35,7 +35,7 @@ #include "blis.h" -void bli_daxpyf_opt_var1 +void bli_daxpyf_bgq_int ( conj_t conja, conj_t conjx, diff --git a/kernels/bgq/3/bli_gemm_int_8x8.c b/kernels/bgq/3/bli_gemm_bgq_int_8x8.c similarity index 99% rename from kernels/bgq/3/bli_gemm_int_8x8.c rename to kernels/bgq/3/bli_gemm_bgq_int_8x8.c index c58560ef4..a1708bf83 100644 --- a/kernels/bgq/3/bli_gemm_int_8x8.c +++ b/kernels/bgq/3/bli_gemm_bgq_int_8x8.c @@ -54,7 +54,7 @@ * we could (maybe) theoretically hit 100% of peak with this instruction mix */ -void bli_dgemm_int_8x8 +void bli_dgemm_bgq_int_8x8 ( dim_t k, double* restrict alpha, @@ -212,7 +212,7 @@ void printvec(vector4double v) printf("%4.3f\t%4.3f\t%4.3f\t%4.3f\n", a, b, c, d); } -void bli_zgemm_int_8x8 +void bli_zgemm_bgq_int_4x4 ( dim_t k, dcomplex* restrict alpha, diff --git a/frame/1/kernels/old/bli_invertv_ref.h b/kernels/bgq/bli_kernels_bgq.h similarity index 88% rename from frame/1/kernels/old/bli_invertv_ref.h rename to kernels/bgq/bli_kernels_bgq.h index 39796c5aa..f2ad03e9d 100644 --- a/frame/1/kernels/old/bli_invertv_ref.h +++ b/kernels/bgq/bli_kernels_bgq.h @@ -32,15 +32,10 @@ */ +GEMM_UKR_PROT( double, d, gemm_bgq_int_8x8 ) +GEMM_UKR_PROT( dcomplex, z, gemm_bgq_int_4x4 ) -#undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname) \ - ( \ - dim_t n, \ - ctype* x, inc_t incx \ - ); - -INSERT_GENTPROT_BASIC( invertv_ref ) +AXPYF_KER_PROT( double, d, axpyf_bgq_int ) +AXPYV_KER_PROT( double, d, axpyv_bgq_int ) +DOTV_KER_PROT( double, d, dotv_bgq_int ) diff --git a/kernels/x86_64/bulldozer/3/bli_gemm_asm_d4x6_fma4.c b/kernels/bulldozer/3/bli_gemm_bulldozer_asm_d4x6_fma4.c similarity index 99% rename from kernels/x86_64/bulldozer/3/bli_gemm_asm_d4x6_fma4.c rename to kernels/bulldozer/3/bli_gemm_bulldozer_asm_d4x6_fma4.c index fc7f750b4..489456aeb 100644 --- a/kernels/x86_64/bulldozer/3/bli_gemm_asm_d4x6_fma4.c +++ b/kernels/bulldozer/3/bli_gemm_bulldozer_asm_d4x6_fma4.c @@ -85,7 +85,7 @@ "vmovss %%xmm3, (%%rdx,%%r13) \n\t"\ -void bli_sgemm_asm_8x8_fma4 +void bli_sgemm_bulldozer_asm_8x8_fma4 ( dim_t k, float* restrict alpha, @@ -853,7 +853,7 @@ void bli_sgemm_asm_8x8_fma4 "vmovaps 16 * 8(%%rbx), %%xmm3 \n\t"\ "addq $24*8, %%rbx \n\t" -void bli_dgemm_asm_4x6_fma4 +void bli_dgemm_bulldozer_asm_4x6_fma4 ( dim_t k, double* restrict alpha, @@ -1061,7 +1061,7 @@ void bli_dgemm_asm_4x6_fma4 "vfmaddps %%ymm8, %%ymm1, %%ymm5, %%ymm8 \n\t"\ "vperm2f128 $0x3, %%ymm3, %%ymm3, %%ymm5 \n\t"\ -void bli_cgemm_asm_8x4_fma4 +void bli_cgemm_bulldozer_asm_8x4_fma4 ( dim_t k, scomplex* restrict alpha, @@ -1868,7 +1868,7 @@ void bli_cgemm_asm_8x4_fma4 "vaddsubpd %%ymm"j", %%ymm"i", %%ymm"i" \n\t"\ " \n\t" -void bli_zgemm_asm_4x4_fma4 +void bli_zgemm_bulldozer_asm_4x4_fma4 ( dim_t k, dcomplex* restrict alpha, diff --git a/kernels/bulldozer/bli_kernels_bulldozer.h b/kernels/bulldozer/bli_kernels_bulldozer.h new file mode 100644 index 000000000..4312eed29 --- /dev/null +++ b/kernels/bulldozer/bli_kernels_bulldozer.h @@ -0,0 +1,39 @@ +/* + + 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. + +*/ + +GEMM_UKR_PROT( float, s, gemm_bulldozer_asm_8x8_fma4 ) +GEMM_UKR_PROT( double, d, gemm_bulldozer_asm_4x6_fma4 ) +GEMM_UKR_PROT( scomplex, c, gemm_bulldozer_asm_8x4_fma4 ) +GEMM_UKR_PROT( dcomplex, z, gemm_bulldozer_asm_4x4_fma4 ) + diff --git a/kernels/generic/generic.txt b/kernels/generic/generic.txt new file mode 100644 index 000000000..e2dc53ba5 --- /dev/null +++ b/kernels/generic/generic.txt @@ -0,0 +1,19 @@ + +generic.txt +----------- + +This file in 'kernels/generic' exists only to force 'git' to track what +would otherwise be an empty directory. Having this empty directory is +necessary because the 'generic' singleton family is defined in the +configuration registry as: + + generic: generic + +which implies that the 'generic' sub-configuration depends on the +'generic' kernel set (because there were no complementary kernel sets +specified via '/'). Thus, we need there to be a kernel set named +'generic', but we don't actually refer to any such kernels in BLIS. +In other words, this file is simply a workaround to a quirk in the +syntax and semantics of the config_registry file. + +-FGVZ diff --git a/kernels/x86_64/haswell/3/bli_gemm_asm_d12x4.c b/kernels/haswell/3/bli_gemm_haswell_asm_d12x4.c similarity index 99% rename from kernels/x86_64/haswell/3/bli_gemm_asm_d12x4.c rename to kernels/haswell/3/bli_gemm_haswell_asm_d12x4.c index 2088e030a..22e13b7e4 100644 --- a/kernels/x86_64/haswell/3/bli_gemm_asm_d12x4.c +++ b/kernels/haswell/3/bli_gemm_haswell_asm_d12x4.c @@ -65,7 +65,7 @@ "vpermilps $0x39, %%xmm2, %%xmm1 \n\t" \ "vmovss %%xmm1, (%%rcx,%%r10 ) \n\t" -void bli_sgemm_asm_24x4 +void bli_sgemm_haswell_asm_24x4 ( dim_t k, float* restrict alpha, @@ -637,6 +637,8 @@ void bli_sgemm_asm_24x4 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -686,7 +688,7 @@ void bli_sgemm_asm_24x4 "vmovlpd %%xmm1, (%%rcx,%%r13,2) \n\t" \ "vmovhpd %%xmm1, (%%rcx,%%r10 ) \n\t"*/ -void bli_dgemm_asm_12x4 +void bli_dgemm_haswell_asm_12x4 ( dim_t k, double* restrict alpha, @@ -1258,6 +1260,8 @@ void bli_dgemm_asm_12x4 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -1285,7 +1289,7 @@ void bli_dgemm_asm_12x4 #if 0 -void bli_cgemm_asm_ +void bli_cgemm_haswell_asm_ ( dim_t k, scomplex* restrict alpha, @@ -1307,7 +1311,7 @@ void bli_cgemm_asm_ -void bli_zgemm_asm_ +void bli_zgemm_haswell_asm_ ( dim_t k, dcomplex* restrict alpha, diff --git a/kernels/x86_64/haswell/3/bli_gemm_asm_d4x12.c b/kernels/haswell/3/bli_gemm_haswell_asm_d4x12.c similarity index 99% rename from kernels/x86_64/haswell/3/bli_gemm_asm_d4x12.c rename to kernels/haswell/3/bli_gemm_haswell_asm_d4x12.c index 5eb0f0732..15f49be24 100644 --- a/kernels/x86_64/haswell/3/bli_gemm_asm_d4x12.c +++ b/kernels/haswell/3/bli_gemm_haswell_asm_d4x12.c @@ -65,7 +65,7 @@ "vpermilps $0x39, %%xmm2, %%xmm1 \n\t" \ "vmovss %%xmm1, (%%rcx,%%r10 ) \n\t" -void bli_sgemm_asm_4x24 +void bli_sgemm_haswell_asm_4x24 ( dim_t k, float* restrict alpha, @@ -603,6 +603,8 @@ void bli_sgemm_asm_4x24 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -652,7 +654,7 @@ void bli_sgemm_asm_4x24 "vmovlpd %%xmm1, (%%rcx,%%r13,2) \n\t" \ "vmovhpd %%xmm1, (%%rcx,%%r10 ) \n\t"*/ -void bli_dgemm_asm_4x12 +void bli_dgemm_haswell_asm_4x12 ( dim_t k, double* restrict alpha, @@ -1191,6 +1193,8 @@ void bli_dgemm_asm_4x12 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -1218,7 +1222,7 @@ void bli_dgemm_asm_4x12 #if 0 -void bli_cgemm_asm_ +void bli_cgemm_haswell_asm_ ( dim_t k, scomplex* restrict alpha, @@ -1240,7 +1244,7 @@ void bli_cgemm_asm_ -void bli_zgemm_asm_ +void bli_zgemm_haswell_asm_ ( dim_t k, dcomplex* restrict alpha, diff --git a/kernels/x86_64/haswell/3/bli_gemm_asm_d6x8.c b/kernels/haswell/3/bli_gemm_haswell_asm_d6x8.c similarity index 99% rename from kernels/x86_64/haswell/3/bli_gemm_asm_d6x8.c rename to kernels/haswell/3/bli_gemm_haswell_asm_d6x8.c index 78b294053..e1a4350c2 100644 --- a/kernels/x86_64/haswell/3/bli_gemm_asm_d6x8.c +++ b/kernels/haswell/3/bli_gemm_haswell_asm_d6x8.c @@ -65,7 +65,7 @@ "vpermilps $0x39, %%xmm2, %%xmm1 \n\t" \ "vmovss %%xmm1, (%%rcx,%%r10 ) \n\t" -void bli_sgemm_asm_6x16 +void bli_sgemm_haswell_asm_6x16 ( dim_t k, float* restrict alpha, @@ -598,6 +598,8 @@ void bli_sgemm_asm_6x16 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -650,7 +652,7 @@ void bli_sgemm_asm_6x16 "vmovlpd %%xmm1, (%%rcx,%%r13,2) \n\t" \ "vmovhpd %%xmm1, (%%rcx,%%r10 ) \n\t"*/ -void bli_dgemm_asm_6x8 +void bli_dgemm_haswell_asm_6x8 ( dim_t k, double* restrict alpha, @@ -1180,6 +1182,8 @@ void bli_dgemm_asm_6x8 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -1239,7 +1243,7 @@ void bli_dgemm_asm_6x8 #define CGEMM_OUTPUT_RS \ "vmovups %%ymm0, (%%rcx) \n\t" \ -void bli_cgemm_asm_3x8 +void bli_cgemm_haswell_asm_3x8 ( dim_t k, scomplex* restrict alpha, @@ -1709,6 +1713,8 @@ void bli_cgemm_asm_3x8 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -1764,7 +1770,7 @@ void bli_cgemm_asm_3x8 #define ZGEMM_OUTPUT_RS \ "vmovupd %%ymm0, (%%rcx) \n\t" \ -void bli_zgemm_asm_3x4 +void bli_zgemm_haswell_asm_3x4 ( dim_t k, dcomplex* restrict alpha, @@ -2237,6 +2243,8 @@ void bli_zgemm_asm_3x4 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands diff --git a/kernels/x86_64/haswell/3/bli_gemm_asm_d8x6.c b/kernels/haswell/3/bli_gemm_haswell_asm_d8x6.c similarity index 99% rename from kernels/x86_64/haswell/3/bli_gemm_asm_d8x6.c rename to kernels/haswell/3/bli_gemm_haswell_asm_d8x6.c index 9796e27ef..ba2d6c3f6 100644 --- a/kernels/x86_64/haswell/3/bli_gemm_asm_d8x6.c +++ b/kernels/haswell/3/bli_gemm_haswell_asm_d8x6.c @@ -65,7 +65,7 @@ "vpermilps $0x39, %%xmm2, %%xmm1 \n\t" \ "vmovss %%xmm1, (%%rcx,%%r10 ) \n\t" -void bli_sgemm_asm_16x6 +void bli_sgemm_haswell_asm_16x6 ( dim_t k, float* restrict alpha, @@ -599,6 +599,8 @@ void bli_sgemm_asm_16x6 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -648,7 +650,7 @@ void bli_sgemm_asm_16x6 "vmovlpd %%xmm1, (%%rcx,%%r13,2) \n\t" \ "vmovhpd %%xmm1, (%%rcx,%%r10 ) \n\t"*/ -void bli_dgemm_asm_8x6 +void bli_dgemm_haswell_asm_8x6 ( dim_t k, double* restrict alpha, @@ -1181,6 +1183,8 @@ void bli_dgemm_asm_8x6 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -1240,7 +1244,7 @@ void bli_dgemm_asm_8x6 #define CGEMM_OUTPUT_CS \ "vmovups %%ymm0, (%%rcx) \n\t" \ -void bli_cgemm_asm_8x3 +void bli_cgemm_haswell_asm_8x3 ( dim_t k, scomplex* restrict alpha, @@ -1710,6 +1714,8 @@ void bli_cgemm_asm_8x3 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -1765,7 +1771,7 @@ void bli_cgemm_asm_8x3 #define ZGEMM_OUTPUT_CS \ "vmovupd %%ymm0, (%%rcx) \n\t" \ -void bli_zgemm_asm_4x3 +void bli_zgemm_haswell_asm_4x3 ( dim_t k, dcomplex* restrict alpha, @@ -2238,6 +2244,8 @@ void bli_zgemm_asm_4x3 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands diff --git a/kernels/x86_64/haswell/3/old/bli_gemm_asm_d4x12.c b/kernels/haswell/3/old/bli_gemm_haswell_asm_d4x12.c similarity index 99% rename from kernels/x86_64/haswell/3/old/bli_gemm_asm_d4x12.c rename to kernels/haswell/3/old/bli_gemm_haswell_asm_d4x12.c index a1d2fc940..134fb7c55 100644 --- a/kernels/x86_64/haswell/3/old/bli_gemm_asm_d4x12.c +++ b/kernels/haswell/3/old/bli_gemm_haswell_asm_d4x12.c @@ -65,7 +65,7 @@ "vpermilps $0x39, %%xmm2, %%xmm1 \n\t" \ "vmovss %%xmm1, (%%rcx,%%r10 ) \n\t" -void bli_sgemm_asm_4x24 +void bli_sgemm_haswell_asm_4x24 ( dim_t k, float* restrict alpha, @@ -729,7 +729,7 @@ void bli_sgemm_asm_4x24 "vmovlpd %%xmm1, (%%rcx,%%r13,2) \n\t" \ "vmovhpd %%xmm1, (%%rcx,%%r10 ) \n\t"*/ -void bli_dgemm_asm_4x12 +void bli_dgemm_haswell_asm_4x12 ( dim_t k, double* restrict alpha, @@ -1358,7 +1358,7 @@ void bli_dgemm_asm_4x12 #if 0 -void bli_cgemm_asm_ +void bli_cgemm_haswell_asm_ ( dim_t k, scomplex* restrict alpha, @@ -1380,7 +1380,7 @@ void bli_cgemm_asm_ -void bli_zgemm_asm_ +void bli_zgemm_haswell_asm_ ( dim_t k, dcomplex* restrict alpha, diff --git a/frame/3/old/bli_trmm_direct.c b/kernels/haswell/bli_kernels_haswell.h similarity index 72% rename from frame/3/old/bli_trmm_direct.c rename to kernels/haswell/bli_kernels_haswell.h index 43be1b16a..f97fc8f0c 100644 --- a/frame/3/old/bli_trmm_direct.c +++ b/kernels/haswell/bli_kernels_haswell.h @@ -32,28 +32,23 @@ */ -#include "blis.h" +// d12x4 +GEMM_UKR_PROT( float, s, gemm_haswell_asm_24x4 ) +GEMM_UKR_PROT( double, d, gemm_haswell_asm_12x4 ) -dir_t bli_trmm_direct - ( - obj_t* a, - obj_t* b, - obj_t* c - ) -{ - dir_t direct; +// d4x12 +GEMM_UKR_PROT( float, s, gemm_haswell_asm_4x24 ) +GEMM_UKR_PROT( double, d, gemm_haswell_asm_4x12 ) - if ( bli_obj_root_is_triangular( *a ) ) - { - if ( bli_obj_root_is_lower( *a ) ) direct = BLIS_BWD; - else direct = BLIS_FWD; - } - else // if ( bli_obj_root_is_triangular( *b ) ) - { - if ( bli_obj_root_is_lower( *b ) ) direct = BLIS_FWD; - else direct = BLIS_BWD; - } +// d6x8 +GEMM_UKR_PROT( float, s, gemm_haswell_asm_6x16 ) +GEMM_UKR_PROT( double, d, gemm_haswell_asm_6x8 ) +GEMM_UKR_PROT( scomplex, c, gemm_haswell_asm_3x8 ) +GEMM_UKR_PROT( dcomplex, z, gemm_haswell_asm_3x4 ) - return direct; -} +// d8x6 +GEMM_UKR_PROT( float, s, gemm_haswell_asm_16x6 ) +GEMM_UKR_PROT( double, d, gemm_haswell_asm_8x6 ) +GEMM_UKR_PROT( scomplex, c, gemm_haswell_asm_8x3 ) +GEMM_UKR_PROT( dcomplex, z, gemm_haswell_asm_4x3 ) diff --git a/kernels/mic/3/bli_dgemm_opt_30x8.c b/kernels/knc/3/bli_dgemm_knc_asm_30x8.c similarity index 99% rename from kernels/mic/3/bli_dgemm_opt_30x8.c rename to kernels/knc/3/bli_dgemm_knc_asm_30x8.c index ab7d9c752..a24f766cf 100644 --- a/kernels/mic/3/bli_dgemm_opt_30x8.c +++ b/kernels/knc/3/bli_dgemm_knc_asm_30x8.c @@ -254,7 +254,7 @@ extern int offsets[16]; //#define MONITORS //#define LOOPMON -void bli_dgemm_asm_30x8 +void bli_dgemm_knc_asm_30x8 ( dim_t k, double* restrict alpha, diff --git a/kernels/mic/3/bli_sgemm_opt_30x16.c b/kernels/knc/3/bli_sgemm_knc_asm_30x16.c similarity index 99% rename from kernels/mic/3/bli_sgemm_opt_30x16.c rename to kernels/knc/3/bli_sgemm_knc_asm_30x16.c index 8f030653c..2fbbe78e7 100644 --- a/kernels/mic/3/bli_sgemm_opt_30x16.c +++ b/kernels/knc/3/bli_sgemm_knc_asm_30x16.c @@ -254,7 +254,7 @@ int offsets[16] __attribute__((aligned(0x1000))) = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 //#define MONITORS //#define LOOPMON -void bli_sgemm_asm_30x16 +void bli_sgemm_knc_asm_30x16 ( dim_t k, float* restrict alpha, diff --git a/kernels/knc/bli_kernels_knc.h b/kernels/knc/bli_kernels_knc.h new file mode 100644 index 000000000..bd5aa97de --- /dev/null +++ b/kernels/knc/bli_kernels_knc.h @@ -0,0 +1,37 @@ +/* + + 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. + +*/ + +GEMM_UKR_PROT( float, s, gemm_knc_asm_30x16 ) +GEMM_UKR_PROT( double, d, gemm_knc_asm_30x8 ) + diff --git a/kernels/x86_64/knl/1m/bli_packm_opt_24x8.c b/kernels/knl/1m/bli_packm_knl_asm_24x8.c similarity index 99% rename from kernels/x86_64/knl/1m/bli_packm_opt_24x8.c rename to kernels/knl/1m/bli_packm_knl_asm_24x8.c index 15ee67a5b..7e02b4055 100644 --- a/kernels/x86_64/knl/1m/bli_packm_opt_24x8.c +++ b/kernels/knl/1m/bli_packm_knl_asm_24x8.c @@ -102,7 +102,7 @@ //This is an array used for the scatter/gather instructions. extern int32_t offsets[24]; -void bli_dpackm_8xk_opt +void bli_dpackm_knl_asm_8xk ( conj_t conja, dim_t n_, @@ -294,7 +294,7 @@ void bli_dpackm_8xk_opt ); } -void bli_dpackm_24xk_opt +void bli_dpackm_knl_asm_24xk ( conj_t conja, dim_t n_, diff --git a/kernels/x86_64/knl/1m/bli_packm_opt_30x8.c b/kernels/knl/1m/bli_packm_knl_asm_30x8.c similarity index 99% rename from kernels/x86_64/knl/1m/bli_packm_opt_30x8.c rename to kernels/knl/1m/bli_packm_knl_asm_30x8.c index 181c5deab..d50ad8256 100644 --- a/kernels/x86_64/knl/1m/bli_packm_opt_30x8.c +++ b/kernels/knl/1m/bli_packm_knl_asm_30x8.c @@ -130,7 +130,7 @@ extern int32_t offsets[32]; // NOTE: assumes packdim_mr == 32 -void bli_dpackm_30xk_opt +void bli_dpackm_knl_asm_30xk ( conj_t conja, dim_t n_, diff --git a/kernels/x86_64/knl/3/bli_avx512_macros.h b/kernels/knl/3/bli_avx512_macros.h similarity index 100% rename from kernels/x86_64/knl/3/bli_avx512_macros.h rename to kernels/knl/3/bli_avx512_macros.h diff --git a/kernels/x86_64/knl/3/bli_dgemm_opt_12x16.c b/kernels/knl/3/bli_dgemm_knl_asm_12x16.c similarity index 99% rename from kernels/x86_64/knl/3/bli_dgemm_opt_12x16.c rename to kernels/knl/3/bli_dgemm_knl_asm_12x16.c index 06c59beec..5f5771262 100644 --- a/kernels/x86_64/knl/3/bli_dgemm_opt_12x16.c +++ b/kernels/knl/3/bli_dgemm_knl_asm_12x16.c @@ -38,7 +38,7 @@ extern int32_t offsets[16]; -void bli_dgemm_asm_12x16 +void bli_dgemm_knl_asm_12x16 ( dim_t k, double* restrict alpha, diff --git a/kernels/x86_64/knl/3/bli_dgemm_opt_24x8.c b/kernels/knl/3/bli_dgemm_knl_asm_24x8.c similarity index 98% rename from kernels/x86_64/knl/3/bli_dgemm_opt_24x8.c rename to kernels/knl/3/bli_dgemm_knl_asm_24x8.c index 5ca50ced4..3d5adb84d 100644 --- a/kernels/x86_64/knl/3/bli_dgemm_opt_24x8.c +++ b/kernels/knl/3/bli_dgemm_knl_asm_24x8.c @@ -180,16 +180,17 @@ extern int32_t offsets[24]; //#define MONITORS //#define LOOPMON -void bli_dgemm_opt_24x8( - dim_t k_, - double* restrict alpha, - double* restrict a, - double* restrict b, - double* restrict beta, - double* restrict c, inc_t rs_c_, inc_t cs_c_, - auxinfo_t* data, - cntx_t* restrict cntx - ) +void bli_dgemm_knl_asm_24x8 + ( + dim_t k_, + double* restrict alpha, + double* restrict a, + double* restrict b, + double* restrict beta, + double* restrict c, inc_t rs_c_, inc_t cs_c_, + auxinfo_t* restrict data, + cntx_t* restrict cntx + ) { (void)data; (void)cntx; diff --git a/kernels/x86_64/knl/3/bli_dgemm_opt_30x8.c b/kernels/knl/3/bli_dgemm_knl_asm_30x8.c similarity index 98% rename from kernels/x86_64/knl/3/bli_dgemm_opt_30x8.c rename to kernels/knl/3/bli_dgemm_knl_asm_30x8.c index 347567391..a6a2b354c 100644 --- a/kernels/x86_64/knl/3/bli_dgemm_opt_30x8.c +++ b/kernels/knl/3/bli_dgemm_knl_asm_30x8.c @@ -207,16 +207,17 @@ extern int32_t offsets[32]; //#define MONITORS //#define LOOPMON -void bli_dgemm_opt_30x8( - dim_t k, - double* restrict alpha, - double* restrict a, - double* restrict b, - double* restrict beta, - double* restrict c, inc_t rs_c, inc_t cs_c, - auxinfo_t* data, - cntx_t* restrict cntx - ) +void bli_dgemm_knl_asm_30x8 + ( + dim_t k, + double* restrict alpha, + double* restrict a, + double* restrict b, + double* restrict beta, + double* restrict c, inc_t rs_c, inc_t cs_c, + auxinfo_t* restrict data, + cntx_t* restrict cntx + ) { const int32_t * offsetPtr = &offsets[0]; uint64_t k64 = k; diff --git a/kernels/x86_64/knl/3/bli_dgemm_opt_30x8_knc.c b/kernels/knl/3/bli_dgemm_knl_asm_30x8_knc.c similarity index 97% rename from kernels/x86_64/knl/3/bli_dgemm_opt_30x8_knc.c rename to kernels/knl/3/bli_dgemm_knl_asm_30x8_knc.c index f14c3b13c..891673bcb 100644 --- a/kernels/x86_64/knl/3/bli_dgemm_opt_30x8_knc.c +++ b/kernels/knl/3/bli_dgemm_knl_asm_30x8_knc.c @@ -162,16 +162,17 @@ extern int32_t offsets[16]; //#define MONITORS //#define LOOPMON -void bli_dgemm_opt_30x8_knc( - dim_t k, - double* restrict alpha, - double* restrict a, - double* restrict b, - double* restrict beta, - double* restrict c, inc_t rs_c, inc_t cs_c, - auxinfo_t* data, - cntx_t* restrict cntx - ) +void bli_dgemm_knl_asm_30x8_knc + ( + dim_t k, + double* restrict alpha, + double* restrict a, + double* restrict b, + double* restrict beta, + double* restrict c, inc_t rs_c, inc_t cs_c, + auxinfo_t* restrict data, + cntx_t* restrict cntx + ) { const double * a_next = bli_auxinfo_next_a( data ); const double * b_next = bli_auxinfo_next_b( data ); diff --git a/kernels/x86_64/knl/3/bli_dgemm_opt_8x24.c b/kernels/knl/3/bli_dgemm_knl_asm_8x24.c similarity index 98% rename from kernels/x86_64/knl/3/bli_dgemm_opt_8x24.c rename to kernels/knl/3/bli_dgemm_knl_asm_8x24.c index fdaf9153a..ef9d43e96 100644 --- a/kernels/x86_64/knl/3/bli_dgemm_opt_8x24.c +++ b/kernels/knl/3/bli_dgemm_knl_asm_8x24.c @@ -452,16 +452,17 @@ extern int32_t offsets[24]; //#define MONITORS //#define LOOPMON -void bli_dgemm_opt_8x24( - dim_t k, - double* restrict alpha, - double* restrict a, - double* restrict b, - double* restrict beta, - double* restrict c, inc_t rs_c, inc_t cs_c, - auxinfo_t* data, - cntx_t* restrict cntx - ) +void bli_dgemm_knl_asm_8x24 + ( + dim_t k, + double* restrict alpha, + double* restrict a, + double* restrict b, + double* restrict beta, + double* restrict c, inc_t rs_c, inc_t cs_c, + auxinfo_t* restrict data, + cntx_t* restrict cntx + ) { const double * a_next = bli_auxinfo_next_a( data ); const double * b_next = bli_auxinfo_next_b( data ); diff --git a/kernels/x86_64/knl/3/bli_sgemm_opt_30x16_knc.c b/kernels/knl/3/bli_sgemm_knl_asm_30x16_knc.c similarity index 97% rename from kernels/x86_64/knl/3/bli_sgemm_opt_30x16_knc.c rename to kernels/knl/3/bli_sgemm_knl_asm_30x16_knc.c index 889fd8d19..21c726cff 100644 --- a/kernels/x86_64/knl/3/bli_sgemm_opt_30x16_knc.c +++ b/kernels/knl/3/bli_sgemm_knl_asm_30x16_knc.c @@ -165,16 +165,17 @@ int32_t offsets[32] __attribute__((aligned(0x1000))) = { 0, 1, 2, 3, 4, 5, //#define MONITORS //#define LOOPMON -void bli_sgemm_opt_30x16_knc( - dim_t k_, - float* restrict alpha, - float* restrict a, - float* restrict b, - float* restrict beta, - float* restrict c, inc_t rs_c_, inc_t cs_c_, - auxinfo_t* data, - cntx_t* restrict cntx - ) +void bli_sgemm_knl_asm_30x16_knc + ( + dim_t k_, + float* restrict alpha, + float* restrict a, + float* restrict b, + float* restrict beta, + float* restrict c, inc_t rs_c_, inc_t cs_c_, + auxinfo_t* restrict data, + cntx_t* restrict cntx + ) { (void)data; (void)cntx; diff --git a/frame/1/kernels/old/bli_copyv_ref.h b/kernels/knl/bli_kernels_knl.h similarity index 83% rename from frame/1/kernels/old/bli_copyv_ref.h rename to kernels/knl/bli_kernels_knl.h index 19d5ec0de..15f34af77 100644 --- a/frame/1/kernels/old/bli_copyv_ref.h +++ b/kernels/knl/bli_kernels_knl.h @@ -32,17 +32,13 @@ */ +GEMM_UKR_PROT( double, d, gemm_knl_asm_12x16 ) +GEMM_UKR_PROT( double, d, gemm_knl_asm_24x8 ) +GEMM_UKR_PROT( double, d, gemm_knl_asm_30x8 ) +GEMM_UKR_PROT( double, d, gemm_knl_asm_8x24 ) -#undef GENTPROT2 -#define GENTPROT2( ctype_x, ctype_y, chx, chy, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjx, \ - dim_t n, \ - ctype_x* x, inc_t incx, \ - ctype_y* y, inc_t incy \ - ); +PACKM_KER_PROT( double, d, packm_knl_asm_24xk ) +PACKM_KER_PROT( double, d, packm_knl_asm_8xk ) -INSERT_GENTPROT2_BASIC( copyv_ref ) +PACKM_KER_PROT( double, d, packm_knl_asm_30xk ) diff --git a/kernels/c99/3/bli_gemm_c99_4x4.c b/kernels/old/c99/3/bli_gemm_c99_4x4.c similarity index 97% rename from kernels/c99/3/bli_gemm_c99_4x4.c rename to kernels/old/c99/3/bli_gemm_c99_4x4.c index 9fa3e30c3..eaf124fc8 100644 --- a/kernels/c99/3/bli_gemm_c99_4x4.c +++ b/kernels/old/c99/3/bli_gemm_c99_4x4.c @@ -36,9 +36,9 @@ #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname, kername ) \ +#define GENTFUNC( ctype, ch, kername ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC(ch,kername) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -212,5 +212,5 @@ void PASTEMAC(ch,varname) \ PASTEMAC(ch,dots)( *alpha, ab33, *c33 ); \ } -INSERT_GENTFUNC_BASIC( gemm_c99_4x4, gemm_c99_4x4 ) +INSERT_GENTFUNC_BASIC0( gemm_c99_4x4 ) diff --git a/kernels/c99/3/bli_gemmtrsm_l_c99_4x4.c b/kernels/old/c99/3/bli_gemmtrsm_l_c99_4x4.c similarity index 100% rename from kernels/c99/3/bli_gemmtrsm_l_c99_4x4.c rename to kernels/old/c99/3/bli_gemmtrsm_l_c99_4x4.c diff --git a/kernels/c99/3/bli_gemmtrsm_u_c99_4x4.c b/kernels/old/c99/3/bli_gemmtrsm_u_c99_4x4.c similarity index 100% rename from kernels/c99/3/bli_gemmtrsm_u_c99_4x4.c rename to kernels/old/c99/3/bli_gemmtrsm_u_c99_4x4.c diff --git a/kernels/c99/3/bli_trsm_l_c99_4x4.c b/kernels/old/c99/3/bli_trsm_l_c99_4x4.c similarity index 100% rename from kernels/c99/3/bli_trsm_l_c99_4x4.c rename to kernels/old/c99/3/bli_trsm_l_c99_4x4.c diff --git a/kernels/c99/3/bli_trsm_u_c99_4x4.c b/kernels/old/c99/3/bli_trsm_u_c99_4x4.c similarity index 100% rename from kernels/c99/3/bli_trsm_u_c99_4x4.c rename to kernels/old/c99/3/bli_trsm_u_c99_4x4.c diff --git a/frame/3/old/bli_trsm_ukernel.h b/kernels/old/c99/bli_kernels_c99.h similarity index 70% rename from frame/3/old/bli_trsm_ukernel.h rename to kernels/old/c99/bli_kernels_c99.h index 15f9cafd0..2aa3aee31 100644 --- a/frame/3/old/bli_trsm_ukernel.h +++ b/kernels/old/c99/bli_kernels_c99.h @@ -32,28 +32,28 @@ */ -void bli_trsm_ukernel( obj_t* a, - obj_t* b, - obj_t* c, - cntx_t* cntx ); +GEMM_UKR_PROT( gemm_c99_4x4 ) +GEMM_UKR_PROT( gemm_c99_4x4 ) +GEMM_UKR_PROT( gemm_c99_4x4 ) +GEMM_UKR_PROT( gemm_c99_4x4 ) +GEMMTRSM_UKR_PROT( gemmtrsm_l_c99_4x4 ) +GEMMTRSM_UKR_PROT( gemmtrsm_l_c99_4x4 ) +GEMMTRSM_UKR_PROT( gemmtrsm_l_c99_4x4 ) +GEMMTRSM_UKR_PROT( gemmtrsm_l_c99_4x4 ) -// -// Prototype the void pointer kernel wrappers. -// +GEMMTRSM_UKR_PROT( gemmtrsm_u_c99_4x4 ) +GEMMTRSM_UKR_PROT( gemmtrsm_u_c99_4x4 ) +GEMMTRSM_UKR_PROT( gemmtrsm_u_c99_4x4 ) +GEMMTRSM_UKR_PROT( gemmtrsm_u_c99_4x4 ) -#undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ -\ -void PASTEMAC(ch,varname)( \ - void* a, \ - void* b, \ - void* c, inc_t rs_c, inc_t cs_c, \ - auxinfo_t* data, \ - cntx_t* cntx, \ - void* ukr \ - ); +TRSM_UKR_PROT( trsm_l_c99_4x4 ) +TRSM_UKR_PROT( trsm_l_c99_4x4 ) +TRSM_UKR_PROT( trsm_l_c99_4x4 ) +TRSM_UKR_PROT( trsm_l_c99_4x4 ) -INSERT_GENTPROT_BASIC( trsm_l_ukernel_void ) -INSERT_GENTPROT_BASIC( trsm_u_ukernel_void ) +TRSM_UKR_PROT( trsm_u_c99_4x4 ) +TRSM_UKR_PROT( trsm_u_c99_4x4 ) +TRSM_UKR_PROT( trsm_u_c99_4x4 ) +TRSM_UKR_PROT( trsm_u_c99_4x4 ) diff --git a/kernels/loongson3a/3/bli_gemm_opt_d4x4.c b/kernels/old/loongson3a/3/bli_gemm_loongson3a_opt_d4x4.c similarity index 99% rename from kernels/loongson3a/3/bli_gemm_opt_d4x4.c rename to kernels/old/loongson3a/3/bli_gemm_loongson3a_opt_d4x4.c index cf4f8e01f..3087c4f88 100644 --- a/kernels/loongson3a/3/bli_gemm_opt_d4x4.c +++ b/kernels/old/loongson3a/3/bli_gemm_loongson3a_opt_d4x4.c @@ -35,7 +35,7 @@ #include "blis.h" -void bli_dgemm_opt_4x4 +void bli_dgemm_loongson3a_opt_4x4 ( dim_t k, double* restrict alpha, diff --git a/kernels/nacl/pnacl/1/bli_axpyv_opt.c b/kernels/old/nacl/pnacl/1/bli_axpyv_opt.c similarity index 100% rename from kernels/nacl/pnacl/1/bli_axpyv_opt.c rename to kernels/old/nacl/pnacl/1/bli_axpyv_opt.c diff --git a/kernels/nacl/pnacl/1/bli_dotv_opt.c b/kernels/old/nacl/pnacl/1/bli_dotv_opt.c similarity index 100% rename from kernels/nacl/pnacl/1/bli_dotv_opt.c rename to kernels/old/nacl/pnacl/1/bli_dotv_opt.c diff --git a/kernels/nacl/pnacl/3/bli_gemm_opt.c b/kernels/old/nacl/pnacl/3/bli_gemm_opt.c similarity index 100% rename from kernels/nacl/pnacl/3/bli_gemm_opt.c rename to kernels/old/nacl/pnacl/3/bli_gemm_opt.c diff --git a/kernels/x86_64/penryn/1/bli_axpyv_opt_var1.c b/kernels/penryn/1/bli_axpyv_penryn_int.c similarity index 95% rename from kernels/x86_64/penryn/1/bli_axpyv_opt_var1.c rename to kernels/penryn/1/bli_axpyv_penryn_int.c index 413b14e20..69a98eb73 100644 --- a/kernels/x86_64/penryn/1/bli_axpyv_opt_var1.c +++ b/kernels/penryn/1/bli_axpyv_penryn_int.c @@ -43,7 +43,7 @@ typedef union } v2df_t; -void bli_daxpyv_opt_var1 +void bli_daxpyv_penryn_int ( conj_t conjx, dim_t n, @@ -102,12 +102,17 @@ void bli_daxpyv_opt_var1 // Call the reference implementation if needed. if ( use_ref == TRUE ) { - BLIS_DAXPYV_KERNEL_REF( conjx, - n, - alpha, - x, incx, - y, incy, - cntx ); + daxpyv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_AXPYV_KER, cntx ); + + f + ( + conjx, + n, + alpha, + x, incx, + y, incy, + cntx + ); return; } diff --git a/kernels/x86_64/penryn/1/bli_dotv_opt_var1.c b/kernels/penryn/1/bli_dotv_penryn_int.c similarity index 93% rename from kernels/x86_64/penryn/1/bli_dotv_opt_var1.c rename to kernels/penryn/1/bli_dotv_penryn_int.c index 52c532d9d..51c498f8b 100644 --- a/kernels/x86_64/penryn/1/bli_dotv_opt_var1.c +++ b/kernels/penryn/1/bli_dotv_penryn_int.c @@ -43,7 +43,7 @@ typedef union } v2df_t; -void bli_ddotv_opt_var1 +void bli_ddotv_penryn_int ( conj_t conjx, conj_t conjy, @@ -104,13 +104,18 @@ void bli_ddotv_opt_var1 // Call the reference implementation if needed. if ( use_ref == TRUE ) { - BLIS_DDOTV_KERNEL_REF( conjx, - conjy, - n, - x, incx, - y, incy, - rho, - cntx ); + ddotv_ft f = bli_cntx_get_l1v_ker_dt( BLIS_DOUBLE, BLIS_DOTV_KER, cntx ); + + f + ( + conjx, + conjy, + n, + x, incx, + y, incy, + rho, + cntx + ); return; } diff --git a/kernels/x86_64/penryn/1f/bli_axpy2v_opt_var1.c b/kernels/penryn/1f/bli_axpy2v_penryn_int.c similarity index 95% rename from kernels/x86_64/penryn/1f/bli_axpy2v_opt_var1.c rename to kernels/penryn/1f/bli_axpy2v_penryn_int.c index 29b7a149f..8e43aa4c7 100644 --- a/kernels/x86_64/penryn/1f/bli_axpy2v_opt_var1.c +++ b/kernels/penryn/1f/bli_axpy2v_penryn_int.c @@ -43,7 +43,7 @@ typedef union } v2df_t; -void bli_daxpy2v_int_var1 +void bli_daxpy2v_penryn_int ( conj_t conjx, conj_t conjy, @@ -110,15 +110,20 @@ void bli_daxpy2v_int_var1 // Call the reference implementation if needed. if ( use_ref == TRUE ) { - BLIS_DAXPY2V_KERNEL_REF( conjx, - conjy, - n, - alpha, - beta, - x, incx, - y, incy, - z, incz, - cntx ); + daxpy2v_ft f = bli_cntx_get_l1f_ker_dt( BLIS_DOUBLE, BLIS_AXPY2V_KER, cntx ); + + f + ( + conjx, + conjy, + n, + alpha, + beta, + x, incx, + y, incy, + z, incz, + cntx + ); return; } diff --git a/kernels/x86_64/penryn/1f/bli_axpyf_opt_var1.c b/kernels/penryn/1f/bli_axpyf_penryn_int.c similarity index 94% rename from kernels/x86_64/penryn/1f/bli_axpyf_opt_var1.c rename to kernels/penryn/1f/bli_axpyf_penryn_int.c index 6d67e567a..ce3eb99c8 100644 --- a/kernels/x86_64/penryn/1f/bli_axpyf_opt_var1.c +++ b/kernels/penryn/1f/bli_axpyf_penryn_int.c @@ -43,7 +43,7 @@ typedef union } v2df_t; -void bli_daxpyf_int_var1 +void bli_daxpyf_penryn_int ( conj_t conja, conj_t conjx, @@ -115,15 +115,20 @@ void bli_daxpyf_int_var1 // Call the reference implementation if needed. if ( use_ref == TRUE ) { - BLIS_DAXPYF_KERNEL_REF( conja, - conjx, - m, - b_n, - alpha_cast, - a_cast, inca, lda, - x_cast, incx, - y_cast, incy, - cntx ); + daxpyf_ft f = bli_cntx_get_l1f_ker_dt( BLIS_DOUBLE, BLIS_AXPYF_KER, cntx ); + + f + ( + conja, + conjx, + m, + b_n, + alpha_cast, + a_cast, inca, lda, + x_cast, incx, + y_cast, incy, + cntx + ); return; } diff --git a/kernels/x86_64/penryn/1f/bli_dotaxpyv_opt_var1.c b/kernels/penryn/1f/bli_dotaxpyv_penryn_int.c similarity index 92% rename from kernels/x86_64/penryn/1f/bli_dotaxpyv_opt_var1.c rename to kernels/penryn/1f/bli_dotaxpyv_penryn_int.c index a84d12c2d..c2daeefdc 100644 --- a/kernels/x86_64/penryn/1f/bli_dotaxpyv_opt_var1.c +++ b/kernels/penryn/1f/bli_dotaxpyv_penryn_int.c @@ -43,7 +43,7 @@ typedef union } v2df_t; -void bli_ddotaxpyv_int_var1 +void bli_ddotaxpyv_penryn_int ( conj_t conjxt, conj_t conjx, @@ -112,16 +112,21 @@ void bli_ddotaxpyv_int_var1 // Call the reference implementation if needed. if ( use_ref == TRUE ) { - BLIS_DDOTAXPYV_KERNEL_REF( conjxt, - conjx, - conjy, - n, - alpha, - x, incx, - y, incy, - rho, - z, incz, - cntx ); + ddotaxpyv_ft f = bli_cntx_get_l1f_ker_dt( BLIS_DOUBLE, BLIS_DOTAXPYV_KER, cntx ); + + f + ( + conjxt, + conjx, + conjy, + n, + alpha, + x, incx, + y, incy, + rho, + z, incz, + cntx + ); return; } diff --git a/kernels/x86_64/penryn/1f/bli_dotxaxpyf_opt_var1.c b/kernels/penryn/1f/bli_dotxaxpyf_penryn_int.c similarity index 93% rename from kernels/x86_64/penryn/1f/bli_dotxaxpyf_opt_var1.c rename to kernels/penryn/1f/bli_dotxaxpyf_penryn_int.c index 69c638e62..13b461632 100644 --- a/kernels/x86_64/penryn/1f/bli_dotxaxpyf_opt_var1.c +++ b/kernels/penryn/1f/bli_dotxaxpyf_penryn_int.c @@ -43,7 +43,7 @@ typedef union } v2df_t; -void bli_ddotxaxpyf_int_var1 +void bli_ddotxaxpyf_penryn_int ( conj_t conjat, conj_t conja, @@ -144,20 +144,24 @@ void bli_ddotxaxpyf_int_var1 if ( use_ref == TRUE ) { - BLIS_DDOTXAXPYF_KERNEL_REF( conjat, - conja, - conjw, - conjx, - m, - b_n, - alpha_cast, - a_cast, inca, lda, - w_cast, incw, - x_cast, incx, - beta_cast, - y_cast, incy, - z_cast, incz, - cntx ); + ddotxaxpyf_ft f = bli_cntx_get_l1f_ker_dt( BLIS_DOUBLE, BLIS_DOTXAXPYF_KER, cntx ); + f + ( + conjat, + conja, + conjw, + conjx, + m, + b_n, + alpha_cast, + a_cast, inca, lda, + w_cast, incw, + x_cast, incx, + beta_cast, + y_cast, incy, + z_cast, incz, + cntx + ); return; } diff --git a/kernels/x86_64/penryn/1f/bli_dotxf_opt_var1.c b/kernels/penryn/1f/bli_dotxf_penryn_int.c similarity index 95% rename from kernels/x86_64/penryn/1f/bli_dotxf_opt_var1.c rename to kernels/penryn/1f/bli_dotxf_penryn_int.c index 386863513..127bf1d6e 100644 --- a/kernels/x86_64/penryn/1f/bli_dotxf_opt_var1.c +++ b/kernels/penryn/1f/bli_dotxf_penryn_int.c @@ -43,7 +43,7 @@ typedef union } v2df_t; -void bli_ddotxf_int_var1 +void bli_ddotxf_penryn_int ( conj_t conjat, conj_t conjx, @@ -129,16 +129,20 @@ void bli_ddotxf_int_var1 // Call the reference implementation if needed. if ( use_ref == TRUE ) { - BLIS_DDOTXF_KERNEL_REF( conjat, - conjx, - m, - b_n, - alpha_cast, - a_cast, inca, lda, - x_cast, incx, - beta_cast, - y_cast, incy, - cntx ); + ddotxf_ft f = bli_cntx_get_l1f_ker_dt( BLIS_DOUBLE, BLIS_DOTXF_KER, cntx ); + + f + ( conjat, + conjx, + m, + b_n, + alpha_cast, + a_cast, inca, lda, + x_cast, incx, + beta_cast, + y_cast, incy, + cntx + ); return; } diff --git a/kernels/x86_64/penryn/1f/old/bli_axpyf_opt_var1.c.alt b/kernels/penryn/1f/old/bli_axpyf_penryn_int.c.alt similarity index 94% rename from kernels/x86_64/penryn/1f/old/bli_axpyf_opt_var1.c.alt rename to kernels/penryn/1f/old/bli_axpyf_penryn_int.c.alt index 51841d64f..78684f58a 100644 --- a/kernels/x86_64/penryn/1f/old/bli_axpyf_opt_var1.c.alt +++ b/kernels/penryn/1f/old/bli_axpyf_penryn_int.c.alt @@ -48,17 +48,17 @@ typedef void (*FUNCPTR_T)( // If some mixed datatype functions will not be compiled, we initialize // the corresponding elements of the function array to NULL. #ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT -static FUNCPTR_T GENARRAY3_ALL(ftypes,axpyf_opt_var1); +static FUNCPTR_T GENARRAY3_ALL(ftypes,axpyf_penryn_int); #else #ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT -static FUNCPTR_T GENARRAY3_EXT(ftypes,axpyf_opt_var1); +static FUNCPTR_T GENARRAY3_EXT(ftypes,axpyf_penryn_int); #else -static FUNCPTR_T GENARRAY3_MIN(ftypes,axpyf_opt_var1); +static FUNCPTR_T GENARRAY3_MIN(ftypes,axpyf_penryn_int); #endif #endif -void bli_axpyf_opt_var1( obj_t* alpha, +void bli_axpyf_penryn_int( obj_t* alpha, obj_t* x, obj_t* y ) { @@ -140,18 +140,18 @@ void PASTEMAC3(cha,chx,chy,varname)( \ // Define the basic set of functions unconditionally, and then also some // mixed datatype functions if requested. -//INSERT_GENTFUNC3U12_BASIC( axpyf, axpyf_opt_var1 ) -GENTFUNC3U12( float, float, float, float, s, s, s, s, axpyf, axpyf_opt_var1 ) -//GENTFUNC3U12( double, double, double, double, d, d, d, d, axpyf, axpyf_opt_var1 ) -GENTFUNC3U12( scomplex, scomplex, scomplex, scomplex, c, c, c, c, axpyf, axpyf_opt_var1 ) -GENTFUNC3U12( dcomplex, dcomplex, dcomplex, dcomplex, z, z, z, z, axpyf, axpyf_opt_var1 ) +//INSERT_GENTFUNC3U12_BASIC( axpyf, axpyf_penryn_int ) +GENTFUNC3U12( float, float, float, float, s, s, s, s, axpyf, axpyf_penryn_int ) +//GENTFUNC3U12( double, double, double, double, d, d, d, d, axpyf, axpyf_penryn_int ) +GENTFUNC3U12( scomplex, scomplex, scomplex, scomplex, c, c, c, c, axpyf, axpyf_penryn_int ) +GENTFUNC3U12( dcomplex, dcomplex, dcomplex, dcomplex, z, z, z, z, axpyf, axpyf_penryn_int ) #ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT -INSERT_GENTFUNC3U12_MIX_D( axpyf, axpyf_opt_var1 ) +INSERT_GENTFUNC3U12_MIX_D( axpyf, axpyf_penryn_int ) #endif #ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT -INSERT_GENTFUNC3U12_MIX_P( axpyf, axpyf_opt_var1 ) +INSERT_GENTFUNC3U12_MIX_P( axpyf, axpyf_penryn_int ) #endif @@ -163,7 +163,7 @@ typedef union } v2df_t; -void bli_dddaxpyf_opt_var1( +void bli_dddaxpyf_penryn_int( conj_t conja, conj_t conjx, dim_t m, diff --git a/kernels/x86_64/penryn/1f/old/bli_dotxf_opt_var1.c.alt b/kernels/penryn/1f/old/bli_dotxf_penryn_int.c.alt similarity index 96% rename from kernels/x86_64/penryn/1f/old/bli_dotxf_opt_var1.c.alt rename to kernels/penryn/1f/old/bli_dotxf_penryn_int.c.alt index cf2946d3b..e800f0901 100644 --- a/kernels/x86_64/penryn/1f/old/bli_dotxf_opt_var1.c.alt +++ b/kernels/penryn/1f/old/bli_dotxf_penryn_int.c.alt @@ -51,17 +51,17 @@ typedef void (*FUNCPTR_T)( // If some mixed datatype functions will not be compiled, we initialize // the corresponding elements of the function array to NULL. #ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT -static FUNCPTR_T GENARRAY3_ALL(ftypes,dotxf_opt_var1); +static FUNCPTR_T GENARRAY3_ALL(ftypes,dotxf_penryn_int); #else #ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT -static FUNCPTR_T GENARRAY3_EXT(ftypes,dotxf_opt_var1); +static FUNCPTR_T GENARRAY3_EXT(ftypes,dotxf_penryn_int); #else -static FUNCPTR_T GENARRAY3_MIN(ftypes,dotxf_opt_var1); +static FUNCPTR_T GENARRAY3_MIN(ftypes,dotxf_penryn_int); #endif #endif -void bli_dotxf_opt_var1( obj_t* alpha, +void bli_dotxf_penryn_int( obj_t* alpha, obj_t* x, obj_t* y, obj_t* beta, @@ -160,18 +160,18 @@ void PASTEMAC3(chx,chy,chr,varname)( \ // Define the basic set of functions unconditionally, and then also some // mixed datatype functions if requested. -//INSERT_GENTFUNC3U12_BASIC( dotxf, dotxf_opt_var1 ) -GENTFUNC3U12( float, float, float, float, s, s, s, s, dotxf, dotxf_opt_var1 ) -//GENTFUNC3U12( double, double, double, double, d, d, d, d, dotxf, dotxf_opt_var1 ) -GENTFUNC3U12( scomplex, scomplex, scomplex, scomplex, c, c, c, c, dotxf, dotxf_opt_var1 ) -GENTFUNC3U12( dcomplex, dcomplex, dcomplex, dcomplex, z, z, z, z, dotxf, dotxf_opt_var1 ) +//INSERT_GENTFUNC3U12_BASIC( dotxf, dotxf_penryn_int ) +GENTFUNC3U12( float, float, float, float, s, s, s, s, dotxf, dotxf_penryn_int ) +//GENTFUNC3U12( double, double, double, double, d, d, d, d, dotxf, dotxf_penryn_int ) +GENTFUNC3U12( scomplex, scomplex, scomplex, scomplex, c, c, c, c, dotxf, dotxf_penryn_int ) +GENTFUNC3U12( dcomplex, dcomplex, dcomplex, dcomplex, z, z, z, z, dotxf, dotxf_penryn_int ) #ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT -INSERT_GENTFUNC3U12_MIX_D( dotxf, dotxf_opt_var1 ) +INSERT_GENTFUNC3U12_MIX_D( dotxf, dotxf_penryn_int ) #endif #ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT -INSERT_GENTFUNC3U12_MIX_P( dotxf, dotxf_opt_var1 ) +INSERT_GENTFUNC3U12_MIX_P( dotxf, dotxf_penryn_int ) #endif @@ -183,7 +183,7 @@ typedef union } v2df_t; -void bli_ddddotxf_opt_var1( +void bli_ddddotxf_penryn_int( conj_t conjx, conj_t conjy, dim_t b_m, diff --git a/kernels/x86_64/penryn/3/bli_gemm_asm_d4x4.c b/kernels/penryn/3/bli_gemm_penryn_asm_d4x4.c similarity index 99% rename from kernels/x86_64/penryn/3/bli_gemm_asm_d4x4.c rename to kernels/penryn/3/bli_gemm_penryn_asm_d4x4.c index d08c1a4b1..4d2af020e 100644 --- a/kernels/x86_64/penryn/3/bli_gemm_asm_d4x4.c +++ b/kernels/penryn/3/bli_gemm_penryn_asm_d4x4.c @@ -34,7 +34,7 @@ #include "blis.h" -void bli_sgemm_asm_8x4 +void bli_sgemm_penryn_asm_8x4 ( dim_t k, float* restrict alpha, @@ -836,7 +836,7 @@ void bli_sgemm_asm_8x4 ); } -void bli_dgemm_asm_4x4 +void bli_dgemm_penryn_asm_4x4 ( dim_t k, double* restrict alpha, @@ -1479,34 +1479,3 @@ void bli_dgemm_asm_4x4 ); } -#if 0 - -void bli_cgemm_asm_4x2 - ( - dim_t k, - scomplex* restrict alpha, - scomplex* restrict a, - scomplex* restrict b, - scomplex* restrict beta, - scomplex* restrict c, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -} - -void bli_zgemm_asm_2x2 - ( - dim_t k, - dcomplex* restrict alpha, - dcomplex* restrict a, - dcomplex* restrict b, - dcomplex* restrict beta, - dcomplex* restrict c, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -} - -#endif diff --git a/kernels/x86_64/penryn/3/bli_gemmtrsm_l_asm_d4x4.c b/kernels/penryn/3/bli_gemmtrsm_l_penryn_asm_d4x4.c similarity index 97% rename from kernels/x86_64/penryn/3/bli_gemmtrsm_l_asm_d4x4.c rename to kernels/penryn/3/bli_gemmtrsm_l_penryn_asm_d4x4.c index f96d72325..b9a4a06af 100644 --- a/kernels/x86_64/penryn/3/bli_gemmtrsm_l_asm_d4x4.c +++ b/kernels/penryn/3/bli_gemmtrsm_l_penryn_asm_d4x4.c @@ -35,7 +35,7 @@ #include "blis.h" #if 0 -void bli_sgemmtrsm_l_asm_8x4 +void bli_sgemmtrsm_l_penryn_asm_8x4 ( dim_t k, float* restrict alpha, @@ -51,7 +51,7 @@ void bli_sgemmtrsm_l_asm_8x4 } #endif -void bli_dgemmtrsm_l_asm_4x4 +void bli_dgemmtrsm_l_penryn_asm_4x4 ( dim_t k, double* restrict alpha, @@ -536,35 +536,3 @@ void bli_dgemmtrsm_l_asm_4x4 } -#if 0 -void bli_cgemmtrsm_l_asm_4x2 - ( - dim_t k, - scomplex* restrict alpha, - scomplex* restrict a10, - scomplex* restrict a11, - scomplex* restrict b01, - scomplex* restrict b11, - scomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -} - -void bli_zgemmtrsm_l_asm_2x2 - ( - dim_t k, - dcomplex* restrict alpha, - dcomplex* restrict a10, - dcomplex* restrict a11, - dcomplex* restrict b01, - dcomplex* restrict b11, - dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -} -#endif - diff --git a/kernels/x86_64/penryn/3/bli_gemmtrsm_u_asm_d4x4.c b/kernels/penryn/3/bli_gemmtrsm_u_penryn_asm_d4x4.c similarity index 96% rename from kernels/x86_64/penryn/3/bli_gemmtrsm_u_asm_d4x4.c rename to kernels/penryn/3/bli_gemmtrsm_u_penryn_asm_d4x4.c index 2cfaec0a3..e9cfdea70 100644 --- a/kernels/x86_64/penryn/3/bli_gemmtrsm_u_asm_d4x4.c +++ b/kernels/penryn/3/bli_gemmtrsm_u_penryn_asm_d4x4.c @@ -35,7 +35,7 @@ #include "blis.h" #if 0 -void bli_sgemmtrsm_u_asm_8x4 +void bli_sgemmtrsm_u_penryn_asm_8x4 ( dim_t k, float* restrict alpha, @@ -51,7 +51,7 @@ void bli_sgemmtrsm_u_asm_8x4 } #endif -void bli_dgemmtrsm_u_asm_4x4 +void bli_dgemmtrsm_u_penryn_asm_4x4 ( dim_t k, double* restrict alpha, @@ -523,35 +523,3 @@ void bli_dgemmtrsm_u_asm_4x4 } -#if 0 -void bli_cgemmtrsm_u_asm_4x2 - ( - dim_t k, - scomplex* restrict alpha, - scomplex* restrict a12, - scomplex* restrict a11, - scomplex* restrict b21, - scomplex* restrict b11, - scomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -} - -void bli_zgemmtrsm_u_asm_2x2 - ( - dim_t k, - dcomplex* restrict alpha, - dcomplex* restrict a12, - dcomplex* restrict a11, - dcomplex* restrict b21, - dcomplex* restrict b11, - dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -} -#endif - diff --git a/kernels/x86_64/penryn/3/bli_trsm_l_asm_d4x4.c b/kernels/penryn/3/bli_trsm_l_penryn_asm_d4x4.c similarity index 95% rename from kernels/x86_64/penryn/3/bli_trsm_l_asm_d4x4.c rename to kernels/penryn/3/bli_trsm_l_penryn_asm_d4x4.c index 193f5457a..12b80441a 100644 --- a/kernels/x86_64/penryn/3/bli_trsm_l_asm_d4x4.c +++ b/kernels/penryn/3/bli_trsm_l_penryn_asm_d4x4.c @@ -35,7 +35,7 @@ #include "blis.h" #if 0 -void bli_strsm_l_asm_8x4 +void bli_strsm_l_penryn_asm_8x4 ( float* restrict a11, float* restrict b11, @@ -47,7 +47,7 @@ void bli_strsm_l_asm_8x4 } #endif -void bli_dtrsm_l_asm_4x4 +void bli_dtrsm_l_penryn_asm_4x4 ( double* restrict a11, double* restrict b11, @@ -209,26 +209,3 @@ void bli_dtrsm_l_asm_4x4 } -#if 0 -void bli_ctrsm_l_asm_4x2 - ( - scomplex* restrict a11, - scomplex* restrict b11, - scomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -} - -void bli_ztrsm_l_asm_2x2 - ( - dcomplex* restrict a11, - dcomplex* restrict b11, - dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -} -#endif diff --git a/kernels/x86_64/penryn/3/bli_trsm_u_asm_d4x4.c b/kernels/penryn/3/bli_trsm_u_penryn_asm_d4x4.c similarity index 95% rename from kernels/x86_64/penryn/3/bli_trsm_u_asm_d4x4.c rename to kernels/penryn/3/bli_trsm_u_penryn_asm_d4x4.c index 5d8baf099..e9d85cc33 100644 --- a/kernels/x86_64/penryn/3/bli_trsm_u_asm_d4x4.c +++ b/kernels/penryn/3/bli_trsm_u_penryn_asm_d4x4.c @@ -35,7 +35,7 @@ #include "blis.h" #if 0 -void bli_strsm_u_asm_8x4 +void bli_strsm_u_penryn_asm_8x4 ( float* restrict a11, float* restrict b11, @@ -47,7 +47,7 @@ void bli_strsm_u_asm_8x4 } #endif -void bli_dtrsm_u_asm_4x4 +void bli_dtrsm_u_penryn_asm_4x4 ( double* restrict a11, double* restrict b11, @@ -212,27 +212,3 @@ void bli_dtrsm_u_asm_4x4 } -#if 0 -void bli_ctrsm_u_asm_4x2 - ( - scomplex* restrict a11, - scomplex* restrict b11, - scomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -} - -void bli_ztrsm_u_asm_2x2 - ( - dcomplex* restrict a11, - dcomplex* restrict b11, - dcomplex* restrict c11, inc_t rs_c, inc_t cs_c, - auxinfo_t* restrict data, - cntx_t* restrict cntx - ) -{ -} -#endif - diff --git a/frame/1/kernels/old/bli_addv_ref.h b/kernels/penryn/bli_kernels_penryn.h similarity index 83% rename from frame/1/kernels/old/bli_addv_ref.h rename to kernels/penryn/bli_kernels_penryn.h index 98392eccf..51a3a63ef 100644 --- a/frame/1/kernels/old/bli_addv_ref.h +++ b/kernels/penryn/bli_kernels_penryn.h @@ -32,17 +32,12 @@ */ +GEMM_UKR_PROT( float, s, gemm_penryn_asm_8x4 ) +GEMM_UKR_PROT( double, d, gemm_penryn_asm_4x4 ) -#undef GENTPROT2 -#define GENTPROT2( ctype_x, ctype_y, chx, chy, varname ) \ -\ -void PASTEMAC(chx,varname) \ - ( \ - conj_t conjx, \ - dim_t n, \ - ctype_x* x, inc_t incx, \ - ctype_y* y, inc_t incy \ - ); +GEMMTRSM_UKR_PROT( double, d, gemmtrsm_l_penryn_asm_4x4 ) +GEMMTRSM_UKR_PROT( double, d, gemmtrsm_u_penryn_asm_4x4 ) -INSERT_GENTPROT2_BASIC( addv_ref ) +TRSM_UKR_PROT( double, d, trsm_l_penryn_asm_4x4 ) +TRSM_UKR_PROT( double, d, trsm_u_penryn_asm_4x4 ) diff --git a/kernels/x86_64/piledriver/3/bli_gemm_asm_d8x3.c b/kernels/piledriver/3/bli_gemm_piledriver_asm_d8x3.c similarity index 99% rename from kernels/x86_64/piledriver/3/bli_gemm_asm_d8x3.c rename to kernels/piledriver/3/bli_gemm_piledriver_asm_d8x3.c index 9d0475191..2a7dece37 100644 --- a/kernels/x86_64/piledriver/3/bli_gemm_asm_d8x3.c +++ b/kernels/piledriver/3/bli_gemm_piledriver_asm_d8x3.c @@ -37,7 +37,7 @@ #include "blis.h" -void bli_sgemm_asm_16x3 +void bli_sgemm_piledriver_asm_16x3 ( dim_t k, float* restrict alpha, @@ -904,7 +904,7 @@ void bli_sgemm_asm_16x3 ); } -void bli_dgemm_asm_8x3 +void bli_dgemm_piledriver_asm_8x3 ( dim_t k, double* restrict alpha, @@ -1619,7 +1619,7 @@ void bli_dgemm_asm_8x3 ); } -void bli_cgemm_asm_4x2 +void bli_cgemm_piledriver_asm_4x2 ( dim_t k, scomplex* restrict alpha, @@ -2163,7 +2163,7 @@ void bli_cgemm_asm_4x2 ); } -void bli_zgemm_asm_2x2 +void bli_zgemm_piledriver_asm_2x2 ( dim_t k, dcomplex* restrict alpha, diff --git a/kernels/piledriver/bli_kernels_piledriver.h b/kernels/piledriver/bli_kernels_piledriver.h new file mode 100644 index 000000000..6493e2325 --- /dev/null +++ b/kernels/piledriver/bli_kernels_piledriver.h @@ -0,0 +1,40 @@ +/* + + 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. + +*/ + +// d8x4 (assembly) +GEMM_UKR_PROT( float, s, gemm_piledriver_asm_16x3 ) +GEMM_UKR_PROT( double, d, gemm_piledriver_asm_8x3 ) +GEMM_UKR_PROT( scomplex, c, gemm_piledriver_asm_4x2 ) +GEMM_UKR_PROT( dcomplex, z, gemm_piledriver_asm_2x2 ) + diff --git a/kernels/power7/3/bli_gemm_opt_8x4.c b/kernels/power7/3/bli_gemm_power7_int_8x4.c similarity index 97% rename from kernels/power7/3/bli_gemm_opt_8x4.c rename to kernels/power7/3/bli_gemm_power7_int_8x4.c index 456973023..93262bed2 100644 --- a/kernels/power7/3/bli_gemm_opt_8x4.c +++ b/kernels/power7/3/bli_gemm_power7_int_8x4.c @@ -48,7 +48,7 @@ * a is mr x k in packed col-maj format (leading dim is mr) * b is k x nr in packed row-maj format (leading dim is nr) */ -void bli_sgemm_opt_8x4 +void bli_sgemm_power7_int_8x4 ( dim_t k, float* restrict alpha, @@ -60,7 +60,7 @@ void bli_sgemm_opt_8x4 cntx_t* restrict cntx ) { -#if 0 || defined(UTEST) +#if 1 || defined(UTEST) const long MR = BLIS_DEFAULT_MR_S, NR = BLIS_DEFAULT_NR_S; const long LDA = MR, LDB = NR; long i, j, kk; @@ -75,7 +75,7 @@ void bli_sgemm_opt_8x4 } } #else - BLIS_SGEMM_UKERNEL_REF(k, alpha, a, b, beta, c, rs_c, cs_c, data); + //BLIS_SGEMM_UKERNEL_REF(k, alpha, a, b, beta, c, rs_c, cs_c, data); #endif } @@ -88,7 +88,7 @@ void bli_sgemm_opt_8x4 * a is mr x k in packed col-maj format (leading dim is mr) * b is k x nr in packed row-maj format (leading dim is nr) */ -void bli_dgemm_opt_8x4 +void bli_dgemm_power7_int_8x4 ( dim_t k, double* restrict alpha, @@ -434,7 +434,7 @@ void bli_dgemm_opt_8x4 else #endif { /* General case. Just do it right. */ -#if 0 || defined(UTEST) +#if 1 || defined(UTEST) const long MR = BLIS_DEFAULT_MR_D, NR = BLIS_DEFAULT_NR_D; const long LDA = MR, LDB = NR; int i, j, kk; @@ -449,7 +449,7 @@ void bli_dgemm_opt_8x4 } } #else - BLIS_DGEMM_UKERNEL_REF(k, alpha, a, b, beta, c, rs_c, cs_c, data); + //BLIS_DGEMM_UKERNEL_REF(k, alpha, a, b, beta, c, rs_c, cs_c, data); #endif } } @@ -463,7 +463,7 @@ void bli_dgemm_opt_8x4 * a is mr x k in packed col-maj format (leading dim is mr) * b is k x nr in packed row-maj format (leading dim is nr) */ -void bli_cgemm_opt_8x4 +void bli_cgemm_power7_int_8x4 ( dim_t k, scomplex* restrict alpha, @@ -475,7 +475,7 @@ void bli_cgemm_opt_8x4 cntx_t* restrict cntx ) { -#if 0 || defined(UTEST) +#if 1 || defined(UTEST) const long MR = BLIS_DEFAULT_MR_C, NR = BLIS_DEFAULT_NR_C; const long LDA = MR, LDB = NR; int i, j, kk; @@ -501,7 +501,7 @@ void bli_cgemm_opt_8x4 } } #else - BLIS_CGEMM_UKERNEL_REF(k, alpha, a, b, beta, c, rs_c, cs_c, data); + //BLIS_CGEMM_UKERNEL_REF(k, alpha, a, b, beta, c, rs_c, cs_c, data); #endif } @@ -514,7 +514,7 @@ void bli_cgemm_opt_8x4 * a is mr x k in packed col-maj format (leading dim is mr) * b is k x nr in packed row-maj format (leading dim is nr) */ -void bli_zgemm_opt_8x4 +void bli_zgemm_power7_int_8x4 ( dim_t k, scomplex* restrict alpha, @@ -526,7 +526,7 @@ void bli_zgemm_opt_8x4 cntx_t* restrict cntx ) { -#if 0 || defined(UTEST) +#if 1 || defined(UTEST) const long MR = BLIS_DEFAULT_MR_Z, NR = BLIS_DEFAULT_NR_Z; const long LDA = MR, LDB = NR; int i, j, kk; @@ -552,7 +552,7 @@ void bli_zgemm_opt_8x4 } } #else - BLIS_ZGEMM_UKERNEL_REF(k, alpha, a, b, beta, c, rs_c, cs_c, data); + //BLIS_ZGEMM_UKERNEL_REF(k, alpha, a, b, beta, c, rs_c, cs_c, data); #endif } diff --git a/kernels/power7/3/test/bli_gemm_opt_8x4.c b/kernels/power7/3/test/bli_gemm_opt_8x4.c deleted file mode 120000 index 74bc86160..000000000 --- a/kernels/power7/3/test/bli_gemm_opt_8x4.c +++ /dev/null @@ -1 +0,0 @@ -../bli_gemm_opt_8x4.c \ No newline at end of file diff --git a/kernels/power7/3/test/bli_gemm_opt_8x4.h b/kernels/power7/3/test/bli_gemm_opt_8x4.h deleted file mode 120000 index d45432d95..000000000 --- a/kernels/power7/3/test/bli_gemm_opt_8x4.h +++ /dev/null @@ -1 +0,0 @@ -../bli_gemm_opt_8x4.h \ No newline at end of file diff --git a/kernels/power7/3/test/bli_gemm_power7_int_8x4.c b/kernels/power7/3/test/bli_gemm_power7_int_8x4.c new file mode 120000 index 000000000..d9be05985 --- /dev/null +++ b/kernels/power7/3/test/bli_gemm_power7_int_8x4.c @@ -0,0 +1 @@ +../bli_gemm_power7_int_8x4.c \ No newline at end of file diff --git a/kernels/power7/3/bli_gemm_opt_8x4.h b/kernels/power7/3/test/bli_gemm_power7_int_8x4.h similarity index 100% rename from kernels/power7/3/bli_gemm_opt_8x4.h rename to kernels/power7/3/test/bli_gemm_power7_int_8x4.h diff --git a/kernels/power7/3/test/exp.c b/kernels/power7/3/test/exp.c index b7f2361ad..bf138f36b 100644 --- a/kernels/power7/3/test/exp.c +++ b/kernels/power7/3/test/exp.c @@ -6,7 +6,7 @@ #include /* fabs */ #include "blis_utest.h" -#include "bli_gemm_opt_8x4.h" +#include "bli_gemm_power7_opt_8x4.h" #define COLMAJ_INDEX(row,col,ld) ((col*ld)+row) #define ROWMAJ_INDEX(row,col,ld) ((row*ld)+col) diff --git a/frame/3/old/bli_herk_prune.h b/kernels/power7/bli_kernels_power7.h similarity index 88% rename from frame/3/old/bli_herk_prune.h rename to kernels/power7/bli_kernels_power7.h index 4754d1584..38d4ff309 100644 --- a/frame/3/old/bli_herk_prune.h +++ b/kernels/power7/bli_kernels_power7.h @@ -32,7 +32,9 @@ */ -void bli_herk_prune_unref_mparts_m( obj_t* a, obj_t* ah, obj_t* c ); -void bli_herk_prune_unref_mparts_n( obj_t* a, obj_t* ah, obj_t* c ); -void bli_herk_prune_unref_mparts_k( obj_t* a, obj_t* ah, obj_t* c ); +// d8x4 (intrinsics) +GEMM_UKR_PROT( float, s, gemm_power7_int_8x4 ) +GEMM_UKR_PROT( double, d, gemm_power7_int_8x4 ) +GEMM_UKR_PROT( scomplex, c, gemm_power7_int_8x4 ) +GEMM_UKR_PROT( dcomplex, z, gemm_power7_int_8x4 ) diff --git a/kernels/x86_64/sandybridge/3/bli_gemm_asm_d8x4.c b/kernels/sandybridge/3/bli_gemm_sandybridge_asm_d8x4.c similarity index 99% rename from kernels/x86_64/sandybridge/3/bli_gemm_asm_d8x4.c rename to kernels/sandybridge/3/bli_gemm_sandybridge_asm_d8x4.c index f19f053fc..6dd511ea3 100644 --- a/kernels/x86_64/sandybridge/3/bli_gemm_asm_d8x4.c +++ b/kernels/sandybridge/3/bli_gemm_sandybridge_asm_d8x4.c @@ -37,7 +37,7 @@ #include "blis.h" -void bli_sgemm_asm_8x8 +void bli_sgemm_sandybridge_asm_8x8 ( dim_t k, float* restrict alpha, @@ -991,9 +991,9 @@ void bli_sgemm_asm_8x8 " \n\t" " \n\t" ".SDONE: \n\t" - " \n\t" - "vzeroupper \n\t" - " \n\t" + " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -1019,7 +1019,7 @@ void bli_sgemm_asm_8x8 ); } -void bli_dgemm_asm_8x4 +void bli_dgemm_sandybridge_asm_8x4 ( dim_t k, double* restrict alpha, @@ -1663,6 +1663,8 @@ void bli_dgemm_asm_8x4 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -1688,7 +1690,7 @@ void bli_dgemm_asm_8x4 ); } -void bli_cgemm_asm_8x4 +void bli_cgemm_sandybridge_asm_8x4 ( dim_t k, scomplex* restrict alpha, @@ -2618,6 +2620,8 @@ void bli_cgemm_asm_8x4 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands @@ -2645,7 +2649,7 @@ void bli_cgemm_asm_8x4 -void bli_zgemm_asm_4x4 +void bli_zgemm_sandybridge_asm_4x4 ( dim_t k, dcomplex* restrict alpha, @@ -3462,6 +3466,8 @@ void bli_zgemm_asm_4x4 " \n\t" "vzeroupper \n\t" " \n\t" + "vzeroupper \n\t" + " \n\t" : // output operands (none) : // input operands diff --git a/kernels/x86_64/sandybridge/3/bli_gemm_int_d8x4.c b/kernels/sandybridge/3/bli_gemm_sandybridge_int_d8x4.c similarity index 97% rename from kernels/x86_64/sandybridge/3/bli_gemm_int_d8x4.c rename to kernels/sandybridge/3/bli_gemm_sandybridge_int_d8x4.c index 72d5020a9..d7f02d207 100644 --- a/kernels/x86_64/sandybridge/3/bli_gemm_int_d8x4.c +++ b/kernels/sandybridge/3/bli_gemm_sandybridge_int_d8x4.c @@ -36,7 +36,8 @@ #include -void bli_sgemm_int_8x8 +#if 0 +void bli_sgemm_sandybridge_int_8x8 ( dim_t k, float* restrict alpha, @@ -48,23 +49,12 @@ void bli_sgemm_int_8x8 cntx_t* restrict cntx ) { - /* Just call the reference implementation. */ - BLIS_SGEMM_UKERNEL_REF - ( - k, - alpha, - a, - b, - beta, - c, rs_c, cs_c, - data, - cntx - ); } +#endif -void bli_dgemm_int_8x4 +void bli_dgemm_sandybridge_int_8x4 ( dim_t k, double* restrict alpha, @@ -638,7 +628,8 @@ void bli_dgemm_int_8x4 -void bli_cgemm_int_8x4 +#if 0 +void bli_cgemm_sandybridge_int_8x4 ( dim_t k, scomplex* restrict alpha, @@ -650,23 +641,13 @@ void bli_cgemm_int_8x4 cntx_t* restrict cntx ) { - /* Just call the reference implementation. */ - BLIS_CGEMM_UKERNEL_REF - ( - k, - alpha, - a, - b, - beta, - c, rs_c, cs_c, - data, - cntx - ); } +#endif -void bli_zgemm_int_4x4 +#if 0 +void bli_zgemm_sandybridge_int_4x4 ( dim_t k, dcomplex* restrict alpha, @@ -678,17 +659,6 @@ void bli_zgemm_int_4x4 cntx_t* restrict cntx ) { - /* Just call the reference implementation. */ - BLIS_ZGEMM_UKERNEL_REF - ( - k, - alpha, - a, - b, - beta, - c, rs_c, cs_c, - data, - cntx - ); } +#endif diff --git a/kernels/sandybridge/bli_kernels_sandybridge.h b/kernels/sandybridge/bli_kernels_sandybridge.h new file mode 100644 index 000000000..79796bb8d --- /dev/null +++ b/kernels/sandybridge/bli_kernels_sandybridge.h @@ -0,0 +1,46 @@ +/* + + 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. + +*/ + +// d8x4 (assembly) +GEMM_UKR_PROT( float, s, gemm_sandybridge_asm_8x8 ) +GEMM_UKR_PROT( double, d, gemm_sandybridge_asm_8x4 ) +GEMM_UKR_PROT( scomplex, c, gemm_sandybridge_asm_8x4 ) +GEMM_UKR_PROT( dcomplex, z, gemm_sandybridge_asm_4x4 ) + +// d8x4 (intrinsics) +GEMM_UKR_PROT( float, s, gemm_sandybridge_int_8x8 ) +GEMM_UKR_PROT( double, d, gemm_sandybridge_int_8x4 ) +GEMM_UKR_PROT( scomplex, c, gemm_sandybridge_int_8x4 ) +GEMM_UKR_PROT( dcomplex, z, gemm_sandybridge_int_4x4 ) + diff --git a/frame/1/kernels/bli_addv_ref.c b/ref_kernels/1/bli_addv_ref.c similarity index 94% rename from frame/1/kernels/bli_addv_ref.c rename to ref_kernels/1/bli_addv_ref.c index aaf47859c..eb9239f8f 100644 --- a/frame/1/kernels/bli_addv_ref.c +++ b/ref_kernels/1/bli_addv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjx, \ dim_t n, \ @@ -97,5 +97,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( addv_ref ) +INSERT_GENTFUNC_BASIC2( addv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_amaxv_ref.c b/ref_kernels/1/bli_amaxv_ref.c similarity index 96% rename from frame/1/kernels/bli_amaxv_ref.c rename to ref_kernels/1/bli_amaxv_ref.c index f207b799f..4dbf79853 100644 --- a/frame/1/kernels/bli_amaxv_ref.c +++ b/ref_kernels/1/bli_amaxv_ref.c @@ -39,9 +39,9 @@ // #undef GENTFUNCR -#define GENTFUNCR( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCR( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t n, \ ctype* x, inc_t incx, \ @@ -130,5 +130,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCR_BASIC0( amaxv_ref ) +INSERT_GENTFUNCR_BASIC2( amaxv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_axpbyv_ref.c b/ref_kernels/1/bli_axpbyv_ref.c similarity index 97% rename from frame/1/kernels/bli_axpbyv_ref.c rename to ref_kernels/1/bli_axpbyv_ref.c index 2751640af..ce503bea8 100644 --- a/frame/1/kernels/bli_axpbyv_ref.c +++ b/ref_kernels/1/bli_axpbyv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjx, \ dim_t n, \ @@ -240,5 +240,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( axpbyv_ref ) +INSERT_GENTFUNC_BASIC2( axpbyv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_axpyv_ref.c b/ref_kernels/1/bli_axpyv_ref.c similarity index 95% rename from frame/1/kernels/bli_axpyv_ref.c rename to ref_kernels/1/bli_axpyv_ref.c index f2733d7bc..de5af407f 100644 --- a/frame/1/kernels/bli_axpyv_ref.c +++ b/ref_kernels/1/bli_axpyv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjx, \ dim_t n, \ @@ -119,5 +119,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( axpyv_ref ) +INSERT_GENTFUNC_BASIC2( axpyv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_copyv_ref.c b/ref_kernels/1/bli_copyv_ref.c similarity index 94% rename from frame/1/kernels/bli_copyv_ref.c rename to ref_kernels/1/bli_copyv_ref.c index e364de57f..663287c5f 100644 --- a/frame/1/kernels/bli_copyv_ref.c +++ b/ref_kernels/1/bli_copyv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjx, \ dim_t n, \ @@ -97,5 +97,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( copyv_ref ) +INSERT_GENTFUNC_BASIC2( copyv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_dotv_ref.c b/ref_kernels/1/bli_dotv_ref.c similarity index 95% rename from frame/1/kernels/bli_dotv_ref.c rename to ref_kernels/1/bli_dotv_ref.c index 61a4784da..145e61079 100644 --- a/frame/1/kernels/bli_dotv_ref.c +++ b/ref_kernels/1/bli_dotv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjx, \ conj_t conjy, \ @@ -120,5 +120,5 @@ void PASTEMAC(ch,varname) \ PASTEMAC(ch,copys)( dotxy, *rho ); \ } -INSERT_GENTFUNC_BASIC0( dotv_ref ) +INSERT_GENTFUNC_BASIC2( dotv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_dotxv_ref.c b/ref_kernels/1/bli_dotxv_ref.c similarity index 95% rename from frame/1/kernels/bli_dotxv_ref.c rename to ref_kernels/1/bli_dotxv_ref.c index 3e26f4ee8..42933dffa 100644 --- a/frame/1/kernels/bli_dotxv_ref.c +++ b/ref_kernels/1/bli_dotxv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjx, \ conj_t conjy, \ @@ -128,5 +128,5 @@ void PASTEMAC(ch,varname) \ PASTEMAC(ch,axpys)( *alpha, dotxy, *rho ); \ } -INSERT_GENTFUNC_BASIC0( dotxv_ref ) +INSERT_GENTFUNC_BASIC2( dotxv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_invertv_ref.c b/ref_kernels/1/bli_invertv_ref.c similarity index 93% rename from frame/1/kernels/bli_invertv_ref.c rename to ref_kernels/1/bli_invertv_ref.c index 9585a970c..a503315d9 100644 --- a/frame/1/kernels/bli_invertv_ref.c +++ b/ref_kernels/1/bli_invertv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t n, \ ctype* restrict x, inc_t incx, \ @@ -69,5 +69,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( invertv_ref ) +INSERT_GENTFUNC_BASIC2( invertv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_scal2v_ref.c b/ref_kernels/1/bli_scal2v_ref.c similarity index 95% rename from frame/1/kernels/bli_scal2v_ref.c rename to ref_kernels/1/bli_scal2v_ref.c index cb874d4ba..a5ee33449 100644 --- a/frame/1/kernels/bli_scal2v_ref.c +++ b/ref_kernels/1/bli_scal2v_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjx, \ dim_t n, \ @@ -135,5 +135,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( scal2v_ref ) +INSERT_GENTFUNC_BASIC2( scal2v, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_scalv_ref.c b/ref_kernels/1/bli_scalv_ref.c similarity index 94% rename from frame/1/kernels/bli_scalv_ref.c rename to ref_kernels/1/bli_scalv_ref.c index cc6817a43..2a7ec3d59 100644 --- a/frame/1/kernels/bli_scalv_ref.c +++ b/ref_kernels/1/bli_scalv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjalpha, \ dim_t n, \ @@ -97,5 +97,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( scalv_ref ) +INSERT_GENTFUNC_BASIC2( scalv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_setv_ref.c b/ref_kernels/1/bli_setv_ref.c similarity index 94% rename from frame/1/kernels/bli_setv_ref.c rename to ref_kernels/1/bli_setv_ref.c index 19b5c4ffb..00894b13e 100644 --- a/frame/1/kernels/bli_setv_ref.c +++ b/ref_kernels/1/bli_setv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjalpha, \ dim_t n, \ @@ -96,5 +96,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( setv_ref ) +INSERT_GENTFUNC_BASIC2( setv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_subv_ref.c b/ref_kernels/1/bli_subv_ref.c similarity index 94% rename from frame/1/kernels/bli_subv_ref.c rename to ref_kernels/1/bli_subv_ref.c index cde01638a..4faba88ec 100644 --- a/frame/1/kernels/bli_subv_ref.c +++ b/ref_kernels/1/bli_subv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjx, \ dim_t n, \ @@ -97,5 +97,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( subv_ref ) +INSERT_GENTFUNC_BASIC2( subv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_swapv_ref.c b/ref_kernels/1/bli_swapv_ref.c similarity index 93% rename from frame/1/kernels/bli_swapv_ref.c rename to ref_kernels/1/bli_swapv_ref.c index 495ffd57b..06a02133b 100644 --- a/frame/1/kernels/bli_swapv_ref.c +++ b/ref_kernels/1/bli_swapv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t n, \ ctype* restrict x, inc_t incx, \ @@ -73,5 +73,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( swapv_ref ) +INSERT_GENTFUNC_BASIC2( swapv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_xpbyv_ref.c b/ref_kernels/1/bli_xpbyv_ref.c similarity index 95% rename from frame/1/kernels/bli_xpbyv_ref.c rename to ref_kernels/1/bli_xpbyv_ref.c index e6d1b1ad5..48c9c5ec8 100644 --- a/frame/1/kernels/bli_xpbyv_ref.c +++ b/ref_kernels/1/bli_xpbyv_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjx, \ dim_t n, \ @@ -133,5 +133,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( xpbyv_ref ) +INSERT_GENTFUNC_BASIC2( xpbyv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1/kernels/bli_l1v_ref.h b/ref_kernels/1/old/bli_l1v_ref.h similarity index 100% rename from frame/1/kernels/bli_l1v_ref.h rename to ref_kernels/1/old/bli_l1v_ref.h diff --git a/frame/1f/kernels/bli_axpy2v_ref.c b/ref_kernels/1f/bli_axpy2v_ref.c similarity index 94% rename from frame/1f/kernels/bli_axpy2v_ref.c rename to ref_kernels/1f/bli_axpy2v_ref.c index a65558540..6983b96f9 100644 --- a/frame/1f/kernels/bli_axpy2v_ref.c +++ b/ref_kernels/1f/bli_axpy2v_ref.c @@ -36,9 +36,9 @@ #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjx, \ conj_t conjy, \ @@ -76,5 +76,5 @@ void PASTEMAC(ch,varname) \ ); \ } -INSERT_GENTFUNC_BASIC0( axpy2v_ref ) +INSERT_GENTFUNC_BASIC2( axpy2v, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1f/kernels/bli_axpyf_ref.c b/ref_kernels/1f/bli_axpyf_ref.c similarity index 94% rename from frame/1f/kernels/bli_axpyf_ref.c rename to ref_kernels/1f/bli_axpyf_ref.c index 72caaf695..1d148deda 100644 --- a/frame/1f/kernels/bli_axpyf_ref.c +++ b/ref_kernels/1f/bli_axpyf_ref.c @@ -36,9 +36,9 @@ #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conja, \ conj_t conjx, \ @@ -82,5 +82,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( axpyf_ref ) +INSERT_GENTFUNC_BASIC2( axpyf, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1f/kernels/bli_dotaxpyv_ref.c b/ref_kernels/1f/bli_dotaxpyv_ref.c similarity index 94% rename from frame/1f/kernels/bli_dotaxpyv_ref.c rename to ref_kernels/1f/bli_dotaxpyv_ref.c index bae1183c5..fde9cc476 100644 --- a/frame/1f/kernels/bli_dotaxpyv_ref.c +++ b/ref_kernels/1f/bli_dotaxpyv_ref.c @@ -36,9 +36,9 @@ #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjxt, \ conj_t conjx, \ @@ -84,5 +84,5 @@ void PASTEMAC(ch,varname) \ ); \ } -INSERT_GENTFUNC_BASIC0( dotaxpyv_ref ) +INSERT_GENTFUNC_BASIC2( dotaxpyv, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1f/kernels/bli_dotxaxpyf_ref_var2.c b/ref_kernels/1f/bli_dotxaxpyf_ref.c similarity index 94% rename from frame/1f/kernels/bli_dotxaxpyf_ref_var2.c rename to ref_kernels/1f/bli_dotxaxpyf_ref.c index f0123c94b..8fe184c4a 100644 --- a/frame/1f/kernels/bli_dotxaxpyf_ref_var2.c +++ b/ref_kernels/1f/bli_dotxaxpyf_ref.c @@ -36,9 +36,9 @@ #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjat, \ conj_t conja, \ @@ -93,5 +93,5 @@ void PASTEMAC(ch,varname) \ ); \ } -INSERT_GENTFUNC_BASIC0( dotxaxpyf_ref_var2 ) +INSERT_GENTFUNC_BASIC2( dotxaxpyf, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1f/kernels/bli_dotxf_ref.c b/ref_kernels/1f/bli_dotxf_ref.c similarity index 94% rename from frame/1f/kernels/bli_dotxf_ref.c rename to ref_kernels/1f/bli_dotxf_ref.c index 41866b87a..2a64045b3 100644 --- a/frame/1f/kernels/bli_dotxf_ref.c +++ b/ref_kernels/1f/bli_dotxf_ref.c @@ -36,9 +36,9 @@ #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ conj_t conjat, \ conj_t conjx, \ @@ -82,5 +82,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( dotxf_ref ) +INSERT_GENTFUNC_BASIC2( dotxf, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1f/kernels/bli_l1f_ref.h b/ref_kernels/1f/old/bli_l1f_ref.h similarity index 97% rename from frame/1f/kernels/bli_l1f_ref.h rename to ref_kernels/1f/old/bli_l1f_ref.h index 592465845..4b1d67d8f 100644 --- a/frame/1f/kernels/bli_l1f_ref.h +++ b/ref_kernels/1f/old/bli_l1f_ref.h @@ -47,7 +47,7 @@ #define dotxf_ker_name dotxf_ref #undef dotxaxpyf_ker_name -#define dotxaxpyf_ker_name dotxaxpyf_ref_var2 +#define dotxaxpyf_ker_name dotxaxpyf_ref // Include the level-1f kernel API template. diff --git a/frame/1f/kernels/other/bli_dotxaxpyf_ref_var1.c b/ref_kernels/1f/other/bli_dotxaxpyf_ref_alt.c similarity index 100% rename from frame/1f/kernels/other/bli_dotxaxpyf_ref_var1.c rename to ref_kernels/1f/other/bli_dotxaxpyf_ref_alt.c diff --git a/ref_kernels/1m/bli_packm_cxk_1er_ref.c b/ref_kernels/1m/bli_packm_cxk_1er_ref.c new file mode 100644 index 000000000..3c526506d --- /dev/null +++ b/ref_kernels/1m/bli_packm_cxk_1er_ref.c @@ -0,0 +1,2137 @@ +/* + + 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" + +#undef GENTFUNCCO +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ +\ +void PASTEMAC3(ch,opname,arch,suf) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ) \ +{ \ + if ( bli_is_1e_packed( schema ) ) \ + { \ + const inc_t inca1 = inca; \ + const inc_t lda1 = lda; \ + const inc_t ldp1 = ldp; \ +\ + ctype* restrict kappa_cast = ( ctype* )kappa; \ + ctype* restrict alpha1_ri = ( ctype* )a; \ + ctype* restrict pi1_ri = ( ctype* )p; \ + ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + } \ + else /* if ( bli_is_1r_packed( schema ) ) */ \ + { \ + const inc_t inca2 = 2 * inca; \ + const inc_t lda2 = 2 * lda; \ + const inc_t ldp2 = 2 * ldp; \ +\ + ctype* kappa_cast = kappa; \ + ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ + ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ + ctype_r* restrict alpha1_r = ( ctype_r* )a; \ + ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ + ctype_r* restrict pi1_r = ( ctype_r* )p; \ + ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + } \ +} + +INSERT_GENTFUNCCO_BASIC2( packm_2xk_1e, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) + + + +#undef GENTFUNCCO +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ +\ +void PASTEMAC3(ch,opname,arch,suf) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ) \ +{ \ + if ( bli_is_1e_packed( schema ) ) \ + { \ + const inc_t inca1 = inca; \ + const inc_t lda1 = lda; \ + const inc_t ldp1 = ldp; \ +\ + ctype* restrict kappa_cast = ( ctype* )kappa; \ + ctype* restrict alpha1_ri = ( ctype* )a; \ + ctype* restrict pi1_ri = ( ctype* )p; \ + ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + } \ + else /* if ( bli_is_1r_packed( schema ) ) */ \ + { \ + const inc_t inca2 = 2 * inca; \ + const inc_t lda2 = 2 * lda; \ + const inc_t ldp2 = 2 * ldp; \ +\ + ctype* kappa_cast = kappa; \ + ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ + ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ + ctype_r* restrict alpha1_r = ( ctype_r* )a; \ + ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ + ctype_r* restrict pi1_r = ( ctype_r* )p; \ + ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + } \ +} + +INSERT_GENTFUNCCO_BASIC2( packm_4xk_1e, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) + + + +#undef GENTFUNCCO +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ +\ +void PASTEMAC3(ch,opname,arch,suf) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ) \ +{ \ + if ( bli_is_1e_packed( schema ) ) \ + { \ + const inc_t inca1 = inca; \ + const inc_t lda1 = lda; \ + const inc_t ldp1 = ldp; \ +\ + ctype* restrict kappa_cast = ( ctype* )kappa; \ + ctype* restrict alpha1_ri = ( ctype* )a; \ + ctype* restrict pi1_ri = ( ctype* )p; \ + ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + } \ + else /* if ( bli_is_1r_packed( schema ) ) */ \ + { \ + const inc_t inca2 = 2 * inca; \ + const inc_t lda2 = 2 * lda; \ + const inc_t ldp2 = 2 * ldp; \ +\ + ctype* kappa_cast = kappa; \ + ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ + ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ + ctype_r* restrict alpha1_r = ( ctype_r* )a; \ + ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ + ctype_r* restrict pi1_r = ( ctype_r* )p; \ + ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + } \ +} + +INSERT_GENTFUNCCO_BASIC2( packm_6xk_1e, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) + + + +#undef GENTFUNCCO +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ +\ +void PASTEMAC3(ch,opname,arch,suf) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ) \ +{ \ + if ( bli_is_1e_packed( schema ) ) \ + { \ + const inc_t inca1 = inca; \ + const inc_t lda1 = lda; \ + const inc_t ldp1 = ldp; \ +\ + ctype* restrict kappa_cast = ( ctype* )kappa; \ + ctype* restrict alpha1_ri = ( ctype* )a; \ + ctype* restrict pi1_ri = ( ctype* )p; \ + ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + } \ + else /* if ( bli_is_1r_packed( schema ) ) */ \ + { \ + const inc_t inca2 = 2 * inca; \ + const inc_t lda2 = 2 * lda; \ + const inc_t ldp2 = 2 * ldp; \ +\ + ctype* kappa_cast = kappa; \ + ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ + ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ + ctype_r* restrict alpha1_r = ( ctype_r* )a; \ + ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ + ctype_r* restrict pi1_r = ( ctype_r* )p; \ + ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + } \ +} + +INSERT_GENTFUNCCO_BASIC2( packm_8xk_1e, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) + + + +#undef GENTFUNCCO +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ +\ +void PASTEMAC3(ch,opname,arch,suf) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ) \ +{ \ + if ( bli_is_1e_packed( schema ) ) \ + { \ + const inc_t inca1 = inca; \ + const inc_t lda1 = lda; \ + const inc_t ldp1 = ldp; \ +\ + ctype* restrict kappa_cast = ( ctype* )kappa; \ + ctype* restrict alpha1_ri = ( ctype* )a; \ + ctype* restrict pi1_ri = ( ctype* )p; \ + ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + } \ + else /* if ( bli_is_1r_packed( schema ) ) */ \ + { \ + const inc_t inca2 = 2 * inca; \ + const inc_t lda2 = 2 * lda; \ + const inc_t ldp2 = 2 * ldp; \ +\ + ctype* kappa_cast = kappa; \ + ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ + ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ + ctype_r* restrict alpha1_r = ( ctype_r* )a; \ + ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ + ctype_r* restrict pi1_r = ( ctype_r* )p; \ + ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + } \ +} + +INSERT_GENTFUNCCO_BASIC2( packm_10xk_1e, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) + + + +#undef GENTFUNCCO +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ +\ +void PASTEMAC3(ch,opname,arch,suf) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ) \ +{ \ + if ( bli_is_1e_packed( schema ) ) \ + { \ + const inc_t inca1 = inca; \ + const inc_t lda1 = lda; \ + const inc_t ldp1 = ldp; \ +\ + ctype* restrict kappa_cast = ( ctype* )kappa; \ + ctype* restrict alpha1_ri = ( ctype* )a; \ + ctype* restrict pi1_ri = ( ctype* )p; \ + ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + } \ + else /* if ( bli_is_1r_packed( schema ) ) */ \ + { \ + const inc_t inca2 = 2 * inca; \ + const inc_t lda2 = 2 * lda; \ + const inc_t ldp2 = 2 * ldp; \ +\ + ctype* kappa_cast = kappa; \ + ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ + ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ + ctype_r* restrict alpha1_r = ( ctype_r* )a; \ + ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ + ctype_r* restrict pi1_r = ( ctype_r* )p; \ + ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + } \ +} + +INSERT_GENTFUNCCO_BASIC2( packm_12xk_1e, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) + + + +#undef GENTFUNCCO +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ +\ +void PASTEMAC3(ch,opname,arch,suf) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ) \ +{ \ + if ( bli_is_1e_packed( schema ) ) \ + { \ + const inc_t inca1 = inca; \ + const inc_t lda1 = lda; \ + const inc_t ldp1 = ldp; \ +\ + ctype* restrict kappa_cast = ( ctype* )kappa; \ + ctype* restrict alpha1_ri = ( ctype* )a; \ + ctype* restrict pi1_ri = ( ctype* )p; \ + ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + } \ + else /* if ( bli_is_1r_packed( schema ) ) */ \ + { \ + const inc_t inca2 = 2 * inca; \ + const inc_t lda2 = 2 * lda; \ + const inc_t ldp2 = 2 * ldp; \ +\ + ctype* kappa_cast = kappa; \ + ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ + ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ + ctype_r* restrict alpha1_r = ( ctype_r* )a; \ + ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ + ctype_r* restrict pi1_r = ( ctype_r* )p; \ + ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + } \ +} + +INSERT_GENTFUNCCO_BASIC2( packm_14xk_1e, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) + + + +#undef GENTFUNCCO +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ +\ +void PASTEMAC3(ch,opname,arch,suf) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ) \ +{ \ + if ( bli_is_1e_packed( schema ) ) \ + { \ + const inc_t inca1 = inca; \ + const inc_t lda1 = lda; \ + const inc_t ldp1 = ldp; \ +\ + ctype* restrict kappa_cast = ( ctype* )kappa; \ + ctype* restrict alpha1_ri = ( ctype* )a; \ + ctype* restrict pi1_ri = ( ctype* )p; \ + ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + } \ + else /* if ( bli_is_1r_packed( schema ) ) */ \ + { \ + const inc_t inca2 = 2 * inca; \ + const inc_t lda2 = 2 * lda; \ + const inc_t ldp2 = 2 * ldp; \ +\ + ctype* kappa_cast = kappa; \ + ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ + ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ + ctype_r* restrict alpha1_r = ( ctype_r* )a; \ + ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ + ctype_r* restrict pi1_r = ( ctype_r* )p; \ + ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + } \ +} + +INSERT_GENTFUNCCO_BASIC2( packm_16xk_1e, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) + + + +#undef GENTFUNCCO +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ +\ +void PASTEMAC3(ch,opname,arch,suf) \ + ( \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ + ) \ +{ \ + if ( bli_is_1e_packed( schema ) ) \ + { \ + const inc_t inca1 = inca; \ + const inc_t lda1 = lda; \ + const inc_t ldp1 = ldp; \ +\ + ctype* restrict kappa_cast = ( ctype* )kappa; \ + ctype* restrict alpha1_ri = ( ctype* )a; \ + ctype* restrict pi1_ri = ( ctype* )p; \ + ctype* restrict pi1_ir = ( ctype* )p + ldp1/2; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +16*inca1), *(pi1_ri +16), *(pi1_ir +16) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +17*inca1), *(pi1_ri +17), *(pi1_ir +17) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +18*inca1), *(pi1_ri +18), *(pi1_ir +18) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +19*inca1), *(pi1_ri +19), *(pi1_ir +19) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +20*inca1), *(pi1_ri +20), *(pi1_ir +20) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +21*inca1), *(pi1_ri +21), *(pi1_ir +21) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +22*inca1), *(pi1_ri +22), *(pi1_ir +22) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +23*inca1), *(pi1_ri +23), *(pi1_ir +23) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +24*inca1), *(pi1_ri +24), *(pi1_ir +24) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +25*inca1), *(pi1_ri +25), *(pi1_ir +25) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +26*inca1), *(pi1_ri +26), *(pi1_ir +26) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +27*inca1), *(pi1_ri +27), *(pi1_ir +27) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +28*inca1), *(pi1_ri +28), *(pi1_ir +28) ); \ + PASTEMAC(ch,copyj1es)( *(alpha1_ri +29*inca1), *(pi1_ri +29), *(pi1_ir +29) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +16*inca1), *(pi1_ri +16), *(pi1_ir +16) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +17*inca1), *(pi1_ri +17), *(pi1_ir +17) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +18*inca1), *(pi1_ri +18), *(pi1_ir +18) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +19*inca1), *(pi1_ri +19), *(pi1_ir +19) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +20*inca1), *(pi1_ri +20), *(pi1_ir +20) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +21*inca1), *(pi1_ri +21), *(pi1_ir +21) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +22*inca1), *(pi1_ri +22), *(pi1_ir +22) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +23*inca1), *(pi1_ri +23), *(pi1_ir +23) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +24*inca1), *(pi1_ri +24), *(pi1_ir +24) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +25*inca1), *(pi1_ri +25), *(pi1_ir +25) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +26*inca1), *(pi1_ri +26), *(pi1_ir +26) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +27*inca1), *(pi1_ri +27), *(pi1_ir +27) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +28*inca1), *(pi1_ri +28), *(pi1_ir +28) ); \ + PASTEMAC(ch,copy1es)( *(alpha1_ri +29*inca1), *(pi1_ri +29), *(pi1_ir +29) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +16*inca1), *(pi1_ri +16), *(pi1_ir +16) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +17*inca1), *(pi1_ri +17), *(pi1_ir +17) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +18*inca1), *(pi1_ri +18), *(pi1_ir +18) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +19*inca1), *(pi1_ri +19), *(pi1_ir +19) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +20*inca1), *(pi1_ri +20), *(pi1_ir +20) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +21*inca1), *(pi1_ri +21), *(pi1_ir +21) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +22*inca1), *(pi1_ri +22), *(pi1_ir +22) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +23*inca1), *(pi1_ri +23), *(pi1_ir +23) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +24*inca1), *(pi1_ri +24), *(pi1_ir +24) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +25*inca1), *(pi1_ri +25), *(pi1_ir +25) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +26*inca1), *(pi1_ri +26), *(pi1_ir +26) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +27*inca1), *(pi1_ri +27), *(pi1_ir +27) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +28*inca1), *(pi1_ri +28), *(pi1_ir +28) ); \ + PASTEMAC(ch,scal2j1es)( *kappa_cast, *(alpha1_ri +29*inca1), *(pi1_ri +29), *(pi1_ir +29) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 0*inca1), *(pi1_ri + 0), *(pi1_ir + 0) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 1*inca1), *(pi1_ri + 1), *(pi1_ir + 1) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 2*inca1), *(pi1_ri + 2), *(pi1_ir + 2) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 3*inca1), *(pi1_ri + 3), *(pi1_ir + 3) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 4*inca1), *(pi1_ri + 4), *(pi1_ir + 4) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 5*inca1), *(pi1_ri + 5), *(pi1_ir + 5) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 6*inca1), *(pi1_ri + 6), *(pi1_ir + 6) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 7*inca1), *(pi1_ri + 7), *(pi1_ir + 7) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 8*inca1), *(pi1_ri + 8), *(pi1_ir + 8) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri + 9*inca1), *(pi1_ri + 9), *(pi1_ir + 9) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +10*inca1), *(pi1_ri +10), *(pi1_ir +10) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +11*inca1), *(pi1_ri +11), *(pi1_ir +11) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +12*inca1), *(pi1_ri +12), *(pi1_ir +12) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +13*inca1), *(pi1_ri +13), *(pi1_ir +13) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +14*inca1), *(pi1_ri +14), *(pi1_ir +14) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +15*inca1), *(pi1_ri +15), *(pi1_ir +15) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +16*inca1), *(pi1_ri +16), *(pi1_ir +16) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +17*inca1), *(pi1_ri +17), *(pi1_ir +17) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +18*inca1), *(pi1_ri +18), *(pi1_ir +18) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +19*inca1), *(pi1_ri +19), *(pi1_ir +19) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +20*inca1), *(pi1_ri +20), *(pi1_ir +20) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +21*inca1), *(pi1_ri +21), *(pi1_ir +21) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +22*inca1), *(pi1_ri +22), *(pi1_ir +22) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +23*inca1), *(pi1_ri +23), *(pi1_ir +23) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +24*inca1), *(pi1_ri +24), *(pi1_ir +24) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +25*inca1), *(pi1_ri +25), *(pi1_ir +25) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +26*inca1), *(pi1_ri +26), *(pi1_ir +26) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +27*inca1), *(pi1_ri +27), *(pi1_ir +27) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +28*inca1), *(pi1_ri +28), *(pi1_ir +28) ); \ + PASTEMAC(ch,scal21es)( *kappa_cast, *(alpha1_ri +29*inca1), *(pi1_ri +29), *(pi1_ir +29) ); \ +\ + alpha1_ri += lda1; \ + pi1_ri += ldp1; \ + pi1_ir += ldp1; \ + } \ + } \ + } \ + } \ + else /* if ( bli_is_1r_packed( schema ) ) */ \ + { \ + const inc_t inca2 = 2 * inca; \ + const inc_t lda2 = 2 * lda; \ + const inc_t ldp2 = 2 * ldp; \ +\ + ctype* kappa_cast = kappa; \ + ctype_r* restrict kappa_r = ( ctype_r* )kappa; \ + ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \ + ctype_r* restrict alpha1_r = ( ctype_r* )a; \ + ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \ + ctype_r* restrict pi1_r = ( ctype_r* )p; \ + ctype_r* restrict pi1_i = ( ctype_r* )p + ldp; \ +\ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \ + PASTEMAC(ch,copyjris)( *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \ + PASTEMAC(ch,copyris)( *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + else \ + { \ + if ( bli_is_conj( conja ) ) \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \ + PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + else \ + { \ + for ( ; n != 0; --n ) \ + { \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \ + PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \ +\ + alpha1_r += lda2; \ + alpha1_i += lda2; \ + pi1_r += ldp2; \ + pi1_i += ldp2; \ + } \ + } \ + } \ + } \ +} + +INSERT_GENTFUNCCO_BASIC2( packm_30xk_1e, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) + diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_3mis_ref.c b/ref_kernels/1m/bli_packm_cxk_3mis_ref.c similarity index 94% rename from frame/1m/packm/ukernels/bli_packm_cxk_3mis_ref.c rename to ref_kernels/1m/bli_packm_cxk_3mis_ref.c index 004acaa60..dd28c25fc 100644 --- a/frame/1m/packm/ukernels/bli_packm_cxk_3mis_ref.c +++ b/ref_kernels/1m/bli_packm_cxk_3mis_ref.c @@ -35,15 +35,16 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -122,20 +123,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_2xk_3mis_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_2xk_3mis, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -222,20 +224,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_4xk_3mis_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_4xk_3mis, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -330,20 +333,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_6xk_3mis_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_6xk_3mis, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -446,20 +450,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_8xk_3mis_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_8xk_3mis, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -570,20 +575,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_10xk_3mis_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_10xk_3mis, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -702,20 +708,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_12xk_3mis_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_12xk_3mis, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -842,20 +849,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_14xk_3mis_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_14xk_3mis, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -990,20 +998,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_16xk_3mis_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_16xk_3mis, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -1195,5 +1204,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_30xk_3mis_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_30xk_3mis, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_4mi_ref.c b/ref_kernels/1m/bli_packm_cxk_4mi_ref.c similarity index 94% rename from frame/1m/packm/ukernels/bli_packm_cxk_4mi_ref.c rename to ref_kernels/1m/bli_packm_cxk_4mi_ref.c index 2279fdeca..b66f4491b 100644 --- a/frame/1m/packm/ukernels/bli_packm_cxk_4mi_ref.c +++ b/ref_kernels/1m/bli_packm_cxk_4mi_ref.c @@ -35,15 +35,16 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -117,20 +118,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_2xk_4mi_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_2xk_4mi, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -212,20 +214,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_4xk_4mi_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_4xk_4mi, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -315,20 +318,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_6xk_4mi_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_6xk_4mi, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -426,20 +430,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_8xk_4mi_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_8xk_4mi, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -545,20 +550,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_10xk_4mi_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_10xk_4mi, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -672,20 +678,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_12xk_4mi_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_12xk_4mi, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -807,20 +814,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_14xk_4mi_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_14xk_4mi, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -950,20 +958,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_16xk_4mi_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_16xk_4mi, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t is_p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t is_p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -1149,5 +1158,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_30xk_4mi_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_30xk_4mi, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_ref.c b/ref_kernels/1m/bli_packm_cxk_ref.c similarity index 92% rename from frame/1m/packm/ukernels/bli_packm_cxk_ref.c rename to ref_kernels/1m/bli_packm_cxk_ref.c index c3dbb8d5c..298bbd410 100644 --- a/frame/1m/packm/ukernels/bli_packm_cxk_ref.c +++ b/ref_kernels/1m/bli_packm_cxk_ref.c @@ -35,15 +35,16 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -123,20 +124,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_2xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_2xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -224,20 +226,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_3xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_3xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -323,20 +326,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_4xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_4xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -411,20 +415,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_6xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_6xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -534,20 +539,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_8xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_8xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -638,20 +644,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_10xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_10xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -750,20 +757,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_12xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_12xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -870,20 +878,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_14xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_14xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -998,20 +1007,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_16xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_16xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -1158,20 +1168,21 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_24xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_24xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ ctype* restrict kappa_cast = kappa; \ @@ -1342,5 +1353,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( packm_30xk_ref ) +INSERT_GENTFUNC_BASIC2( packm_30xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_rih_ref.c b/ref_kernels/1m/bli_packm_cxk_rih_ref.c similarity index 96% rename from frame/1m/packm/ukernels/bli_packm_cxk_rih_ref.c rename to ref_kernels/1m/bli_packm_cxk_rih_ref.c index 3f3634aee..75ed9471b 100644 --- a/frame/1m/packm/ukernels/bli_packm_cxk_rih_ref.c +++ b/ref_kernels/1m/bli_packm_cxk_rih_ref.c @@ -35,16 +35,17 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -210,21 +211,22 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_2xk_rih_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_2xk_rih, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -412,21 +414,22 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_4xk_rih_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_4xk_rih, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -636,21 +639,22 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_6xk_rih_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_6xk_rih, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -882,21 +886,22 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_8xk_rih_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_8xk_rih, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -1150,21 +1155,22 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_10xk_rih_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_10xk_rih, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -1440,21 +1446,22 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_12xk_rih_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_12xk_rih, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -1752,21 +1759,22 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_14xk_rih_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_14xk_rih, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -2086,21 +2094,22 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_16xk_rih_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_16xk_rih, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conja, \ - pack_t schema, \ - dim_t n, \ - void* restrict kappa, \ - void* restrict a, inc_t inca, inc_t lda, \ - void* restrict p, inc_t ldp \ + conj_t conja, \ + pack_t schema, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict a, inc_t inca, inc_t lda, \ + void* restrict p, inc_t ldp, \ + cntx_t* restrict cntx \ ) \ { \ const inc_t inca2 = 2 * inca; \ @@ -2574,5 +2583,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( packm_30xk_rih_ref ) +INSERT_GENTFUNCCO_BASIC2( packm_30xk_rih, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1m/unpackm/ukernels/bli_unpackm_cxk_ref.c b/ref_kernels/1m/bli_unpackm_cxk_ref.c similarity index 52% rename from frame/1m/unpackm/ukernels/bli_unpackm_cxk_ref.c rename to ref_kernels/1m/bli_unpackm_cxk_ref.c index fe88aaece..619e62694 100644 --- a/frame/1m/unpackm/ukernels/bli_unpackm_cxk_ref.c +++ b/ref_kernels/1m/bli_unpackm_cxk_ref.c @@ -35,24 +35,23 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conjp, \ - dim_t n, \ - void* beta, \ - void* p, \ - void* a, inc_t inca, inc_t lda \ + conj_t conjp, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict p, inc_t ldp, \ + void* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ ) \ { \ - const inc_t ldp = 2; \ + ctype* restrict kappa_cast = kappa; \ + ctype* restrict pi1 = p; \ + ctype* restrict alpha1 = a; \ \ - ctype* restrict beta_cast = beta; \ - ctype* restrict pi1 = p; \ - ctype* restrict alpha1 = a; \ -\ - if ( PASTEMAC(ch,eq1)( *beta_cast ) ) \ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ { \ if ( bli_is_conj( conjp ) ) \ { \ @@ -83,8 +82,8 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -94,8 +93,8 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -104,30 +103,29 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( unpackm_2xk_ref ) +INSERT_GENTFUNC_BASIC2( unpackm_2xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conjp, \ - dim_t n, \ - void* beta, \ - void* p, \ - void* a, inc_t inca, inc_t lda \ + conj_t conjp, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict p, inc_t ldp, \ + void* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ ) \ { \ - const inc_t ldp = 4; \ + ctype* restrict kappa_cast = kappa; \ + ctype* restrict pi1 = p; \ + ctype* restrict alpha1 = a; \ \ - ctype* restrict beta_cast = beta; \ - ctype* restrict pi1 = p; \ - ctype* restrict alpha1 = a; \ -\ - if ( PASTEMAC(ch,eq1)( *beta_cast ) ) \ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ { \ if ( bli_is_conj( conjp ) ) \ { \ @@ -162,10 +160,10 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -175,10 +173,10 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -187,30 +185,29 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( unpackm_4xk_ref ) +INSERT_GENTFUNC_BASIC2( unpackm_4xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conjp, \ - dim_t n, \ - void* beta, \ - void* p, \ - void* a, inc_t inca, inc_t lda \ + conj_t conjp, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict p, inc_t ldp, \ + void* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ ) \ { \ - const inc_t ldp = 6; \ + ctype* restrict kappa_cast = kappa; \ + ctype* restrict pi1 = p; \ + ctype* restrict alpha1 = a; \ \ - ctype* restrict beta_cast = beta; \ - ctype* restrict pi1 = p; \ - ctype* restrict alpha1 = a; \ -\ - if ( PASTEMAC(ch,eq1)( *beta_cast ) ) \ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ { \ if ( bli_is_conj( conjp ) ) \ { \ @@ -249,12 +246,12 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -264,12 +261,12 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -278,30 +275,29 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( unpackm_6xk_ref ) +INSERT_GENTFUNC_BASIC2( unpackm_6xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conjp, \ - dim_t n, \ - void* beta, \ - void* p, \ - void* a, inc_t inca, inc_t lda \ + conj_t conjp, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict p, inc_t ldp, \ + void* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ ) \ { \ - const inc_t ldp = 8; \ + ctype* restrict kappa_cast = kappa; \ + ctype* restrict pi1 = p; \ + ctype* restrict alpha1 = a; \ \ - ctype* restrict beta_cast = beta; \ - ctype* restrict pi1 = p; \ - ctype* restrict alpha1 = a; \ -\ - if ( PASTEMAC(ch,eq1)( *beta_cast ) ) \ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ { \ if ( bli_is_conj( conjp ) ) \ { \ @@ -344,14 +340,14 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -361,14 +357,14 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -377,30 +373,29 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( unpackm_8xk_ref ) +INSERT_GENTFUNC_BASIC2( unpackm_8xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conjp, \ - dim_t n, \ - void* beta, \ - void* p, \ - void* a, inc_t inca, inc_t lda \ + conj_t conjp, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict p, inc_t ldp, \ + void* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ ) \ { \ - const inc_t ldp = 10; \ + ctype* restrict kappa_cast = kappa; \ + ctype* restrict pi1 = p; \ + ctype* restrict alpha1 = a; \ \ - ctype* restrict beta_cast = beta; \ - ctype* restrict pi1 = p; \ - ctype* restrict alpha1 = a; \ -\ - if ( PASTEMAC(ch,eq1)( *beta_cast ) ) \ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ { \ if ( bli_is_conj( conjp ) ) \ { \ @@ -447,16 +442,16 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -466,16 +461,16 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -484,30 +479,29 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( unpackm_10xk_ref ) +INSERT_GENTFUNC_BASIC2( unpackm_10xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conjp, \ - dim_t n, \ - void* beta, \ - void* p, \ - void* a, inc_t inca, inc_t lda \ + conj_t conjp, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict p, inc_t ldp, \ + void* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ ) \ { \ - const inc_t ldp = 12; \ + ctype* restrict kappa_cast = kappa; \ + ctype* restrict pi1 = p; \ + ctype* restrict alpha1 = a; \ \ - ctype* restrict beta_cast = beta; \ - ctype* restrict pi1 = p; \ - ctype* restrict alpha1 = a; \ -\ - if ( PASTEMAC(ch,eq1)( *beta_cast ) ) \ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ { \ if ( bli_is_conj( conjp ) ) \ { \ @@ -558,18 +552,18 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -579,18 +573,18 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -599,30 +593,29 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( unpackm_12xk_ref ) +INSERT_GENTFUNC_BASIC2( unpackm_12xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conjp, \ - dim_t n, \ - void* beta, \ - void* p, \ - void* a, inc_t inca, inc_t lda \ + conj_t conjp, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict p, inc_t ldp, \ + void* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ ) \ { \ - const inc_t ldp = 14; \ + ctype* restrict kappa_cast = kappa; \ + ctype* restrict pi1 = p; \ + ctype* restrict alpha1 = a; \ \ - ctype* restrict beta_cast = beta; \ - ctype* restrict pi1 = p; \ - ctype* restrict alpha1 = a; \ -\ - if ( PASTEMAC(ch,eq1)( *beta_cast ) ) \ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ { \ if ( bli_is_conj( conjp ) ) \ { \ @@ -677,20 +670,20 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 12), *(alpha1 + 12*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 13), *(alpha1 + 13*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 12), *(alpha1 + 12*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 13), *(alpha1 + 13*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -700,20 +693,20 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 12), *(alpha1 + 12*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 13), *(alpha1 + 13*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 12), *(alpha1 + 12*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 13), *(alpha1 + 13*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -722,30 +715,29 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( unpackm_14xk_ref ) +INSERT_GENTFUNC_BASIC2( unpackm_14xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conjp, \ - dim_t n, \ - void* beta, \ - void* p, \ - void* a, inc_t inca, inc_t lda \ + conj_t conjp, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict p, inc_t ldp, \ + void* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ ) \ { \ - const inc_t ldp = 16; \ + ctype* restrict kappa_cast = kappa; \ + ctype* restrict pi1 = p; \ + ctype* restrict alpha1 = a; \ \ - ctype* restrict beta_cast = beta; \ - ctype* restrict pi1 = p; \ - ctype* restrict alpha1 = a; \ -\ - if ( PASTEMAC(ch,eq1)( *beta_cast ) ) \ + if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \ { \ if ( bli_is_conj( conjp ) ) \ { \ @@ -804,22 +796,22 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 12), *(alpha1 + 12*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 13), *(alpha1 + 13*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 14), *(alpha1 + 14*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2js)( *beta_cast, *(pi1 + 15), *(alpha1 + 15*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 12), *(alpha1 + 12*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 13), *(alpha1 + 13*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 14), *(alpha1 + 14*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2js)( *kappa_cast, *(pi1 + 15), *(alpha1 + 15*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -829,22 +821,22 @@ void PASTEMAC(ch,varname) \ { \ for ( ; n != 0; --n ) \ { \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 12), *(alpha1 + 12*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 13), *(alpha1 + 13*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 14), *(alpha1 + 14*inca) ); \ - PASTEMAC3(ch,ch,ch,scal2s)( *beta_cast, *(pi1 + 15), *(alpha1 + 15*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 0), *(alpha1 + 0*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 1), *(alpha1 + 1*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 2), *(alpha1 + 2*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 3), *(alpha1 + 3*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 4), *(alpha1 + 4*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 5), *(alpha1 + 5*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 6), *(alpha1 + 6*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 7), *(alpha1 + 7*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 8), *(alpha1 + 8*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 9), *(alpha1 + 9*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 10), *(alpha1 + 10*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 11), *(alpha1 + 11*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 12), *(alpha1 + 12*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 13), *(alpha1 + 13*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 14), *(alpha1 + 14*inca) ); \ + PASTEMAC3(ch,ch,ch,scal2s)( *kappa_cast, *(pi1 + 15), *(alpha1 + 15*inca) ); \ \ pi1 += ldp; \ alpha1 += lda; \ @@ -853,5 +845,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( unpackm_16xk_ref ) +INSERT_GENTFUNC_BASIC2( unpackm_16xk, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_1e_ref.h b/ref_kernels/1m/old/bli_packm_cxk_1er_ref.h similarity index 69% rename from frame/1m/packm/ukernels/bli_packm_cxk_1e_ref.h rename to ref_kernels/1m/old/bli_packm_cxk_1er_ref.h index beebdafdc..f8d051af2 100644 --- a/frame/1m/packm/ukernels/bli_packm_cxk_1e_ref.h +++ b/ref_kernels/1m/old/bli_packm_cxk_1er_ref.h @@ -34,27 +34,27 @@ // Redefine level-1m kernel API names to induce prototypes. -#undef packm_2xk_ker_name -#define packm_2xk_ker_name packm_2xk_1e_ref +#undef packm_2xk_1er_ker_name +#define packm_2xk_1er_ker_name packm_2xk_1er_ref // 1e format should probably never have an odd-numbered register blocking. -//#undef packm_3xk_ker_name -//#define packm_3xk_ker_name packm_3xk_1e_ref -#undef packm_4xk_ker_name -#define packm_4xk_ker_name packm_4xk_1e_ref -#undef packm_6xk_ker_name -#define packm_6xk_ker_name packm_6xk_1e_ref -#undef packm_8xk_ker_name -#define packm_8xk_ker_name packm_8xk_1e_ref -#undef packm_10xk_ker_name -#define packm_10xk_ker_name packm_10xk_1e_ref -#undef packm_12xk_ker_name -#define packm_12xk_ker_name packm_12xk_1e_ref -#undef packm_14xk_ker_name -#define packm_14xk_ker_name packm_14xk_1e_ref -#undef packm_16xk_ker_name -#define packm_16xk_ker_name packm_16xk_1e_ref -#undef packm_30xk_ker_name -#define packm_30xk_ker_name packm_30xk_1e_ref +//#undef packm_3xk_1er_ker_name +//#define packm_3xk_1er_ker_name packm_3xk_1e_ref +#undef packm_4xk_1er_ker_name +#define packm_4xk_1er_ker_name packm_4xk_1er_ref +#undef packm_6xk_1er_ker_name +#define packm_6xk_1er_ker_name packm_6xk_1er_ref +#undef packm_8xk_1er_ker_name +#define packm_8xk_1er_ker_name packm_8xk_1er_ref +#undef packm_10xk_1er_ker_name +#define packm_10xk_1er_ker_name packm_10xk_1er_ref +#undef packm_12xk_1er_ker_name +#define packm_12xk_1er_ker_name packm_12xk_1er_ref +#undef packm_14xk_1er_ker_name +#define packm_14xk_1er_ker_name packm_14xk_1er_ref +#undef packm_16xk_1er_ker_name +#define packm_16xk_1er_ker_name packm_16xk_1er_ref +#undef packm_30xk_1er_ker_name +#define packm_30xk_1er_ker_name packm_30xk_1er_ref // Include the level-1m kernel API template. diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_3mis_ref.h b/ref_kernels/1m/old/bli_packm_cxk_3mis_ref.h similarity index 100% rename from frame/1m/packm/ukernels/bli_packm_cxk_3mis_ref.h rename to ref_kernels/1m/old/bli_packm_cxk_3mis_ref.h diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_4mi_ref.h b/ref_kernels/1m/old/bli_packm_cxk_4mi_ref.h similarity index 100% rename from frame/1m/packm/ukernels/bli_packm_cxk_4mi_ref.h rename to ref_kernels/1m/old/bli_packm_cxk_4mi_ref.h diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_ref.h b/ref_kernels/1m/old/bli_packm_cxk_ref.h similarity index 100% rename from frame/1m/packm/ukernels/bli_packm_cxk_ref.h rename to ref_kernels/1m/old/bli_packm_cxk_ref.h diff --git a/frame/1m/packm/ukernels/bli_packm_cxk_rih_ref.h b/ref_kernels/1m/old/bli_packm_cxk_rih_ref.h similarity index 100% rename from frame/1m/packm/ukernels/bli_packm_cxk_rih_ref.h rename to ref_kernels/1m/old/bli_packm_cxk_rih_ref.h diff --git a/frame/1m/unpackm/ukernels/bli_unpackm_cxk_ref.h b/ref_kernels/1m/old/bli_unpackm_cxk_ref.h similarity index 64% rename from frame/1m/unpackm/ukernels/bli_unpackm_cxk_ref.h rename to ref_kernels/1m/old/bli_unpackm_cxk_ref.h index 8756747ff..92cbb122d 100644 --- a/frame/1m/unpackm/ukernels/bli_unpackm_cxk_ref.h +++ b/ref_kernels/1m/old/bli_unpackm_cxk_ref.h @@ -33,23 +33,24 @@ */ #undef GENTPROT -#define GENTPROT( ctype, ch, varname ) \ +#define GENTPROT( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ - conj_t conjp, \ - dim_t n, \ - void* beta, \ - void* p, \ - void* a, inc_t inca, inc_t lda \ + conj_t conjp, \ + dim_t n, \ + void* restrict kappa, \ + void* restrict p, inc_t ldp, \ + void* restrict a, inc_t inca, inc_t lda, \ + cntx_t* restrict cntx \ ); -INSERT_GENTPROT_BASIC( unpackm_2xk_ref ) -INSERT_GENTPROT_BASIC( unpackm_4xk_ref ) -INSERT_GENTPROT_BASIC( unpackm_6xk_ref ) -INSERT_GENTPROT_BASIC( unpackm_8xk_ref ) -INSERT_GENTPROT_BASIC( unpackm_10xk_ref ) -INSERT_GENTPROT_BASIC( unpackm_12xk_ref ) -INSERT_GENTPROT_BASIC( unpackm_14xk_ref ) -INSERT_GENTPROT_BASIC( unpackm_16xk_ref ) +INSERT_GENTPROT_BASIC2( unpackm_2xk_ref, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) +INSERT_GENTPROT_BASIC2( unpackm_4xk_ref, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) +INSERT_GENTPROT_BASIC2( unpackm_6xk_ref, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) +INSERT_GENTPROT_BASIC2( unpackm_8xk_ref, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) +INSERT_GENTPROT_BASIC2( unpackm_10xk_ref, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) +INSERT_GENTPROT_BASIC2( unpackm_12xk_ref, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) +INSERT_GENTPROT_BASIC2( unpackm_14xk_ref, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) +INSERT_GENTPROT_BASIC2( unpackm_16xk_ref, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/3/ukernels/bli_gemm_ukr_ref.c b/ref_kernels/3/bli_gemm_ref.c similarity index 96% rename from frame/3/ukernels/bli_gemm_ukr_ref.c rename to ref_kernels/3/bli_gemm_ref.c index 6486478f7..d81a1ec9a 100644 --- a/frame/3/ukernels/bli_gemm_ukr_ref.c +++ b/ref_kernels/3/bli_gemm_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -132,5 +132,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( gemm_ukr_ref ) +INSERT_GENTFUNC_BASIC2( gemm, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/3/ukernels/bli_gemmtrsm_ukr_ref.c b/ref_kernels/3/bli_gemmtrsm_ref.c similarity index 89% rename from frame/3/ukernels/bli_gemmtrsm_ukr_ref.c rename to ref_kernels/3/bli_gemmtrsm_ref.c index 3f7a94d14..3657a2092 100644 --- a/frame/3/ukernels/bli_gemmtrsm_ukr_ref.c +++ b/ref_kernels/3/bli_gemmtrsm_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname, gemmkerid, trsmkerid ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf, trsmkerid ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -60,7 +60,7 @@ void PASTEMAC(ch,varname) \ ctype* minus_one = PASTEMAC(ch,m1); \ \ PASTECH(ch,gemm_ukr_ft) \ - gemm_ukr = bli_cntx_get_l3_ukr_dt( dt, gemmkerid, cntx ); \ + gemm_ukr = bli_cntx_get_l3_ukr_dt( dt, BLIS_GEMM_UKR, cntx ); \ PASTECH(ch,trsm_ukr_ft) \ trsm_ukr = bli_cntx_get_l3_ukr_dt( dt, trsmkerid, cntx ); \ \ @@ -97,6 +97,6 @@ PASTEMAC(d,fprintm)( stdout, "gemmtrsm_ukr: b0111p_i after", k+3, 8, \ */ \ } -INSERT_GENTFUNC_BASIC2( gemmtrsm_l_ukr_ref, BLIS_GEMM_UKR, BLIS_TRSM_L_UKR ) -INSERT_GENTFUNC_BASIC2( gemmtrsm_u_ukr_ref, BLIS_GEMM_UKR, BLIS_TRSM_U_UKR ) +INSERT_GENTFUNC_BASIC3( gemmtrsm_l, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX, BLIS_TRSM_L_UKR ) +INSERT_GENTFUNC_BASIC3( gemmtrsm_u, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX, BLIS_TRSM_U_UKR ) diff --git a/frame/3/ukernels/bli_trsm_ukr_ref.c b/ref_kernels/3/bli_trsm_ref.c similarity index 95% rename from frame/3/ukernels/bli_trsm_ukr_ref.c rename to ref_kernels/3/bli_trsm_ref.c index a49299664..1d2735773 100644 --- a/frame/3/ukernels/bli_trsm_ukr_ref.c +++ b/ref_kernels/3/bli_trsm_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ ctype* restrict a, \ ctype* restrict b, \ @@ -113,13 +113,13 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( trsm_l_ukr_ref ) +INSERT_GENTFUNC_BASIC2( trsm_l, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNC -#define GENTFUNC( ctype, ch, varname ) \ +#define GENTFUNC( ctype, ch, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ ctype* restrict a, \ ctype* restrict b, \ @@ -195,5 +195,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNC_BASIC0( trsm_u_ukr_ref ) +INSERT_GENTFUNC_BASIC2( trsm_u, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/3/ukernels/bli_l3_ukr_ref.h b/ref_kernels/3/old/bli_l3_ref.h similarity index 89% rename from frame/3/ukernels/bli_l3_ukr_ref.h rename to ref_kernels/3/old/bli_l3_ref.h index 688caa928..b7a1f0098 100644 --- a/frame/3/ukernels/bli_l3_ukr_ref.h +++ b/ref_kernels/3/old/bli_l3_ref.h @@ -35,17 +35,17 @@ // Redefine level-3 micro-kernel API names to induce prototypes. #undef gemm_ukr_name -#define gemm_ukr_name gemm_ukr_ref +#define gemm_ukr_name gemm_ref #undef gemmtrsm_l_ukr_name -#define gemmtrsm_l_ukr_name gemmtrsm_l_ukr_ref +#define gemmtrsm_l_ukr_name gemmtrsm_l_ref #undef gemmtrsm_u_ukr_name -#define gemmtrsm_u_ukr_name gemmtrsm_u_ukr_ref +#define gemmtrsm_u_ukr_name gemmtrsm_u_ref #undef trsm_l_ukr_name -#define trsm_l_ukr_name trsm_l_ukr_ref +#define trsm_l_ukr_name trsm_l_ref #undef trsm_u_ukr_name -#define trsm_u_ukr_name trsm_u_ukr_ref +#define trsm_u_ukr_name trsm_u_ref // Include the micro-kernel API template. diff --git a/ref_kernels/bli_cntx_ref.c b/ref_kernels/bli_cntx_ref.c new file mode 100644 index 000000000..2f4e5ea9a --- /dev/null +++ b/ref_kernels/bli_cntx_ref.c @@ -0,0 +1,816 @@ +/* + + 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" + +// -- Instantiate kernel prototypes for the current architecture --------------- + +// Define macros to construct the full symbol name from the operation name. +#undef GENARNAME // architecture, _ref (no bli_) +#define GENARNAME(opname) PASTECH2(opname,BLIS_CNAME_INFIX,BLIS_REF_SUFFIX) +#undef GENBARNAME // bli_, architecture, _ref +#define GENBARNAME(opname) PASTEMAC2(opname,BLIS_CNAME_INFIX,BLIS_REF_SUFFIX) +#undef GENBAINAME // bli_, architecture, _ind +#define GENBAINAME(opname) PASTEMAC2(opname,BLIS_CNAME_INFIX,BLIS_IND_SUFFIX) + +// -- Level-3 native micro-kernel prototype redefinitions ---------------------- + +#undef gemm_ukr_name +#define gemm_ukr_name GENARNAME(gemm) +#undef gemmtrsm_l_ukr_name +#define gemmtrsm_l_ukr_name GENARNAME(gemmtrsm_l) +#undef gemmtrsm_u_ukr_name +#define gemmtrsm_u_ukr_name GENARNAME(gemmtrsm_u) +#undef trsm_l_ukr_name +#define trsm_l_ukr_name GENARNAME(trsm_l) +#undef trsm_u_ukr_name +#define trsm_u_ukr_name GENARNAME(trsm_u) + +// Include the native micro-kernel API template. +#include "bli_l3_ukr.h" + +// -- Level-3 virtual micro-kernel prototype redefinitions --------------------- + +// -- 3mh -- + +#undef gemm3mh_ukr_name +#define gemm3mh_ukr_name GENARNAME(gemm3mh) + +// -- 3m1 -- + +#undef gemm3m1_ukr_name +#define gemm3m1_ukr_name GENARNAME(gemm3m1) +#undef gemmtrsm3m1_l_ukr_name +#define gemmtrsm3m1_l_ukr_name GENARNAME(gemmtrsm3m1_l) +#undef gemmtrsm3m1_u_ukr_name +#define gemmtrsm3m1_u_ukr_name GENARNAME(gemmtrsm3m1_u) +#undef trsm3m1_l_ukr_name +#define trsm3m1_l_ukr_name GENARNAME(trsm3m1_l) +#undef trsm3m1_u_ukr_name +#define trsm3m1_u_ukr_name GENARNAME(trsm3m1_u) + +// -- 4mh -- + +#undef gemm4mh_ukr_name +#define gemm4mh_ukr_name GENARNAME(gemm4mh) + +// -- 4mb -- + +#undef gemm4mb_ukr_name +#define gemm4mb_ukr_name GENARNAME(gemm4mb) + +// -- 4m1 -- + +#undef gemm4m1_ukr_name +#define gemm4m1_ukr_name GENARNAME(gemm4m1) +#undef gemmtrsm4m1_l_ukr_name +#define gemmtrsm4m1_l_ukr_name GENARNAME(gemmtrsm4m1_l) +#undef gemmtrsm4m1_u_ukr_name +#define gemmtrsm4m1_u_ukr_name GENARNAME(gemmtrsm4m1_u) +#undef trsm4m1_l_ukr_name +#define trsm4m1_l_ukr_name GENARNAME(trsm4m1_l) +#undef trsm4m1_u_ukr_name +#define trsm4m1_u_ukr_name GENARNAME(trsm4m1_u) + +// -- 1m -- + +#undef gemm1m_ukr_name +#define gemm1m_ukr_name GENARNAME(gemm1m) +#undef gemmtrsm1m_l_ukr_name +#define gemmtrsm1m_l_ukr_name GENARNAME(gemmtrsm1m_l) +#undef gemmtrsm1m_u_ukr_name +#define gemmtrsm1m_u_ukr_name GENARNAME(gemmtrsm1m_u) +#undef trsm1m_l_ukr_name +#define trsm1m_l_ukr_name GENARNAME(trsm1m_l) +#undef trsm1m_u_ukr_name +#define trsm1m_u_ukr_name GENARNAME(trsm1m_u) + +// Include the virtual micro-kernel API template. +#include "bli_l3_ind_ukr.h" + +// -- Level-1m (packm/unpackm) kernel prototype redefinitions ------------------ + +#undef packm_2xk_ker_name +#define packm_2xk_ker_name GENARNAME(packm_2xk) +#undef packm_3xk_ker_name +#define packm_3xk_ker_name GENARNAME(packm_3xk) +#undef packm_4xk_ker_name +#define packm_4xk_ker_name GENARNAME(packm_4xk) +#undef packm_6xk_ker_name +#define packm_6xk_ker_name GENARNAME(packm_6xk) +#undef packm_8xk_ker_name +#define packm_8xk_ker_name GENARNAME(packm_8xk) +#undef packm_10xk_ker_name +#define packm_10xk_ker_name GENARNAME(packm_10xk) +#undef packm_12xk_ker_name +#define packm_12xk_ker_name GENARNAME(packm_12xk) +#undef packm_14xk_ker_name +#define packm_14xk_ker_name GENARNAME(packm_14xk) +#undef packm_16xk_ker_name +#define packm_16xk_ker_name GENARNAME(packm_16xk) +#undef packm_24xk_ker_name +#define packm_24xk_ker_name GENARNAME(packm_24xk) +#undef packm_30xk_ker_name +#define packm_30xk_ker_name GENARNAME(packm_30xk) + +#undef unpackm_2xk_ker_name +#define unpackm_2xk_ker_name GENARNAME(unpackm_2xk) +#undef unpackm_4xk_ker_name +#define unpackm_4xk_ker_name GENARNAME(unpackm_4xk) +#undef unpackm_6xk_ker_name +#define unpackm_6xk_ker_name GENARNAME(unpackm_6xk) +#undef unpackm_8xk_ker_name +#define unpackm_8xk_ker_name GENARNAME(unpackm_8xk) +#undef unpackm_10xk_ker_name +#define unpackm_10xk_ker_name GENARNAME(unpackm_10xk) +#undef unpackm_12xk_ker_name +#define unpackm_12xk_ker_name GENARNAME(unpackm_12xk) +#undef unpackm_14xk_ker_name +#define unpackm_14xk_ker_name GENARNAME(unpackm_14xk) +#undef unpackm_16xk_ker_name +#define unpackm_16xk_ker_name GENARNAME(unpackm_16xk) + +#undef packm_2xk_3mis_ker_name +#define packm_2xk_3mis_ker_name GENARNAME(packm_2xk_3mis) +#undef packm_4xk_3mis_ker_name +#define packm_4xk_3mis_ker_name GENARNAME(packm_4xk_3mis) +#undef packm_6xk_3mis_ker_name +#define packm_6xk_3mis_ker_name GENARNAME(packm_6xk_3mis) +#undef packm_8xk_3mis_ker_name +#define packm_8xk_3mis_ker_name GENARNAME(packm_8xk_3mis) +#undef packm_10xk_3mis_ker_name +#define packm_10xk_3mis_ker_name GENARNAME(packm_10xk_3mis) +#undef packm_12xk_3mis_ker_name +#define packm_12xk_3mis_ker_name GENARNAME(packm_12xk_3mis) +#undef packm_14xk_3mis_ker_name +#define packm_14xk_3mis_ker_name GENARNAME(packm_14xk_3mis) +#undef packm_16xk_3mis_ker_name +#define packm_16xk_3mis_ker_name GENARNAME(packm_16xk_3mis) +#undef packm_30xk_3mis_ker_name +#define packm_30xk_3mis_ker_name GENARNAME(packm_30xk_3mis) + +#undef packm_2xk_4mi_ker_name +#define packm_2xk_4mi_ker_name GENARNAME(packm_2xk_4mi) +#undef packm_3xk_4mi_ker_name +#define packm_3xk_4mi_ker_name GENARNAME(packm_3xk_4mi) +#undef packm_4xk_4mi_ker_name +#define packm_4xk_4mi_ker_name GENARNAME(packm_4xk_4mi) +#undef packm_6xk_4mi_ker_name +#define packm_6xk_4mi_ker_name GENARNAME(packm_6xk_4mi) +#undef packm_8xk_4mi_ker_name +#define packm_8xk_4mi_ker_name GENARNAME(packm_8xk_4mi) +#undef packm_10xk_4mi_ker_name +#define packm_10xk_4mi_ker_name GENARNAME(packm_10xk_4mi) +#undef packm_12xk_4mi_ker_name +#define packm_12xk_4mi_ker_name GENARNAME(packm_12xk_4mi) +#undef packm_14xk_4mi_ker_name +#define packm_14xk_4mi_ker_name GENARNAME(packm_14xk_4mi) +#undef packm_16xk_4mi_ker_name +#define packm_16xk_4mi_ker_name GENARNAME(packm_16xk_4mi) +#undef packm_30xk_4mi_ker_name +#define packm_30xk_4mi_ker_name GENARNAME(packm_30xk_4mi) + +#undef packm_2xk_rih_ker_name +#define packm_2xk_rih_ker_name GENARNAME(packm_2xk_rih) +#undef packm_4xk_rih_ker_name +#define packm_4xk_rih_ker_name GENARNAME(packm_4xk_rih) +#undef packm_6xk_rih_ker_name +#define packm_6xk_rih_ker_name GENARNAME(packm_6xk_rih) +#undef packm_8xk_rih_ker_name +#define packm_8xk_rih_ker_name GENARNAME(packm_8xk_rih) +#undef packm_10xk_rih_ker_name +#define packm_10xk_rih_ker_name GENARNAME(packm_10xk_rih) +#undef packm_12xk_rih_ker_name +#define packm_12xk_rih_ker_name GENARNAME(packm_12xk_rih) +#undef packm_14xk_rih_ker_name +#define packm_14xk_rih_ker_name GENARNAME(packm_14xk_rih) +#undef packm_16xk_rih_ker_name +#define packm_16xk_rih_ker_name GENARNAME(packm_16xk_rih) +#undef packm_30xk_rih_ker_name +#define packm_30xk_rih_ker_name GENARNAME(packm_30xk_rih) + +#undef packm_2xk_1er_ker_name +#define packm_2xk_1er_ker_name GENARNAME(packm_2xk_1e) +#undef packm_4xk_1er_ker_name +#define packm_4xk_1er_ker_name GENARNAME(packm_4xk_1e) +#undef packm_6xk_1er_ker_name +#define packm_6xk_1er_ker_name GENARNAME(packm_6xk_1e) +#undef packm_8xk_1er_ker_name +#define packm_8xk_1er_ker_name GENARNAME(packm_8xk_1e) +#undef packm_10xk_1er_ker_name +#define packm_10xk_1er_ker_name GENARNAME(packm_10xk_1e) +#undef packm_12xk_1er_ker_name +#define packm_12xk_1er_ker_name GENARNAME(packm_12xk_1e) +#undef packm_14xk_1er_ker_name +#define packm_14xk_1er_ker_name GENARNAME(packm_14xk_1e) +#undef packm_16xk_1er_ker_name +#define packm_16xk_1er_ker_name GENARNAME(packm_16xk_1e) +#undef packm_30xk_1er_ker_name +#define packm_30xk_1er_ker_name GENARNAME(packm_30xk_1e) + +// Include the level-1m kernel API template. +#include "bli_l1m_ker.h" + +// -- Level-1f kernel prototype redefinitions ---------------------------------- + +#undef axpy2v_ker_name +#define axpy2v_ker_name GENARNAME(axpy2v) +#undef dotaxpyv_ker_name +#define dotaxpyv_ker_name GENARNAME(dotaxpyv) +#undef axpyf_ker_name +#define axpyf_ker_name GENARNAME(axpyf) +#undef dotxf_ker_name +#define dotxf_ker_name GENARNAME(dotxf) +#undef dotxaxpyf_ker_name +#define dotxaxpyf_ker_name GENARNAME(dotxaxpyf) + +// Include the level-1f kernel API template. +#include "bli_l1f_ker.h" + +// -- Level-1v kernel prototype redefinitions ---------------------------------- + +#undef addv_ker_name +#define addv_ker_name GENARNAME(addv) +#undef amaxv_ker_name +#define amaxv_ker_name GENARNAME(amaxv) +#undef axpbyv_ker_name +#define axpbyv_ker_name GENARNAME(axpbyv) +#undef axpyv_ker_name +#define axpyv_ker_name GENARNAME(axpyv) +#undef copyv_ker_name +#define copyv_ker_name GENARNAME(copyv) +#undef dotv_ker_name +#define dotv_ker_name GENARNAME(dotv) +#undef dotxv_ker_name +#define dotxv_ker_name GENARNAME(dotxv) +#undef invertv_ker_name +#define invertv_ker_name GENARNAME(invertv) +#undef scalv_ker_name +#define scalv_ker_name GENARNAME(scalv) +#undef scal2v_ker_name +#define scal2v_ker_name GENARNAME(scal2v) +#undef setv_ker_name +#define setv_ker_name GENARNAME(setv) +#undef subv_ker_name +#define subv_ker_name GENARNAME(subv) +#undef swapv_ker_name +#define swapv_ker_name GENARNAME(swapv) +#undef xpbyv_ker_name +#define xpbyv_ker_name GENARNAME(xpbyv) + +// Include the level-1v kernel API template. +#include "bli_l1v_ker.h" + + +// -- Macros to help concisely instantiate bli_func_init() --------------------- + +#define gen_func_init_co( func_p, opname ) \ +\ + bli_func_init( func_p, NULL, NULL, \ + PASTEMAC(c,opname), PASTEMAC(z,opname) ) + +#define gen_func_init( func_p, opname ) \ +\ + bli_func_init( func_p, PASTEMAC(s,opname), PASTEMAC(d,opname), \ + PASTEMAC(c,opname), PASTEMAC(z,opname) ) + + +// ----------------------------------------------------------------------------- + +void GENBARNAME(cntx_init) + ( + cntx_t* cntx + ) +{ + blksz_t blkszs[ BLIS_NUM_BLKSZS ]; + func_t* funcs; + mbool_t* mbools; + dim_t i; + + + // -- Clear the context ---------------------------------------------------- + + bli_cntx_clear( cntx ); + + + // -- Set blocksizes ------------------------------------------------------- + + // s d c z + bli_blksz_init_easy( &blkszs[ BLIS_KR ], 1, 1, 1, 1 ); + bli_blksz_init_easy( &blkszs[ BLIS_MR ], 8, 4, 4, 2 ); + bli_blksz_init_easy( &blkszs[ BLIS_NR ], 4, 4, 2, 2 ); + bli_blksz_init_easy( &blkszs[ BLIS_MC ], 512, 256, 256, 128 ); + bli_blksz_init_easy( &blkszs[ BLIS_KC ], 256, 256, 256, 256 ); + bli_blksz_init_easy( &blkszs[ BLIS_NC ], 4096, 4096, 4096, 4096 ); + bli_blksz_init_easy( &blkszs[ BLIS_M2 ], 1000, 1000, 1000, 1000 ); + bli_blksz_init_easy( &blkszs[ BLIS_N2 ], 1000, 1000, 1000, 1000 ); + bli_blksz_init_easy( &blkszs[ BLIS_AF ], 8, 4, 4, 2 ); + bli_blksz_init_easy( &blkszs[ BLIS_DF ], 8, 4, 4, 2 ); + bli_blksz_init_easy( &blkszs[ BLIS_XF ], 8, 4, 4, 2 ); + + // Initialize the context with the default blocksize objects and their + // multiples. + bli_cntx_set_blkszs + ( + BLIS_NAT, 11, + 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, + BLIS_KR, &blkszs[ BLIS_KR ], BLIS_KR, + BLIS_M2, &blkszs[ BLIS_M2 ], BLIS_M2, + BLIS_N2, &blkszs[ BLIS_N2 ], BLIS_N2, + BLIS_AF, &blkszs[ BLIS_AF ], BLIS_AF, + BLIS_DF, &blkszs[ BLIS_DF ], BLIS_DF, + BLIS_XF, &blkszs[ BLIS_XF ], BLIS_XF, + cntx + ); + + + // -- Set level-3 virtual micro-kernels ------------------------------------ + + funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + + gen_func_init_co( &funcs[ BLIS_GEMM_UKR ], gemm1m_ukr_name ); + gen_func_init_co( &funcs[ BLIS_GEMMTRSM_L_UKR ], gemmtrsm1m_l_ukr_name ); + gen_func_init_co( &funcs[ BLIS_GEMMTRSM_U_UKR ], gemmtrsm1m_u_ukr_name ); + gen_func_init_co( &funcs[ BLIS_TRSM_L_UKR ], trsm1m_l_ukr_name ); + gen_func_init_co( &funcs[ BLIS_TRSM_U_UKR ], trsm1m_u_ukr_name ); + + + // -- Set level-3 native micro-kernels and preferences --------------------- + + funcs = bli_cntx_l3_nat_ukrs_buf( cntx ); + mbools = bli_cntx_l3_nat_ukrs_prefs_buf( cntx ); + + gen_func_init( &funcs[ BLIS_GEMM_UKR ], gemm_ukr_name ); + gen_func_init( &funcs[ BLIS_GEMMTRSM_L_UKR ], gemmtrsm_l_ukr_name ); + gen_func_init( &funcs[ BLIS_GEMMTRSM_U_UKR ], gemmtrsm_u_ukr_name ); + gen_func_init( &funcs[ BLIS_TRSM_L_UKR ], trsm_l_ukr_name ); + gen_func_init( &funcs[ BLIS_TRSM_U_UKR ], trsm_u_ukr_name ); + + bli_mbool_init( &mbools[ BLIS_GEMM_UKR ], FALSE, FALSE, FALSE, FALSE ); + bli_mbool_init( &mbools[ BLIS_GEMMTRSM_L_UKR ], FALSE, FALSE, FALSE, FALSE ); + bli_mbool_init( &mbools[ BLIS_GEMMTRSM_U_UKR ], FALSE, FALSE, FALSE, FALSE ); + bli_mbool_init( &mbools[ BLIS_TRSM_L_UKR ], FALSE, FALSE, FALSE, FALSE ); + bli_mbool_init( &mbools[ BLIS_TRSM_U_UKR ], FALSE, FALSE, FALSE, FALSE ); + + + // -- Set level-1f kernels ------------------------------------------------- + + funcs = bli_cntx_l1f_kers_buf( cntx ); + + gen_func_init( &funcs[ BLIS_AXPY2V_KER ], axpy2v_ker_name ); + gen_func_init( &funcs[ BLIS_DOTAXPYV_KER ], dotaxpyv_ker_name ); + gen_func_init( &funcs[ BLIS_AXPYF_KER ], axpyf_ker_name ); + gen_func_init( &funcs[ BLIS_DOTXF_KER ], dotxf_ker_name ); + gen_func_init( &funcs[ BLIS_DOTXAXPYF_KER ], dotxaxpyf_ker_name ); + + + // -- Set level-1v kernels ------------------------------------------------- + + funcs = bli_cntx_l1v_kers_buf( cntx ); + + gen_func_init( &funcs[ BLIS_ADDV_KER ], addv_ker_name ); + gen_func_init( &funcs[ BLIS_AMAXV_KER ], amaxv_ker_name ); + gen_func_init( &funcs[ BLIS_AXPBYV_KER ], axpbyv_ker_name ); + gen_func_init( &funcs[ BLIS_AXPYV_KER ], axpyv_ker_name ); + gen_func_init( &funcs[ BLIS_COPYV_KER ], copyv_ker_name ); + gen_func_init( &funcs[ BLIS_DOTV_KER ], dotv_ker_name ); + gen_func_init( &funcs[ BLIS_DOTXV_KER ], dotxv_ker_name ); + gen_func_init( &funcs[ BLIS_INVERTV_KER ], invertv_ker_name ); + gen_func_init( &funcs[ BLIS_SCALV_KER ], scalv_ker_name ); + gen_func_init( &funcs[ BLIS_SCAL2V_KER ], scal2v_ker_name ); + gen_func_init( &funcs[ BLIS_SETV_KER ], setv_ker_name ); + gen_func_init( &funcs[ BLIS_SUBV_KER ], subv_ker_name ); + gen_func_init( &funcs[ BLIS_SWAPV_KER ], swapv_ker_name ); + gen_func_init( &funcs[ BLIS_XPBYV_KER ], xpbyv_ker_name ); + + + // -- Set level-1m (packm/unpackm) kernels --------------------------------- + + funcs = bli_cntx_packm_kers_buf( cntx ); + + // Initialize all packm kernel func_t entries to NULL. + for ( i = BLIS_PACKM_0XK_KER; i <= BLIS_PACKM_31XK_KER; ++i ) + { + bli_func_init_null( &funcs[ i ] ); + } + + gen_func_init( &funcs[ BLIS_PACKM_2XK_KER ], packm_2xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_3XK_KER ], packm_3xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_4XK_KER ], packm_4xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_6XK_KER ], packm_6xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_8XK_KER ], packm_8xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_10XK_KER ], packm_10xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_12XK_KER ], packm_12xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_14XK_KER ], packm_14xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_16XK_KER ], packm_16xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_24XK_KER ], packm_24xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_30XK_KER ], packm_30xk_ker_name ); + + funcs = bli_cntx_unpackm_kers_buf( cntx ); + + // Initialize all packm kernel func_t entries to NULL. + for ( i = BLIS_UNPACKM_0XK_KER; i <= BLIS_UNPACKM_31XK_KER; ++i ) + { + bli_func_init_null( &funcs[ i ] ); + } + + gen_func_init( &funcs[ BLIS_UNPACKM_2XK_KER ], unpackm_2xk_ker_name ); + gen_func_init( &funcs[ BLIS_UNPACKM_4XK_KER ], unpackm_4xk_ker_name ); + gen_func_init( &funcs[ BLIS_UNPACKM_6XK_KER ], unpackm_6xk_ker_name ); + gen_func_init( &funcs[ BLIS_UNPACKM_8XK_KER ], unpackm_8xk_ker_name ); + gen_func_init( &funcs[ BLIS_UNPACKM_10XK_KER ], unpackm_10xk_ker_name ); + gen_func_init( &funcs[ BLIS_UNPACKM_12XK_KER ], unpackm_12xk_ker_name ); + gen_func_init( &funcs[ BLIS_UNPACKM_14XK_KER ], unpackm_14xk_ker_name ); + gen_func_init( &funcs[ BLIS_UNPACKM_16XK_KER ], unpackm_16xk_ker_name ); + + + // -- Set miscellaneous fields --------------------------------------------- + + bli_cntx_set_method( BLIS_NAT, cntx ); + + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS, cntx ); + bli_cntx_set_schema_c_panel( BLIS_NOT_PACKED, cntx ); + + bli_cntx_set_anti_pref( FALSE, cntx ); + + bli_cntx_set_thrloop( 1, 1, 1, 1, 1, cntx ); + + bli_cntx_set_membrk( bli_memsys_global_membrk(), cntx ); +} + +// ----------------------------------------------------------------------------- + +void GENBAINAME(cntx_init) + ( + ind_t method, + num_t dt, + cntx_t* cntx + ) +{ + func_t* funcs; + dim_t i; + + // This function is designed to modify a copy of an existing native + // context to enable computation via an induced method for complex + // domain level-3 operations. It is called by bli_gks_query_ind_cntx() + // on a context after its contexts are set by copying from the + // architecture's native context. + + // -- Set induced method level-3 virtual micro-kernels --------------------- + + funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + + // 3mh, 4mh, and 4mb do not not support trsm. + bli_func_init_null( &funcs[ BLIS_GEMMTRSM_L_UKR ] ); + bli_func_init_null( &funcs[ BLIS_GEMMTRSM_U_UKR ] ); + bli_func_init_null( &funcs[ BLIS_TRSM_L_UKR ] ); + bli_func_init_null( &funcs[ BLIS_TRSM_U_UKR ] ); + + if ( method == BLIS_3MH ) + { + gen_func_init_co( &funcs[ BLIS_GEMM_UKR ], gemm3mh_ukr_name ); + } + else if ( method == BLIS_3M1 ) + { + gen_func_init_co( &funcs[ BLIS_GEMM_UKR ], gemm3m1_ukr_name ); + gen_func_init_co( &funcs[ BLIS_GEMMTRSM_L_UKR ], gemmtrsm3m1_l_ukr_name ); + gen_func_init_co( &funcs[ BLIS_GEMMTRSM_U_UKR ], gemmtrsm3m1_u_ukr_name ); + gen_func_init_co( &funcs[ BLIS_TRSM_L_UKR ], trsm3m1_l_ukr_name ); + gen_func_init_co( &funcs[ BLIS_TRSM_U_UKR ], trsm3m1_u_ukr_name ); + } + else if ( method == BLIS_4MH ) + { + gen_func_init_co( &funcs[ BLIS_GEMM_UKR ], gemm4mh_ukr_name ); + } + else if ( method == BLIS_4M1B ) + { + gen_func_init_co( &funcs[ BLIS_GEMM_UKR ], gemm4mb_ukr_name ); + } + else if ( method == BLIS_4M1A ) + { + gen_func_init_co( &funcs[ BLIS_GEMM_UKR ], gemm4m1_ukr_name ); + gen_func_init_co( &funcs[ BLIS_GEMMTRSM_L_UKR ], gemmtrsm4m1_l_ukr_name ); + gen_func_init_co( &funcs[ BLIS_GEMMTRSM_U_UKR ], gemmtrsm4m1_u_ukr_name ); + gen_func_init_co( &funcs[ BLIS_TRSM_L_UKR ], trsm4m1_l_ukr_name ); + gen_func_init_co( &funcs[ BLIS_TRSM_U_UKR ], trsm4m1_u_ukr_name ); + } + else if ( method == BLIS_1M ) + { + gen_func_init_co( &funcs[ BLIS_GEMM_UKR ], gemm1m_ukr_name ); + gen_func_init_co( &funcs[ BLIS_GEMMTRSM_L_UKR ], gemmtrsm1m_l_ukr_name ); + gen_func_init_co( &funcs[ BLIS_GEMMTRSM_U_UKR ], gemmtrsm1m_u_ukr_name ); + gen_func_init_co( &funcs[ BLIS_TRSM_L_UKR ], trsm1m_l_ukr_name ); + gen_func_init_co( &funcs[ BLIS_TRSM_U_UKR ], trsm1m_u_ukr_name ); + } + else // if ( method == BLIS_NAT ) + { + gen_func_init_co( &funcs[ BLIS_GEMM_UKR ], gemm_ukr_name ); + gen_func_init_co( &funcs[ BLIS_GEMMTRSM_L_UKR ], gemmtrsm_l_ukr_name ); + gen_func_init_co( &funcs[ BLIS_GEMMTRSM_U_UKR ], gemmtrsm_u_ukr_name ); + gen_func_init_co( &funcs[ BLIS_TRSM_L_UKR ], trsm_l_ukr_name ); + gen_func_init_co( &funcs[ BLIS_TRSM_U_UKR ], trsm_u_ukr_name ); + } + + // For 1m, we employ an optimization which requires that we copy the native + // real domain gemm ukernel function pointers to the corresponding slots in + // the virtual gemm ukernel func_t. + if ( method == BLIS_1M ) + { + func_t* gemm_nat_ukrs = bli_cntx_get_l3_nat_ukrs( BLIS_GEMM, cntx ); + func_t* gemm_vir_ukrs = bli_cntx_get_l3_vir_ukrs( BLIS_GEMM, cntx ); + + bli_func_copy_dt( BLIS_FLOAT, gemm_nat_ukrs, BLIS_FLOAT, gemm_vir_ukrs ); + bli_func_copy_dt( BLIS_DOUBLE, gemm_nat_ukrs, BLIS_DOUBLE, gemm_vir_ukrs ); + } + + + // -- Set induced method packm kernels ------------------------------------- + + funcs = bli_cntx_packm_kers_buf( cntx ); + + // Initialize all packm kernel func_t entries to NULL. + for ( i = BLIS_PACKM_0XK_KER; i <= BLIS_PACKM_31XK_KER; ++i ) + { + bli_func_init_null( &funcs[ i ] ); + } + + if ( method == BLIS_3MH || method == BLIS_4MH ) + { + gen_func_init_co( &funcs[ BLIS_PACKM_2XK_KER ], packm_2xk_rih_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_4XK_KER ], packm_4xk_rih_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_6XK_KER ], packm_6xk_rih_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_8XK_KER ], packm_8xk_rih_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_10XK_KER ], packm_10xk_rih_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_12XK_KER ], packm_12xk_rih_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_14XK_KER ], packm_14xk_rih_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_16XK_KER ], packm_16xk_rih_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_30XK_KER ], packm_30xk_rih_ker_name ); + } + else if ( method == BLIS_3M1 ) + { + gen_func_init_co( &funcs[ BLIS_PACKM_2XK_KER ], packm_2xk_3mis_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_4XK_KER ], packm_4xk_3mis_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_6XK_KER ], packm_6xk_3mis_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_8XK_KER ], packm_8xk_3mis_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_10XK_KER ], packm_10xk_3mis_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_12XK_KER ], packm_12xk_3mis_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_14XK_KER ], packm_14xk_3mis_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_16XK_KER ], packm_16xk_3mis_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_30XK_KER ], packm_30xk_3mis_ker_name ); + } + else if ( method == BLIS_4M1A || method == BLIS_4M1B ) + { + gen_func_init_co( &funcs[ BLIS_PACKM_2XK_KER ], packm_2xk_4mi_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_4XK_KER ], packm_4xk_4mi_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_6XK_KER ], packm_6xk_4mi_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_8XK_KER ], packm_8xk_4mi_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_10XK_KER ], packm_10xk_4mi_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_12XK_KER ], packm_12xk_4mi_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_14XK_KER ], packm_14xk_4mi_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_16XK_KER ], packm_16xk_4mi_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_30XK_KER ], packm_30xk_4mi_ker_name ); + } + else if ( method == BLIS_1M ) + { + gen_func_init_co( &funcs[ BLIS_PACKM_2XK_KER ], packm_2xk_1er_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_4XK_KER ], packm_4xk_1er_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_6XK_KER ], packm_6xk_1er_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_8XK_KER ], packm_8xk_1er_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_10XK_KER ], packm_10xk_1er_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_12XK_KER ], packm_12xk_1er_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_14XK_KER ], packm_14xk_1er_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_16XK_KER ], packm_16xk_1er_ker_name ); + gen_func_init_co( &funcs[ BLIS_PACKM_30XK_KER ], packm_30xk_1er_ker_name ); + } + else // if ( method == BLIS_NAT ) + { + gen_func_init( &funcs[ BLIS_PACKM_2XK_KER ], packm_2xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_3XK_KER ], packm_3xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_4XK_KER ], packm_4xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_6XK_KER ], packm_6xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_8XK_KER ], packm_8xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_10XK_KER ], packm_10xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_12XK_KER ], packm_12xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_14XK_KER ], packm_14xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_16XK_KER ], packm_16xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_24XK_KER ], packm_24xk_ker_name ); + gen_func_init( &funcs[ BLIS_PACKM_30XK_KER ], packm_30xk_ker_name ); + } + + + // -- Set induced method cache and register blocksizes --------------------- + + // Modify the context with cache and register blocksizes (and multiples) + // appropriate for the current induced method. + if ( method == BLIS_3MH ) + { + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, 1.0, 1.0, + BLIS_KC, 1.0, 1.0, + BLIS_MC, 1.0, 1.0, + BLIS_NR, 1.0, 1.0, + BLIS_MR, 1.0, 1.0, + BLIS_KR, 1.0, 1.0, + cntx + ); + } + else if ( method == BLIS_3M1 ) + { + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, 1.0, 1.0, + BLIS_KC, 3.0, 3.0, + BLIS_MC, 1.0, 1.0, + BLIS_NR, 1.0, 1.0, + BLIS_MR, 1.0, 1.0, + BLIS_KR, 1.0, 1.0, + cntx + ); + } + else if ( method == BLIS_4MH ) + { + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, 1.0, 1.0, + BLIS_KC, 1.0, 1.0, + BLIS_MC, 1.0, 1.0, + BLIS_NR, 1.0, 1.0, + BLIS_MR, 1.0, 1.0, + BLIS_KR, 1.0, 1.0, + cntx + ); + } + else if ( method == BLIS_4M1B ) + { + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, 2.0, 2.0, + BLIS_KC, 1.0, 1.0, + BLIS_MC, 2.0, 2.0, + BLIS_NR, 1.0, 1.0, + BLIS_MR, 1.0, 1.0, + BLIS_KR, 1.0, 1.0, + cntx + ); + } + else if ( method == BLIS_4M1A ) + { + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, 1.0, 1.0, + BLIS_KC, 2.0, 2.0, + BLIS_MC, 1.0, 1.0, + BLIS_NR, 1.0, 1.0, + BLIS_MR, 1.0, 1.0, + BLIS_KR, 1.0, 1.0, + cntx + ); + } + else if ( method == BLIS_1M ) + { + const bool_t is_pb = FALSE; + + // Initialize the blocksizes according to the micro-kernel preference as + // well as the algorithm. + if ( bli_cntx_l3_ukr_prefers_cols_dt( dt, BLIS_GEMM_UKR, cntx ) ) + { + // This branch is used for algorithms 1m_c_bp, 1m_r_pb. + + // Set the pack_t schemas for the c_bp or r_pb algorithms. + if ( !is_pb ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_1E, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_1R, cntx ); + } + else // if ( is_pb ) + { + bli_cntx_set_schema_b_panel( BLIS_PACKED_ROW_PANELS_1R, cntx ); + bli_cntx_set_schema_a_block( BLIS_PACKED_COL_PANELS_1E, cntx ); + } + + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, 1.0, 1.0, + BLIS_KC, 2.0, 2.0, // halve kc... + BLIS_MC, 2.0, 2.0, // halve mc... + BLIS_NR, 1.0, 1.0, + BLIS_MR, 2.0, 1.0, // ...and mr (but NOT packmr) + BLIS_KR, 1.0, 1.0, + cntx + ); + } + else // if ( bli_cntx_l3_ukr_prefers_rows_dt( dt, BLIS_GEMM_UKR, cntx ) ) + { + // This branch is used for algorithms 1m_r_bp, 1m_c_pb. + + // Set the pack_t schemas for the r_bp or c_pb algorithms. + if ( !is_pb ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_1R, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_1E, cntx ); + } + else // if ( is_pb ) + { + bli_cntx_set_schema_b_panel( BLIS_PACKED_ROW_PANELS_1E, cntx ); + bli_cntx_set_schema_a_block( BLIS_PACKED_COL_PANELS_1R, cntx ); + } + + bli_cntx_set_ind_blkszs + ( + method, 6, + BLIS_NC, 2.0, 2.0, // halve nc... + BLIS_KC, 2.0, 2.0, // halve kc... + BLIS_MC, 1.0, 1.0, + BLIS_NR, 2.0, 1.0, // ...and nr (but NOT packnr) + BLIS_MR, 1.0, 1.0, + BLIS_KR, 1.0, 1.0, + cntx + ); + } + } + else // if ( method == BLIS_NAT ) + { + // No change in blocksizes needed for native execution. + } + + + // -- Set misc. other fields ----------------------------------------------- + + if ( method == BLIS_3MH ) + { + // Schemas vary with _stage(). + } + else if ( method == BLIS_3M1 ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_3MI, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_3MI, cntx ); + } + else if ( method == BLIS_4MH ) + { + // Schemas vary with _stage(). + } + else if ( method == BLIS_4M1A || method == BLIS_4M1B ) + { + bli_cntx_set_schema_a_block( BLIS_PACKED_ROW_PANELS_4MI, cntx ); + bli_cntx_set_schema_b_panel( BLIS_PACKED_COL_PANELS_4MI, cntx ); + } + else if ( method == BLIS_1M ) + { + const bool_t is_pb = FALSE; + + // Set the anti-preference field to TRUE when executing a panel-block + // algorithm, and FALSE otherwise. This will cause higher-level generic + // code to establish (if needed) disagreement between the storage of C and + // the micro-kernel output preference so that the two will come back into + // agreement in the panel-block macro-kernel (which implemented in terms + // of the block-panel macro-kernel with some induced transpositions). + bli_cntx_set_anti_pref( is_pb, cntx ); + } + else // if ( method == BLIS_NAT ) + { + } +} + diff --git a/frame/ind/ukernels/gemm/bli_gemm1m_ukr_ref.c b/ref_kernels/ind/bli_gemm1m_ref.c similarity index 97% rename from frame/ind/ukernels/gemm/bli_gemm1m_ukr_ref.c rename to ref_kernels/ind/bli_gemm1m_ref.c index 6279ab762..31268df1b 100644 --- a/frame/ind/ukernels/gemm/bli_gemm1m_ukr_ref.c +++ b/ref_kernels/ind/bli_gemm1m_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname, gemmkerid ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -53,7 +53,7 @@ void PASTEMAC(ch,varname) \ const num_t dt_r = PASTEMAC(chr,type); \ \ PASTECH(chr,gemm_ukr_ft) \ - rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, gemmkerid, cntx ); \ + rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, BLIS_GEMM_UKR, cntx ); \ const bool_t col_pref = bli_cntx_l3_ukr_prefers_cols_dt( dt, BLIS_GEMM_UKR, cntx ); \ const bool_t row_pref = !col_pref; \ \ @@ -198,5 +198,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC( gemm1m_ukr_ref, BLIS_GEMM_UKR ) +INSERT_GENTFUNCCO_BASIC2( gemm1m, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/ind/ukernels/gemm/bli_gemm3m1_ukr_ref.c b/ref_kernels/ind/bli_gemm3m1_ref.c similarity index 98% rename from frame/ind/ukernels/gemm/bli_gemm3m1_ukr_ref.c rename to ref_kernels/ind/bli_gemm3m1_ref.c index d5873b070..965b800b4 100644 --- a/frame/ind/ukernels/gemm/bli_gemm3m1_ukr_ref.c +++ b/ref_kernels/ind/bli_gemm3m1_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname, gemmkerid ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -52,7 +52,7 @@ void PASTEMAC(ch,varname) \ const num_t dt_r = PASTEMAC(chr,type); \ \ PASTECH(chr,gemm_ukr_ft) \ - rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, gemmkerid, cntx ); \ + rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, BLIS_GEMM_UKR, cntx ); \ \ const dim_t mr = bli_cntx_get_blksz_def_dt( dt_r, BLIS_MR, cntx ); \ const dim_t nr = bli_cntx_get_blksz_def_dt( dt_r, BLIS_NR, cntx ); \ @@ -332,5 +332,5 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC( gemm3m1_ukr_ref, BLIS_GEMM_UKR ) +INSERT_GENTFUNCCO_BASIC2( gemm3m1, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/ind/ukernels/gemm/bli_gemm3mh_ukr_ref.c b/ref_kernels/ind/bli_gemm3mh_ref.c similarity index 98% rename from frame/ind/ukernels/gemm/bli_gemm3mh_ukr_ref.c rename to ref_kernels/ind/bli_gemm3mh_ref.c index 7688b4dff..a1712a4b7 100644 --- a/frame/ind/ukernels/gemm/bli_gemm3mh_ukr_ref.c +++ b/ref_kernels/ind/bli_gemm3mh_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname, gemmkerid ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -52,7 +52,7 @@ void PASTEMAC(ch,varname) \ const num_t dt_r = PASTEMAC(chr,type); \ \ PASTECH(chr,gemm_ukr_ft) \ - rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, gemmkerid, cntx ); \ + rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, BLIS_GEMM_UKR, cntx ); \ \ const dim_t mr = bli_cntx_get_blksz_def_dt( dt_r, BLIS_MR, cntx ); \ const dim_t nr = bli_cntx_get_blksz_def_dt( dt_r, BLIS_NR, cntx ); \ @@ -294,5 +294,4 @@ PASTEMAC(chr,fprintm)( stdout, "gemm3mh_ukr: ct", 4, 4, ct, rs_ct, cs_ct, "%4.1f PASTEMAC(chr,fprintm)( stdout, "gemm3mh_ukr: a1", m, k, a_cast, 1, m, "%4.1f", "" );*/ \ } -INSERT_GENTFUNCCO_BASIC( gemm3mh_ukr_ref, BLIS_GEMM_UKR ) - +INSERT_GENTFUNCCO_BASIC2( gemm3mh, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/ind/ukernels/gemm/bli_gemm4m1_ukr_ref.c b/ref_kernels/ind/bli_gemm4m1_ref.c similarity index 97% rename from frame/ind/ukernels/gemm/bli_gemm4m1_ukr_ref.c rename to ref_kernels/ind/bli_gemm4m1_ref.c index 7cee976ce..2d4fb3fd0 100644 --- a/frame/ind/ukernels/gemm/bli_gemm4m1_ukr_ref.c +++ b/ref_kernels/ind/bli_gemm4m1_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname, gemmkerid ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -52,7 +52,7 @@ void PASTEMAC(ch,varname) \ const num_t dt_r = PASTEMAC(chr,type); \ \ PASTECH(chr,gemm_ukr_ft) \ - rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, gemmkerid, cntx ); \ + rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, BLIS_GEMM_UKR, cntx ); \ \ const dim_t mr = bli_cntx_get_blksz_def_dt( dt_r, BLIS_MR, cntx ); \ const dim_t nr = bli_cntx_get_blksz_def_dt( dt_r, BLIS_NR, cntx ); \ @@ -287,5 +287,5 @@ PASTEMAC(chr,fprintm)( stdout, "gemm4m1_ukr: bp_i", k, n, \ } \ } -INSERT_GENTFUNCCO_BASIC( gemm4m1_ukr_ref, BLIS_GEMM_UKR ) +INSERT_GENTFUNCCO_BASIC2( gemm4m1, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/ind/ukernels/gemm/bli_gemm4mb_ukr_ref.c b/ref_kernels/ind/bli_gemm4mb_ref.c similarity index 98% rename from frame/ind/ukernels/gemm/bli_gemm4mb_ukr_ref.c rename to ref_kernels/ind/bli_gemm4mb_ref.c index 5e94ba909..da1b354c7 100644 --- a/frame/ind/ukernels/gemm/bli_gemm4mb_ukr_ref.c +++ b/ref_kernels/ind/bli_gemm4mb_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname, gemmkerid ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -52,7 +52,7 @@ void PASTEMAC(ch,varname) \ const num_t dt_r = PASTEMAC(chr,type); \ \ PASTECH(chr,gemm_ukr_ft) \ - rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, gemmkerid, cntx ); \ + rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, BLIS_GEMM_UKR, cntx ); \ \ const dim_t mr = bli_cntx_get_blksz_def_dt( dt_r, BLIS_MR, cntx ); \ const dim_t nr = bli_cntx_get_blksz_def_dt( dt_r, BLIS_NR, cntx ); \ @@ -341,5 +341,5 @@ PASTEMAC(chr,fprintm)( stdout, "gemm4mb_ukr: a1_i", m, k, a_i, 1, m, "%4.1f", "" PASTEMAC(chr,fprintm)( stdout, "gemm4mb_ukr: ct_i", 8, 6, ct_i, rs_ct, cs_ct, "%4.1f", "" );*/ \ } -INSERT_GENTFUNCCO_BASIC( gemm4mb_ukr_ref, BLIS_GEMM_UKR ) +INSERT_GENTFUNCCO_BASIC2( gemm4mb, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/ind/ukernels/gemm/bli_gemm4mh_ukr_ref.c b/ref_kernels/ind/bli_gemm4mh_ref.c similarity index 97% rename from frame/ind/ukernels/gemm/bli_gemm4mh_ukr_ref.c rename to ref_kernels/ind/bli_gemm4mh_ref.c index 6423ac8b2..2cde163f4 100644 --- a/frame/ind/ukernels/gemm/bli_gemm4mh_ukr_ref.c +++ b/ref_kernels/ind/bli_gemm4mh_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname, gemmkerid ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -52,7 +52,7 @@ void PASTEMAC(ch,varname) \ const num_t dt_r = PASTEMAC(chr,type); \ \ PASTECH(chr,gemm_ukr_ft) \ - rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, gemmkerid, cntx ); \ + rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, BLIS_GEMM_UKR, cntx ); \ \ const dim_t mr = bli_cntx_get_blksz_def_dt( dt_r, BLIS_MR, cntx ); \ const dim_t nr = bli_cntx_get_blksz_def_dt( dt_r, BLIS_NR, cntx ); \ @@ -283,5 +283,4 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC( gemm4mh_ukr_ref, BLIS_GEMM_UKR ) - +INSERT_GENTFUNCCO_BASIC2( gemm4mh, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/ind/ukernels/trsm/bli_gemmtrsm1m_ukr_ref.c b/ref_kernels/ind/bli_gemmtrsm1m_ref.c similarity index 96% rename from frame/ind/ukernels/trsm/bli_gemmtrsm1m_ukr_ref.c rename to ref_kernels/ind/bli_gemmtrsm1m_ref.c index c4ec44b54..ebfca053a 100644 --- a/frame/ind/ukernels/trsm/bli_gemmtrsm1m_ukr_ref.c +++ b/ref_kernels/ind/bli_gemmtrsm1m_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname, gemmkerid, trsmkerid ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf, trsmkerid ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -54,7 +54,7 @@ void PASTEMAC(ch,varname) \ const num_t dt_r = PASTEMAC(chr,type); \ \ PASTECH(chr,gemm_ukr_ft) \ - rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, gemmkerid, cntx ); \ + rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, BLIS_GEMM_UKR, cntx ); \ \ PASTECH(ch,trsm_ukr_ft) \ ctrsm_vir_ukr = bli_cntx_get_l3_vir_ukr_dt( dt, trsmkerid, cntx ); \ @@ -239,6 +239,5 @@ void PASTEMAC(ch,varname) \ ); \ } -INSERT_GENTFUNCCO_BASIC2( gemmtrsm1m_l_ukr_ref, BLIS_GEMM_UKR, BLIS_TRSM_L_UKR ) -INSERT_GENTFUNCCO_BASIC2( gemmtrsm1m_u_ukr_ref, BLIS_GEMM_UKR, BLIS_TRSM_U_UKR ) - +INSERT_GENTFUNCCO_BASIC3( gemmtrsm1m_l, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX, BLIS_TRSM_L_UKR ) +INSERT_GENTFUNCCO_BASIC3( gemmtrsm1m_u, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX, BLIS_TRSM_U_UKR ) diff --git a/frame/ind/ukernels/trsm/bli_gemmtrsm3m1_ukr_ref.c b/ref_kernels/ind/bli_gemmtrsm3m1_ref.c similarity index 96% rename from frame/ind/ukernels/trsm/bli_gemmtrsm3m1_ukr_ref.c rename to ref_kernels/ind/bli_gemmtrsm3m1_ref.c index 418fb5011..086c4b087 100644 --- a/frame/ind/ukernels/trsm/bli_gemmtrsm3m1_ukr_ref.c +++ b/ref_kernels/ind/bli_gemmtrsm3m1_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname, gemmkerid, trsmkerid ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf, trsmkerid ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -54,7 +54,7 @@ void PASTEMAC(ch,varname) \ const num_t dt_r = PASTEMAC(chr,type); \ \ PASTECH(chr,gemm_ukr_ft) \ - rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, gemmkerid, cntx ); \ + rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, BLIS_GEMM_UKR, cntx ); \ \ PASTECH(ch,trsm_ukr_ft) \ ctrsm_vir_ukr = bli_cntx_get_l3_vir_ukr_dt( dt, trsmkerid, cntx ); \ @@ -244,6 +244,5 @@ PASTEMAC(chr,fprintm)( stdout, "gemmtrsm3m1_l_ukr: b11_i", m, n, \ */ \ } -INSERT_GENTFUNCCO_BASIC2( gemmtrsm3m1_l_ukr_ref, BLIS_GEMM_UKR, BLIS_TRSM_L_UKR ) -INSERT_GENTFUNCCO_BASIC2( gemmtrsm3m1_u_ukr_ref, BLIS_GEMM_UKR, BLIS_TRSM_U_UKR ) - +INSERT_GENTFUNCCO_BASIC3( gemmtrsm3m1_l, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX, BLIS_TRSM_L_UKR ) +INSERT_GENTFUNCCO_BASIC3( gemmtrsm3m1_u, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX, BLIS_TRSM_U_UKR ) diff --git a/frame/ind/ukernels/trsm/bli_gemmtrsm4m1_ukr_ref.c b/ref_kernels/ind/bli_gemmtrsm4m1_ref.c similarity index 95% rename from frame/ind/ukernels/trsm/bli_gemmtrsm4m1_ukr_ref.c rename to ref_kernels/ind/bli_gemmtrsm4m1_ref.c index b3a8ced18..c9cc92d1f 100644 --- a/frame/ind/ukernels/trsm/bli_gemmtrsm4m1_ukr_ref.c +++ b/ref_kernels/ind/bli_gemmtrsm4m1_ref.c @@ -35,9 +35,9 @@ #include "blis.h" #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname, gemmkerid, trsmkerid ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf, trsmkerid ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ dim_t k, \ ctype* restrict alpha, \ @@ -54,7 +54,7 @@ void PASTEMAC(ch,varname) \ const num_t dt_r = PASTEMAC(chr,type); \ \ PASTECH(chr,gemm_ukr_ft) \ - rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, gemmkerid, cntx ); \ + rgemm_ukr = bli_cntx_get_l3_nat_ukr_dt( dt_r, BLIS_GEMM_UKR, cntx ); \ \ PASTECH(ch,trsm_ukr_ft) \ ctrsm_vir_ukr = bli_cntx_get_l3_vir_ukr_dt( dt, trsmkerid, cntx ); \ @@ -218,6 +218,5 @@ PASTEMAC(chr,fprintm)( stdout, "gemmtrsm4m1_l_ukr: bx111p_i after", k+m, n, \ */ \ } -INSERT_GENTFUNCCO_BASIC2( gemmtrsm4m1_l_ukr_ref, BLIS_GEMM_UKR, BLIS_TRSM_L_UKR ) -INSERT_GENTFUNCCO_BASIC2( gemmtrsm4m1_u_ukr_ref, BLIS_GEMM_UKR, BLIS_TRSM_U_UKR ) - +INSERT_GENTFUNCCO_BASIC3( gemmtrsm4m1_l, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX, BLIS_TRSM_L_UKR ) +INSERT_GENTFUNCCO_BASIC3( gemmtrsm4m1_u, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX, BLIS_TRSM_U_UKR ) diff --git a/frame/ind/ukernels/trsm/bli_trsm1m_ukr_ref.c b/ref_kernels/ind/bli_trsm1m_ref.c similarity index 97% rename from frame/ind/ukernels/trsm/bli_trsm1m_ukr_ref.c rename to ref_kernels/ind/bli_trsm1m_ref.c index ab5617795..826a5ff6f 100644 --- a/frame/ind/ukernels/trsm/bli_trsm1m_ukr_ref.c +++ b/ref_kernels/ind/bli_trsm1m_ref.c @@ -36,9 +36,9 @@ #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ ctype* restrict a, \ ctype* restrict b, \ @@ -238,13 +238,13 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( trsm1m_l_ukr_ref ) +INSERT_GENTFUNCCO_BASIC2( trsm1m_l, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ ctype* restrict a, \ ctype* restrict b, \ @@ -444,5 +444,4 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( trsm1m_u_ukr_ref ) - +INSERT_GENTFUNCCO_BASIC2( trsm1m_u, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/ind/ukernels/trsm/bli_trsm3m1_ukr_ref.c b/ref_kernels/ind/bli_trsm3m1_ref.c similarity index 96% rename from frame/ind/ukernels/trsm/bli_trsm3m1_ukr_ref.c rename to ref_kernels/ind/bli_trsm3m1_ref.c index dcf17e239..b9b4dc955 100644 --- a/frame/ind/ukernels/trsm/bli_trsm3m1_ukr_ref.c +++ b/ref_kernels/ind/bli_trsm3m1_ref.c @@ -36,9 +36,9 @@ #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ ctype* restrict a, \ ctype* restrict b, \ @@ -156,13 +156,13 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( trsm3m1_l_ukr_ref ) +INSERT_GENTFUNCCO_BASIC2( trsm3m1_l, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ ctype* restrict a, \ ctype* restrict b, \ @@ -280,5 +280,4 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( trsm3m1_u_ukr_ref ) - +INSERT_GENTFUNCCO_BASIC2( trsm3m1_u, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/ind/ukernels/trsm/bli_trsm4m1_ukr_ref.c b/ref_kernels/ind/bli_trsm4m1_ref.c similarity index 96% rename from frame/ind/ukernels/trsm/bli_trsm4m1_ukr_ref.c rename to ref_kernels/ind/bli_trsm4m1_ref.c index 52cc224e4..63fd0546a 100644 --- a/frame/ind/ukernels/trsm/bli_trsm4m1_ukr_ref.c +++ b/ref_kernels/ind/bli_trsm4m1_ref.c @@ -36,9 +36,9 @@ #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ ctype* restrict a, \ ctype* restrict b, \ @@ -165,13 +165,13 @@ PASTEMAC(chr,fprintm)( stdout, "trsm4m1_l_ukr: b11p_i after", m, n, \ */ \ } -INSERT_GENTFUNCCO_BASIC0( trsm4m1_l_ukr_ref ) +INSERT_GENTFUNCCO_BASIC2( trsm4m1_l, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) #undef GENTFUNCCO -#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \ +#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, arch, suf ) \ \ -void PASTEMAC(ch,varname) \ +void PASTEMAC3(ch,opname,arch,suf) \ ( \ ctype* restrict a, \ ctype* restrict b, \ @@ -281,5 +281,4 @@ void PASTEMAC(ch,varname) \ } \ } -INSERT_GENTFUNCCO_BASIC0( trsm4m1_u_ukr_ref ) - +INSERT_GENTFUNCCO_BASIC2( trsm4m1_u, BLIS_CNAME_INFIX, BLIS_REF_SUFFIX ) diff --git a/frame/ind/ukernels/gemm/bli_gemmind_ukr_ref.h b/ref_kernels/ind/old/bli_gemmind_ukr_vir.h similarity index 86% rename from frame/ind/ukernels/gemm/bli_gemmind_ukr_ref.h rename to ref_kernels/ind/old/bli_gemmind_ukr_vir.h index 9b2dd5e5a..4f16747b5 100644 --- a/frame/ind/ukernels/gemm/bli_gemmind_ukr_ref.h +++ b/ref_kernels/ind/old/bli_gemmind_ukr_vir.h @@ -48,12 +48,10 @@ void PASTEMAC(ch,varname) \ cntx_t* restrict cntx \ ); -INSERT_GENTPROTCO_BASIC( gemm3mh_ukr_ref ) -INSERT_GENTPROTCO_BASIC( gemm3m3_ukr_ref ) -INSERT_GENTPROTCO_BASIC( gemm3m2_ukr_ref ) -INSERT_GENTPROTCO_BASIC( gemm3m1_ukr_ref ) -INSERT_GENTPROTCO_BASIC( gemm4mh_ukr_ref ) -INSERT_GENTPROTCO_BASIC( gemm4mb_ukr_ref ) -INSERT_GENTPROTCO_BASIC( gemm4m1_ukr_ref ) -INSERT_GENTPROTCO_BASIC( gemm1m_ukr_ref ) +INSERT_GENTPROTCO_BASIC( gemm3mh_ukr_vir ) +INSERT_GENTPROTCO_BASIC( gemm3m1_ukr_vir ) +INSERT_GENTPROTCO_BASIC( gemm4mh_ukr_vir ) +INSERT_GENTPROTCO_BASIC( gemm4mb_ukr_vir ) +INSERT_GENTPROTCO_BASIC( gemm4m1_ukr_vir ) +INSERT_GENTPROTCO_BASIC( gemm1m_ukr_vir ) diff --git a/frame/ind/ukernels/trsm/bli_gemmtrsmind_x_ukr_ref.h b/ref_kernels/ind/old/bli_gemmtrsmind_x_ukr_vir.h similarity index 88% rename from frame/ind/ukernels/trsm/bli_gemmtrsmind_x_ukr_ref.h rename to ref_kernels/ind/old/bli_gemmtrsmind_x_ukr_vir.h index 615482e41..5c2ae5b2d 100644 --- a/frame/ind/ukernels/trsm/bli_gemmtrsmind_x_ukr_ref.h +++ b/ref_kernels/ind/old/bli_gemmtrsmind_x_ukr_vir.h @@ -49,12 +49,12 @@ void PASTEMAC(ch,varname) \ cntx_t* restrict cntx \ ); -INSERT_GENTPROTCO_BASIC( gemmtrsm4m1_l_ukr_ref ) -INSERT_GENTPROTCO_BASIC( gemmtrsm4m1_u_ukr_ref ) +INSERT_GENTPROTCO_BASIC( gemmtrsm4m1_l_ukr_vir ) +INSERT_GENTPROTCO_BASIC( gemmtrsm4m1_u_ukr_vir ) -INSERT_GENTPROTCO_BASIC( gemmtrsm3m1_l_ukr_ref ) -INSERT_GENTPROTCO_BASIC( gemmtrsm3m1_u_ukr_ref ) +INSERT_GENTPROTCO_BASIC( gemmtrsm3m1_l_ukr_vir ) +INSERT_GENTPROTCO_BASIC( gemmtrsm3m1_u_ukr_vir ) -INSERT_GENTPROTCO_BASIC( gemmtrsm1m_l_ukr_ref ) -INSERT_GENTPROTCO_BASIC( gemmtrsm1m_u_ukr_ref ) +INSERT_GENTPROTCO_BASIC( gemmtrsm1m_l_ukr_vir ) +INSERT_GENTPROTCO_BASIC( gemmtrsm1m_u_ukr_vir ) diff --git a/ref_kernels/ind/old/bli_ind_cntx_defaults.c b/ref_kernels/ind/old/bli_ind_cntx_defaults.c new file mode 100644 index 000000000..12fc71960 --- /dev/null +++ b/ref_kernels/ind/old/bli_ind_cntx_defaults.c @@ -0,0 +1,1345 @@ +/* + + 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" + +typedef void (*cntx_init_ft)( cntx_t* cntx ); + +static void* l3_vir_ukr_init_fp[BLIS_NUM_IND_METHODS] = +{ +/* 3mh */ bli_cntx_set_default_l3_3mh_ukrs, +/* 3m1 */ bli_cntx_set_default_l3_3m1_ukrs, +/* 4mh */ bli_cntx_set_default_l3_4mh_ukrs, +/* 4mb */ bli_cntx_set_default_l3_4mb_ukrs, +/* 4m1 */ bli_cntx_set_default_l3_4m1_ukrs, +/* 1m */ bli_cntx_set_default_l3_1m_ukrs, +/* nat */ bli_cntx_set_default_l3_nat_ukrs +}; + +static void* packm_vir_init_fp[BLIS_NUM_IND_METHODS] = +{ +/* 3mh */ bli_cntx_set_default_packm_rih_kers, +/* 3m1 */ bli_cntx_set_default_packm_3mis_kers, +/* 4mh */ bli_cntx_set_default_packm_rih_kers, +/* 4mb */ bli_cntx_set_default_packm_4mi_kers, +/* 4m1 */ bli_cntx_set_default_packm_4mi_kers, +/* 1m */ bli_cntx_set_default_packm_1er_kers, +/* nat */ bli_cntx_set_default_packm_kers +}; + +// ----------------------------------------------------------------------------- + +void bli_cntx_set_default_l3_vir_ukrs( ind_t method, cntx_t* cntx ) +{ + cntx_init_ft func = l3_vir_ukr_init_fp[ method ]; + + func( cntx ); +} + +// ----------------------------------------------------------------------------- + +void bli_cntx_set_default_packm_ind_kers( ind_t method, cntx_t* cntx ) +{ + cntx_init_ft func = packm_vir_init_fp[ method ]; + + func( cntx ); +} + +// ----------------------------------------------------------------------------- + +void bli_func_init_default_3mh_gemm( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMM3MH_UKERNEL_VIR, + BLIS_ZGEMM3MH_UKERNEL_VIR + ); +} +void bli_func_init_default_3mh_gemmtrsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} +void bli_func_init_default_3mh_gemmtrsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} +void bli_func_init_default_3mh_trsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} +void bli_func_init_default_3mh_trsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} + +void bli_cntx_set_default_l3_3mh_ukrs( cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + + bli_func_init_default_3mh_gemm( &func[ BLIS_GEMM_UKR ] ); + bli_func_init_default_3mh_gemmtrsm_l( &func[ BLIS_GEMMTRSM_L_UKR ] ); + bli_func_init_default_3mh_gemmtrsm_u( &func[ BLIS_GEMMTRSM_U_UKR ] ); + bli_func_init_default_3mh_trsm_l( &func[ BLIS_TRSM_L_UKR ] ); + bli_func_init_default_3mh_trsm_u( &func[ BLIS_TRSM_U_UKR ] ); +} + +// ----------------------------------------------------------------------------- + +void bli_func_init_default_3m1_gemm( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMM3M1_UKERNEL_VIR, + BLIS_ZGEMM3M1_UKERNEL_VIR + ); +} +void bli_func_init_default_3m1_gemmtrsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMMTRSM3M1_L_UKERNEL_VIR, + BLIS_ZGEMMTRSM3M1_L_UKERNEL_VIR + ); +} +void bli_func_init_default_3m1_gemmtrsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMMTRSM3M1_U_UKERNEL_VIR, + BLIS_ZGEMMTRSM3M1_U_UKERNEL_VIR + ); +} +void bli_func_init_default_3m1_trsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CTRSM3M1_L_UKERNEL_VIR, + BLIS_ZTRSM3M1_L_UKERNEL_VIR + ); +} +void bli_func_init_default_3m1_trsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CTRSM3M1_U_UKERNEL_VIR, + BLIS_ZTRSM3M1_U_UKERNEL_VIR + ); +} + +void bli_cntx_set_default_l3_3m1_ukrs( cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + + bli_func_init_default_3m1_gemm( &func[ BLIS_GEMM_UKR ] ); + bli_func_init_default_3m1_gemmtrsm_l( &func[ BLIS_GEMMTRSM_L_UKR ] ); + bli_func_init_default_3m1_gemmtrsm_u( &func[ BLIS_GEMMTRSM_U_UKR ] ); + bli_func_init_default_3m1_trsm_l( &func[ BLIS_TRSM_L_UKR ] ); + bli_func_init_default_3m1_trsm_u( &func[ BLIS_TRSM_U_UKR ] ); +} + +// ----------------------------------------------------------------------------- + +void bli_func_init_default_4mh_gemm( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMM4MH_UKERNEL_VIR, + BLIS_ZGEMM4MH_UKERNEL_VIR + ); +} +void bli_func_init_default_4mh_gemmtrsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} +void bli_func_init_default_4mh_gemmtrsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} +void bli_func_init_default_4mh_trsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} +void bli_func_init_default_4mh_trsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} + +void bli_cntx_set_default_l3_4mh_ukrs( cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + + bli_func_init_default_4mh_gemm( &func[ BLIS_GEMM_UKR ] ); + bli_func_init_default_4mh_gemmtrsm_l( &func[ BLIS_GEMMTRSM_L_UKR ] ); + bli_func_init_default_4mh_gemmtrsm_u( &func[ BLIS_GEMMTRSM_U_UKR ] ); + bli_func_init_default_4mh_trsm_l( &func[ BLIS_TRSM_L_UKR ] ); + bli_func_init_default_4mh_trsm_u( &func[ BLIS_TRSM_U_UKR ] ); +} + +// ----------------------------------------------------------------------------- + +void bli_func_init_default_4mb_gemm( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMM4MB_UKERNEL_VIR, + BLIS_ZGEMM4MB_UKERNEL_VIR + ); +} +void bli_func_init_default_4mb_gemmtrsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} +void bli_func_init_default_4mb_gemmtrsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} +void bli_func_init_default_4mb_trsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} +void bli_func_init_default_4mb_trsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, NULL, NULL, NULL + ); +} + +void bli_cntx_set_default_l3_4mb_ukrs( cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + + bli_func_init_default_4mb_gemm( &func[ BLIS_GEMM_UKR ] ); + bli_func_init_default_4mb_gemmtrsm_l( &func[ BLIS_GEMMTRSM_L_UKR ] ); + bli_func_init_default_4mb_gemmtrsm_u( &func[ BLIS_GEMMTRSM_U_UKR ] ); + bli_func_init_default_4mb_trsm_l( &func[ BLIS_TRSM_L_UKR ] ); + bli_func_init_default_4mb_trsm_u( &func[ BLIS_TRSM_U_UKR ] ); +} + +// ----------------------------------------------------------------------------- + +void bli_func_init_default_4m1_gemm( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMM4M1_UKERNEL_VIR, + BLIS_ZGEMM4M1_UKERNEL_VIR + ); +} +void bli_func_init_default_4m1_gemmtrsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMMTRSM4M1_L_UKERNEL_VIR, + BLIS_ZGEMMTRSM4M1_L_UKERNEL_VIR + ); +} +void bli_func_init_default_4m1_gemmtrsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMMTRSM4M1_U_UKERNEL_VIR, + BLIS_ZGEMMTRSM4M1_U_UKERNEL_VIR + ); +} +void bli_func_init_default_4m1_trsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CTRSM4M1_L_UKERNEL_VIR, + BLIS_ZTRSM4M1_L_UKERNEL_VIR + ); +} +void bli_func_init_default_4m1_trsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CTRSM4M1_U_UKERNEL_VIR, + BLIS_ZTRSM4M1_U_UKERNEL_VIR + ); +} + +void bli_cntx_set_default_l3_4m1_ukrs( cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + + bli_func_init_default_4m1_gemm( &func[ BLIS_GEMM_UKR ] ); + bli_func_init_default_4m1_gemmtrsm_l( &func[ BLIS_GEMMTRSM_L_UKR ] ); + bli_func_init_default_4m1_gemmtrsm_u( &func[ BLIS_GEMMTRSM_U_UKR ] ); + bli_func_init_default_4m1_trsm_l( &func[ BLIS_TRSM_L_UKR ] ); + bli_func_init_default_4m1_trsm_u( &func[ BLIS_TRSM_U_UKR ] ); +} + +// ----------------------------------------------------------------------------- + +void bli_func_init_default_1m_gemm( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMM1M_UKERNEL_VIR, + BLIS_ZGEMM1M_UKERNEL_VIR + ); +} +void bli_func_init_default_1m_gemmtrsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMMTRSM1M_L_UKERNEL_VIR, + BLIS_ZGEMMTRSM1M_L_UKERNEL_VIR + ); +} +void bli_func_init_default_1m_gemmtrsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CGEMMTRSM1M_U_UKERNEL_VIR, + BLIS_ZGEMMTRSM1M_U_UKERNEL_VIR + ); +} +void bli_func_init_default_1m_trsm_l( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CTRSM1M_L_UKERNEL_VIR, + BLIS_ZTRSM1M_L_UKERNEL_VIR + ); +} +void bli_func_init_default_1m_trsm_u( func_t* func ) +{ + bli_func_init + ( + func, + NULL, + NULL, + BLIS_CTRSM1M_U_UKERNEL_VIR, + BLIS_ZTRSM1M_U_UKERNEL_VIR + ); +} +void bli_func_init_real_l3_1m_ukrs( cntx_t* cntx ) +{ + func_t* restrict gemm_nat_ukrs = bli_cntx_get_l3_nat_ukr( BLIS_GEMM, cntx ); + func_t* restrict gemm_vir_ukrs = bli_cntx_get_l3_vir_ukr( BLIS_GEMM, cntx ); + + bli_func_copy_dt( BLIS_FLOAT, gemm_nat_ukrs, BLIS_FLOAT, gemm_vir_ukrs ); + bli_func_copy_dt( BLIS_DOUBLE, gemm_nat_ukrs, BLIS_DOUBLE, gemm_vir_ukrs ); +} + +void bli_cntx_set_default_l3_1m_ukrs( cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_l3_vir_ukrs_buf( cntx ); + + bli_func_init_default_1m_gemm( &func[ BLIS_GEMM_UKR ] ); + bli_func_init_default_1m_gemmtrsm_l( &func[ BLIS_GEMMTRSM_L_UKR ] ); + bli_func_init_default_1m_gemmtrsm_u( &func[ BLIS_GEMMTRSM_U_UKR ] ); + bli_func_init_default_1m_trsm_l( &func[ BLIS_TRSM_L_UKR ] ); + bli_func_init_default_1m_trsm_u( &func[ BLIS_TRSM_U_UKR ] ); + + // For 1m, we employ an optimization which requires that we copy + // the native real domain gemm ukernel function pointers to the + // corresponding slots in the virtual gemm ukernel func_t. + bli_func_init_real_l3_1m_ukrs( cntx ); +} + +// ----------------------------------------------------------------------------- + +void bli_func_init_default_packm_0xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_1xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_2xk_1er( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_2XK_1ER_KERNEL_REF, BLIS_DPACKM_2XK_1ER_KERNEL_REF, + BLIS_CPACKM_2XK_1ER_KERNEL_REF, BLIS_ZPACKM_2XK_1ER_KERNEL_REF + ); +} +void bli_func_init_default_packm_3xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_4xk_1er( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_4XK_1ER_KERNEL_REF, BLIS_DPACKM_4XK_1ER_KERNEL_REF, + BLIS_CPACKM_4XK_1ER_KERNEL_REF, BLIS_ZPACKM_4XK_1ER_KERNEL_REF + ); +} +void bli_func_init_default_packm_5xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_6xk_1er( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_6XK_1ER_KERNEL_REF, BLIS_DPACKM_6XK_1ER_KERNEL_REF, + BLIS_CPACKM_6XK_1ER_KERNEL_REF, BLIS_ZPACKM_6XK_1ER_KERNEL_REF + ); +} +void bli_func_init_default_packm_7xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_8xk_1er( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_8XK_1ER_KERNEL_REF, BLIS_DPACKM_8XK_1ER_KERNEL_REF, + BLIS_CPACKM_8XK_1ER_KERNEL_REF, BLIS_ZPACKM_8XK_1ER_KERNEL_REF + ); +} +void bli_func_init_default_packm_9xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_10xk_1er( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_10XK_1ER_KERNEL_REF, BLIS_DPACKM_10XK_1ER_KERNEL_REF, + BLIS_CPACKM_10XK_1ER_KERNEL_REF, BLIS_ZPACKM_10XK_1ER_KERNEL_REF + ); +} +void bli_func_init_default_packm_11xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_12xk_1er( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_12XK_1ER_KERNEL_REF, BLIS_DPACKM_12XK_1ER_KERNEL_REF, + BLIS_CPACKM_12XK_1ER_KERNEL_REF, BLIS_ZPACKM_12XK_1ER_KERNEL_REF + ); +} +void bli_func_init_default_packm_13xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_14xk_1er( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_14XK_1ER_KERNEL_REF, BLIS_DPACKM_14XK_1ER_KERNEL_REF, + BLIS_CPACKM_14XK_1ER_KERNEL_REF, BLIS_ZPACKM_14XK_1ER_KERNEL_REF + ); +} +void bli_func_init_default_packm_15xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_16xk_1er( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_16XK_1ER_KERNEL_REF, BLIS_DPACKM_16XK_1ER_KERNEL_REF, + BLIS_CPACKM_16XK_1ER_KERNEL_REF, BLIS_ZPACKM_16XK_1ER_KERNEL_REF + ); +} +void bli_func_init_default_packm_17xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_18xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_19xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_20xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_21xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_22xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_23xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_24xk_1er( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_24XK_1ER_KERNEL_REF, BLIS_DPACKM_24XK_1ER_KERNEL_REF, + BLIS_CPACKM_24XK_1ER_KERNEL_REF, BLIS_ZPACKM_24XK_1ER_KERNEL_REF + ); +} +void bli_func_init_default_packm_25xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_26xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_27xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_28xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_29xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_30xk_1er( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_30XK_1ER_KERNEL_REF, BLIS_DPACKM_30XK_1ER_KERNEL_REF, + BLIS_CPACKM_30XK_1ER_KERNEL_REF, BLIS_ZPACKM_30XK_1ER_KERNEL_REF + ); +} +void bli_func_init_default_packm_31xk_1er( func_t* func ) +{ + bli_func_init_null( func ); +} + +void bli_cntx_set_default_packm_1er_kers( cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_packm_kers_buf( cntx ); + + bli_func_init_default_packm_0xk_1er( &func[ BLIS_PACKM_0XK_KER ] ); + bli_func_init_default_packm_1xk_1er( &func[ BLIS_PACKM_1XK_KER ] ); + bli_func_init_default_packm_2xk_1er( &func[ BLIS_PACKM_2XK_KER ] ); + bli_func_init_default_packm_3xk_1er( &func[ BLIS_PACKM_3XK_KER ] ); + bli_func_init_default_packm_4xk_1er( &func[ BLIS_PACKM_4XK_KER ] ); + bli_func_init_default_packm_5xk_1er( &func[ BLIS_PACKM_5XK_KER ] ); + bli_func_init_default_packm_6xk_1er( &func[ BLIS_PACKM_6XK_KER ] ); + bli_func_init_default_packm_7xk_1er( &func[ BLIS_PACKM_7XK_KER ] ); + bli_func_init_default_packm_8xk_1er( &func[ BLIS_PACKM_8XK_KER ] ); + bli_func_init_default_packm_9xk_1er( &func[ BLIS_PACKM_9XK_KER ] ); + bli_func_init_default_packm_10xk_1er( &func[ BLIS_PACKM_10XK_KER ] ); + bli_func_init_default_packm_11xk_1er( &func[ BLIS_PACKM_11XK_KER ] ); + bli_func_init_default_packm_12xk_1er( &func[ BLIS_PACKM_12XK_KER ] ); + bli_func_init_default_packm_13xk_1er( &func[ BLIS_PACKM_13XK_KER ] ); + bli_func_init_default_packm_14xk_1er( &func[ BLIS_PACKM_14XK_KER ] ); + bli_func_init_default_packm_15xk_1er( &func[ BLIS_PACKM_15XK_KER ] ); + bli_func_init_default_packm_16xk_1er( &func[ BLIS_PACKM_16XK_KER ] ); + bli_func_init_default_packm_17xk_1er( &func[ BLIS_PACKM_17XK_KER ] ); + bli_func_init_default_packm_18xk_1er( &func[ BLIS_PACKM_18XK_KER ] ); + bli_func_init_default_packm_19xk_1er( &func[ BLIS_PACKM_19XK_KER ] ); + bli_func_init_default_packm_20xk_1er( &func[ BLIS_PACKM_20XK_KER ] ); + bli_func_init_default_packm_21xk_1er( &func[ BLIS_PACKM_21XK_KER ] ); + bli_func_init_default_packm_22xk_1er( &func[ BLIS_PACKM_22XK_KER ] ); + bli_func_init_default_packm_23xk_1er( &func[ BLIS_PACKM_23XK_KER ] ); + bli_func_init_default_packm_24xk_1er( &func[ BLIS_PACKM_24XK_KER ] ); + bli_func_init_default_packm_25xk_1er( &func[ BLIS_PACKM_25XK_KER ] ); + bli_func_init_default_packm_26xk_1er( &func[ BLIS_PACKM_26XK_KER ] ); + bli_func_init_default_packm_27xk_1er( &func[ BLIS_PACKM_27XK_KER ] ); + bli_func_init_default_packm_28xk_1er( &func[ BLIS_PACKM_28XK_KER ] ); + bli_func_init_default_packm_29xk_1er( &func[ BLIS_PACKM_29XK_KER ] ); + bli_func_init_default_packm_30xk_1er( &func[ BLIS_PACKM_30XK_KER ] ); + bli_func_init_default_packm_31xk_1er( &func[ BLIS_PACKM_31XK_KER ] ); +} + +// ----------------------------------------------------------------------------- + +void bli_func_init_default_packm_0xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_1xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_2xk_3mis( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_2XK_3MIS_KERNEL_REF, BLIS_DPACKM_2XK_3MIS_KERNEL_REF, + BLIS_CPACKM_2XK_3MIS_KERNEL_REF, BLIS_ZPACKM_2XK_3MIS_KERNEL_REF + ); +} +void bli_func_init_default_packm_3xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_4xk_3mis( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_4XK_3MIS_KERNEL_REF, BLIS_DPACKM_4XK_3MIS_KERNEL_REF, + BLIS_CPACKM_4XK_3MIS_KERNEL_REF, BLIS_ZPACKM_4XK_3MIS_KERNEL_REF + ); +} +void bli_func_init_default_packm_5xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_6xk_3mis( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_6XK_3MIS_KERNEL_REF, BLIS_DPACKM_6XK_3MIS_KERNEL_REF, + BLIS_CPACKM_6XK_3MIS_KERNEL_REF, BLIS_ZPACKM_6XK_3MIS_KERNEL_REF + ); +} +void bli_func_init_default_packm_7xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_8xk_3mis( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_8XK_3MIS_KERNEL_REF, BLIS_DPACKM_8XK_3MIS_KERNEL_REF, + BLIS_CPACKM_8XK_3MIS_KERNEL_REF, BLIS_ZPACKM_8XK_3MIS_KERNEL_REF + ); +} +void bli_func_init_default_packm_9xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_10xk_3mis( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_10XK_3MIS_KERNEL_REF, BLIS_DPACKM_10XK_3MIS_KERNEL_REF, + BLIS_CPACKM_10XK_3MIS_KERNEL_REF, BLIS_ZPACKM_10XK_3MIS_KERNEL_REF + ); +} +void bli_func_init_default_packm_11xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_12xk_3mis( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_12XK_3MIS_KERNEL_REF, BLIS_DPACKM_12XK_3MIS_KERNEL_REF, + BLIS_CPACKM_12XK_3MIS_KERNEL_REF, BLIS_ZPACKM_12XK_3MIS_KERNEL_REF + ); +} +void bli_func_init_default_packm_13xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_14xk_3mis( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_14XK_3MIS_KERNEL_REF, BLIS_DPACKM_14XK_3MIS_KERNEL_REF, + BLIS_CPACKM_14XK_3MIS_KERNEL_REF, BLIS_ZPACKM_14XK_3MIS_KERNEL_REF + ); +} +void bli_func_init_default_packm_15xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_16xk_3mis( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_16XK_3MIS_KERNEL_REF, BLIS_DPACKM_16XK_3MIS_KERNEL_REF, + BLIS_CPACKM_16XK_3MIS_KERNEL_REF, BLIS_ZPACKM_16XK_3MIS_KERNEL_REF + ); +} +void bli_func_init_default_packm_17xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_18xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_19xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_20xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_21xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_22xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_23xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_24xk_3mis( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_24XK_3MIS_KERNEL_REF, BLIS_DPACKM_24XK_3MIS_KERNEL_REF, + BLIS_CPACKM_24XK_3MIS_KERNEL_REF, BLIS_ZPACKM_24XK_3MIS_KERNEL_REF + ); +} +void bli_func_init_default_packm_25xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_26xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_27xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_28xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_29xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_30xk_3mis( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_30XK_3MIS_KERNEL_REF, BLIS_DPACKM_30XK_3MIS_KERNEL_REF, + BLIS_CPACKM_30XK_3MIS_KERNEL_REF, BLIS_ZPACKM_30XK_3MIS_KERNEL_REF + ); +} +void bli_func_init_default_packm_31xk_3mis( func_t* func ) +{ + bli_func_init_null( func ); +} + +void bli_cntx_set_default_packm_3mis_kers( cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_packm_kers_buf( cntx ); + + bli_func_init_default_packm_0xk_3mis( &func[ BLIS_PACKM_0XK_KER ] ); + bli_func_init_default_packm_1xk_3mis( &func[ BLIS_PACKM_1XK_KER ] ); + bli_func_init_default_packm_2xk_3mis( &func[ BLIS_PACKM_2XK_KER ] ); + bli_func_init_default_packm_3xk_3mis( &func[ BLIS_PACKM_3XK_KER ] ); + bli_func_init_default_packm_4xk_3mis( &func[ BLIS_PACKM_4XK_KER ] ); + bli_func_init_default_packm_5xk_3mis( &func[ BLIS_PACKM_5XK_KER ] ); + bli_func_init_default_packm_6xk_3mis( &func[ BLIS_PACKM_6XK_KER ] ); + bli_func_init_default_packm_7xk_3mis( &func[ BLIS_PACKM_7XK_KER ] ); + bli_func_init_default_packm_8xk_3mis( &func[ BLIS_PACKM_8XK_KER ] ); + bli_func_init_default_packm_9xk_3mis( &func[ BLIS_PACKM_9XK_KER ] ); + bli_func_init_default_packm_10xk_3mis( &func[ BLIS_PACKM_10XK_KER ] ); + bli_func_init_default_packm_11xk_3mis( &func[ BLIS_PACKM_11XK_KER ] ); + bli_func_init_default_packm_12xk_3mis( &func[ BLIS_PACKM_12XK_KER ] ); + bli_func_init_default_packm_13xk_3mis( &func[ BLIS_PACKM_13XK_KER ] ); + bli_func_init_default_packm_14xk_3mis( &func[ BLIS_PACKM_14XK_KER ] ); + bli_func_init_default_packm_15xk_3mis( &func[ BLIS_PACKM_15XK_KER ] ); + bli_func_init_default_packm_16xk_3mis( &func[ BLIS_PACKM_16XK_KER ] ); + bli_func_init_default_packm_17xk_3mis( &func[ BLIS_PACKM_17XK_KER ] ); + bli_func_init_default_packm_18xk_3mis( &func[ BLIS_PACKM_18XK_KER ] ); + bli_func_init_default_packm_19xk_3mis( &func[ BLIS_PACKM_19XK_KER ] ); + bli_func_init_default_packm_20xk_3mis( &func[ BLIS_PACKM_20XK_KER ] ); + bli_func_init_default_packm_21xk_3mis( &func[ BLIS_PACKM_21XK_KER ] ); + bli_func_init_default_packm_22xk_3mis( &func[ BLIS_PACKM_22XK_KER ] ); + bli_func_init_default_packm_23xk_3mis( &func[ BLIS_PACKM_23XK_KER ] ); + bli_func_init_default_packm_24xk_3mis( &func[ BLIS_PACKM_24XK_KER ] ); + bli_func_init_default_packm_25xk_3mis( &func[ BLIS_PACKM_25XK_KER ] ); + bli_func_init_default_packm_26xk_3mis( &func[ BLIS_PACKM_26XK_KER ] ); + bli_func_init_default_packm_27xk_3mis( &func[ BLIS_PACKM_27XK_KER ] ); + bli_func_init_default_packm_28xk_3mis( &func[ BLIS_PACKM_28XK_KER ] ); + bli_func_init_default_packm_29xk_3mis( &func[ BLIS_PACKM_29XK_KER ] ); + bli_func_init_default_packm_30xk_3mis( &func[ BLIS_PACKM_30XK_KER ] ); + bli_func_init_default_packm_31xk_3mis( &func[ BLIS_PACKM_31XK_KER ] ); +} + +// ----------------------------------------------------------------------------- + +void bli_func_init_default_packm_0xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_1xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_2xk_4mi( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_2XK_4MI_KERNEL_REF, BLIS_DPACKM_2XK_4MI_KERNEL_REF, + BLIS_CPACKM_2XK_4MI_KERNEL_REF, BLIS_ZPACKM_2XK_4MI_KERNEL_REF + ); +} +void bli_func_init_default_packm_3xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_4xk_4mi( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_4XK_4MI_KERNEL_REF, BLIS_DPACKM_4XK_4MI_KERNEL_REF, + BLIS_CPACKM_4XK_4MI_KERNEL_REF, BLIS_ZPACKM_4XK_4MI_KERNEL_REF + ); +} +void bli_func_init_default_packm_5xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_6xk_4mi( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_6XK_4MI_KERNEL_REF, BLIS_DPACKM_6XK_4MI_KERNEL_REF, + BLIS_CPACKM_6XK_4MI_KERNEL_REF, BLIS_ZPACKM_6XK_4MI_KERNEL_REF + ); +} +void bli_func_init_default_packm_7xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_8xk_4mi( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_8XK_4MI_KERNEL_REF, BLIS_DPACKM_8XK_4MI_KERNEL_REF, + BLIS_CPACKM_8XK_4MI_KERNEL_REF, BLIS_ZPACKM_8XK_4MI_KERNEL_REF + ); +} +void bli_func_init_default_packm_9xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_10xk_4mi( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_10XK_4MI_KERNEL_REF, BLIS_DPACKM_10XK_4MI_KERNEL_REF, + BLIS_CPACKM_10XK_4MI_KERNEL_REF, BLIS_ZPACKM_10XK_4MI_KERNEL_REF + ); +} +void bli_func_init_default_packm_11xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_12xk_4mi( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_12XK_4MI_KERNEL_REF, BLIS_DPACKM_12XK_4MI_KERNEL_REF, + BLIS_CPACKM_12XK_4MI_KERNEL_REF, BLIS_ZPACKM_12XK_4MI_KERNEL_REF + ); +} +void bli_func_init_default_packm_13xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_14xk_4mi( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_14XK_4MI_KERNEL_REF, BLIS_DPACKM_14XK_4MI_KERNEL_REF, + BLIS_CPACKM_14XK_4MI_KERNEL_REF, BLIS_ZPACKM_14XK_4MI_KERNEL_REF + ); +} +void bli_func_init_default_packm_15xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_16xk_4mi( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_16XK_4MI_KERNEL_REF, BLIS_DPACKM_16XK_4MI_KERNEL_REF, + BLIS_CPACKM_16XK_4MI_KERNEL_REF, BLIS_ZPACKM_16XK_4MI_KERNEL_REF + ); +} +void bli_func_init_default_packm_17xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_18xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_19xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_20xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_21xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_22xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_23xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_24xk_4mi( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_24XK_4MI_KERNEL_REF, BLIS_DPACKM_24XK_4MI_KERNEL_REF, + BLIS_CPACKM_24XK_4MI_KERNEL_REF, BLIS_ZPACKM_24XK_4MI_KERNEL_REF + ); +} +void bli_func_init_default_packm_25xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_26xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_27xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_28xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_29xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_30xk_4mi( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_30XK_4MI_KERNEL_REF, BLIS_DPACKM_30XK_4MI_KERNEL_REF, + BLIS_CPACKM_30XK_4MI_KERNEL_REF, BLIS_ZPACKM_30XK_4MI_KERNEL_REF + ); +} +void bli_func_init_default_packm_31xk_4mi( func_t* func ) +{ + bli_func_init_null( func ); +} + +void bli_cntx_set_default_packm_4mi_kers( cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_packm_kers_buf( cntx ); + + bli_func_init_default_packm_0xk_4mi( &func[ BLIS_PACKM_0XK_KER ] ); + bli_func_init_default_packm_1xk_4mi( &func[ BLIS_PACKM_1XK_KER ] ); + bli_func_init_default_packm_2xk_4mi( &func[ BLIS_PACKM_2XK_KER ] ); + bli_func_init_default_packm_3xk_4mi( &func[ BLIS_PACKM_3XK_KER ] ); + bli_func_init_default_packm_4xk_4mi( &func[ BLIS_PACKM_4XK_KER ] ); + bli_func_init_default_packm_5xk_4mi( &func[ BLIS_PACKM_5XK_KER ] ); + bli_func_init_default_packm_6xk_4mi( &func[ BLIS_PACKM_6XK_KER ] ); + bli_func_init_default_packm_7xk_4mi( &func[ BLIS_PACKM_7XK_KER ] ); + bli_func_init_default_packm_8xk_4mi( &func[ BLIS_PACKM_8XK_KER ] ); + bli_func_init_default_packm_9xk_4mi( &func[ BLIS_PACKM_9XK_KER ] ); + bli_func_init_default_packm_10xk_4mi( &func[ BLIS_PACKM_10XK_KER ] ); + bli_func_init_default_packm_11xk_4mi( &func[ BLIS_PACKM_11XK_KER ] ); + bli_func_init_default_packm_12xk_4mi( &func[ BLIS_PACKM_12XK_KER ] ); + bli_func_init_default_packm_13xk_4mi( &func[ BLIS_PACKM_13XK_KER ] ); + bli_func_init_default_packm_14xk_4mi( &func[ BLIS_PACKM_14XK_KER ] ); + bli_func_init_default_packm_15xk_4mi( &func[ BLIS_PACKM_15XK_KER ] ); + bli_func_init_default_packm_16xk_4mi( &func[ BLIS_PACKM_16XK_KER ] ); + bli_func_init_default_packm_17xk_4mi( &func[ BLIS_PACKM_17XK_KER ] ); + bli_func_init_default_packm_18xk_4mi( &func[ BLIS_PACKM_18XK_KER ] ); + bli_func_init_default_packm_19xk_4mi( &func[ BLIS_PACKM_19XK_KER ] ); + bli_func_init_default_packm_20xk_4mi( &func[ BLIS_PACKM_20XK_KER ] ); + bli_func_init_default_packm_21xk_4mi( &func[ BLIS_PACKM_21XK_KER ] ); + bli_func_init_default_packm_22xk_4mi( &func[ BLIS_PACKM_22XK_KER ] ); + bli_func_init_default_packm_23xk_4mi( &func[ BLIS_PACKM_23XK_KER ] ); + bli_func_init_default_packm_24xk_4mi( &func[ BLIS_PACKM_24XK_KER ] ); + bli_func_init_default_packm_25xk_4mi( &func[ BLIS_PACKM_25XK_KER ] ); + bli_func_init_default_packm_26xk_4mi( &func[ BLIS_PACKM_26XK_KER ] ); + bli_func_init_default_packm_27xk_4mi( &func[ BLIS_PACKM_27XK_KER ] ); + bli_func_init_default_packm_28xk_4mi( &func[ BLIS_PACKM_28XK_KER ] ); + bli_func_init_default_packm_29xk_4mi( &func[ BLIS_PACKM_29XK_KER ] ); + bli_func_init_default_packm_30xk_4mi( &func[ BLIS_PACKM_30XK_KER ] ); + bli_func_init_default_packm_31xk_4mi( &func[ BLIS_PACKM_31XK_KER ] ); +} + +// ----------------------------------------------------------------------------- + +void bli_func_init_default_packm_0xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_1xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_2xk_rih( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_2XK_RIH_KERNEL_REF, BLIS_DPACKM_2XK_RIH_KERNEL_REF, + BLIS_CPACKM_2XK_RIH_KERNEL_REF, BLIS_ZPACKM_2XK_RIH_KERNEL_REF + ); +} +void bli_func_init_default_packm_3xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_4xk_rih( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_4XK_RIH_KERNEL_REF, BLIS_DPACKM_4XK_RIH_KERNEL_REF, + BLIS_CPACKM_4XK_RIH_KERNEL_REF, BLIS_ZPACKM_4XK_RIH_KERNEL_REF + ); +} +void bli_func_init_default_packm_5xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_6xk_rih( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_6XK_RIH_KERNEL_REF, BLIS_DPACKM_6XK_RIH_KERNEL_REF, + BLIS_CPACKM_6XK_RIH_KERNEL_REF, BLIS_ZPACKM_6XK_RIH_KERNEL_REF + ); +} +void bli_func_init_default_packm_7xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_8xk_rih( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_8XK_RIH_KERNEL_REF, BLIS_DPACKM_8XK_RIH_KERNEL_REF, + BLIS_CPACKM_8XK_RIH_KERNEL_REF, BLIS_ZPACKM_8XK_RIH_KERNEL_REF + ); +} +void bli_func_init_default_packm_9xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_10xk_rih( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_10XK_RIH_KERNEL_REF, BLIS_DPACKM_10XK_RIH_KERNEL_REF, + BLIS_CPACKM_10XK_RIH_KERNEL_REF, BLIS_ZPACKM_10XK_RIH_KERNEL_REF + ); +} +void bli_func_init_default_packm_11xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_12xk_rih( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_12XK_RIH_KERNEL_REF, BLIS_DPACKM_12XK_RIH_KERNEL_REF, + BLIS_CPACKM_12XK_RIH_KERNEL_REF, BLIS_ZPACKM_12XK_RIH_KERNEL_REF + ); +} +void bli_func_init_default_packm_13xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_14xk_rih( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_14XK_RIH_KERNEL_REF, BLIS_DPACKM_14XK_RIH_KERNEL_REF, + BLIS_CPACKM_14XK_RIH_KERNEL_REF, BLIS_ZPACKM_14XK_RIH_KERNEL_REF + ); +} +void bli_func_init_default_packm_15xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_16xk_rih( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_16XK_RIH_KERNEL_REF, BLIS_DPACKM_16XK_RIH_KERNEL_REF, + BLIS_CPACKM_16XK_RIH_KERNEL_REF, BLIS_ZPACKM_16XK_RIH_KERNEL_REF + ); +} +void bli_func_init_default_packm_17xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_18xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_19xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_20xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_21xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_22xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_23xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_24xk_rih( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_24XK_RIH_KERNEL_REF, BLIS_DPACKM_24XK_RIH_KERNEL_REF, + BLIS_CPACKM_24XK_RIH_KERNEL_REF, BLIS_ZPACKM_24XK_RIH_KERNEL_REF + ); +} +void bli_func_init_default_packm_25xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_26xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_27xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_28xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_29xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} +void bli_func_init_default_packm_30xk_rih( func_t* func ) +{ + bli_func_init + ( + func, + BLIS_SPACKM_30XK_RIH_KERNEL_REF, BLIS_DPACKM_30XK_RIH_KERNEL_REF, + BLIS_CPACKM_30XK_RIH_KERNEL_REF, BLIS_ZPACKM_30XK_RIH_KERNEL_REF + ); +} +void bli_func_init_default_packm_31xk_rih( func_t* func ) +{ + bli_func_init_null( func ); +} + +void bli_cntx_set_default_packm_rih_kers( cntx_t* cntx ) +{ + func_t* funcs = bli_cntx_packm_kers_buf( cntx ); + + bli_func_init_default_packm_0xk_rih( &func[ BLIS_PACKM_0XK_KER ] ); + bli_func_init_default_packm_1xk_rih( &func[ BLIS_PACKM_1XK_KER ] ); + bli_func_init_default_packm_2xk_rih( &func[ BLIS_PACKM_2XK_KER ] ); + bli_func_init_default_packm_3xk_rih( &func[ BLIS_PACKM_3XK_KER ] ); + bli_func_init_default_packm_4xk_rih( &func[ BLIS_PACKM_4XK_KER ] ); + bli_func_init_default_packm_5xk_rih( &func[ BLIS_PACKM_5XK_KER ] ); + bli_func_init_default_packm_6xk_rih( &func[ BLIS_PACKM_6XK_KER ] ); + bli_func_init_default_packm_7xk_rih( &func[ BLIS_PACKM_7XK_KER ] ); + bli_func_init_default_packm_8xk_rih( &func[ BLIS_PACKM_8XK_KER ] ); + bli_func_init_default_packm_9xk_rih( &func[ BLIS_PACKM_9XK_KER ] ); + bli_func_init_default_packm_10xk_rih( &func[ BLIS_PACKM_10XK_KER ] ); + bli_func_init_default_packm_11xk_rih( &func[ BLIS_PACKM_11XK_KER ] ); + bli_func_init_default_packm_12xk_rih( &func[ BLIS_PACKM_12XK_KER ] ); + bli_func_init_default_packm_13xk_rih( &func[ BLIS_PACKM_13XK_KER ] ); + bli_func_init_default_packm_14xk_rih( &func[ BLIS_PACKM_14XK_KER ] ); + bli_func_init_default_packm_15xk_rih( &func[ BLIS_PACKM_15XK_KER ] ); + bli_func_init_default_packm_16xk_rih( &func[ BLIS_PACKM_16XK_KER ] ); + bli_func_init_default_packm_17xk_rih( &func[ BLIS_PACKM_17XK_KER ] ); + bli_func_init_default_packm_18xk_rih( &func[ BLIS_PACKM_18XK_KER ] ); + bli_func_init_default_packm_19xk_rih( &func[ BLIS_PACKM_19XK_KER ] ); + bli_func_init_default_packm_20xk_rih( &func[ BLIS_PACKM_20XK_KER ] ); + bli_func_init_default_packm_21xk_rih( &func[ BLIS_PACKM_21XK_KER ] ); + bli_func_init_default_packm_22xk_rih( &func[ BLIS_PACKM_22XK_KER ] ); + bli_func_init_default_packm_23xk_rih( &func[ BLIS_PACKM_23XK_KER ] ); + bli_func_init_default_packm_24xk_rih( &func[ BLIS_PACKM_24XK_KER ] ); + bli_func_init_default_packm_25xk_rih( &func[ BLIS_PACKM_25XK_KER ] ); + bli_func_init_default_packm_26xk_rih( &func[ BLIS_PACKM_26XK_KER ] ); + bli_func_init_default_packm_27xk_rih( &func[ BLIS_PACKM_27XK_KER ] ); + bli_func_init_default_packm_28xk_rih( &func[ BLIS_PACKM_28XK_KER ] ); + bli_func_init_default_packm_29xk_rih( &func[ BLIS_PACKM_29XK_KER ] ); + bli_func_init_default_packm_30xk_rih( &func[ BLIS_PACKM_30XK_KER ] ); + bli_func_init_default_packm_31xk_rih( &func[ BLIS_PACKM_31XK_KER ] ); +} + diff --git a/frame/ind/ukernels/trsm/bli_trsmind_x_ukr_ref.h b/ref_kernels/ind/old/bli_trsmind_x_ukr_vir.h similarity index 88% rename from frame/ind/ukernels/trsm/bli_trsmind_x_ukr_ref.h rename to ref_kernels/ind/old/bli_trsmind_x_ukr_vir.h index 77d502a3c..69fcb4393 100644 --- a/frame/ind/ukernels/trsm/bli_trsmind_x_ukr_ref.h +++ b/ref_kernels/ind/old/bli_trsmind_x_ukr_vir.h @@ -45,12 +45,12 @@ void PASTEMAC(ch,varname) \ cntx_t* restrict cntx \ ); -INSERT_GENTPROTCO_BASIC( trsm4m1_l_ukr_ref ) -INSERT_GENTPROTCO_BASIC( trsm4m1_u_ukr_ref ) +INSERT_GENTPROTCO_BASIC( trsm4m1_l_ukr_vir ) +INSERT_GENTPROTCO_BASIC( trsm4m1_u_ukr_vir ) -INSERT_GENTPROTCO_BASIC( trsm3m1_l_ukr_ref ) -INSERT_GENTPROTCO_BASIC( trsm3m1_u_ukr_ref ) +INSERT_GENTPROTCO_BASIC( trsm3m1_l_ukr_vir ) +INSERT_GENTPROTCO_BASIC( trsm3m1_u_ukr_vir ) -INSERT_GENTPROTCO_BASIC( trsm1m_l_ukr_ref ) -INSERT_GENTPROTCO_BASIC( trsm1m_u_ukr_ref ) +INSERT_GENTPROTCO_BASIC( trsm1m_l_ukr_vir ) +INSERT_GENTPROTCO_BASIC( trsm1m_u_ukr_vir ) diff --git a/test/3m4m/Makefile b/test/3m4m/Makefile index 433e745a7..761a114dd 100644 --- a/test/3m4m/Makefile +++ b/test/3m4m/Makefile @@ -52,25 +52,25 @@ # -# --- Makefile initialization -------------------------------------------------- +# --- Distribution path override ----------------------------------------------- +# + +# Override the DIST_PATH value obtained from config.mk (via common.mk) by +# defining it here (prior to including the common.mk). +DIST_PATH := ../.. + + + +# +# --- Include common makefile definitions -------------------------------------- # # Define the name of the common makefile fragment. -COMMON_MK_FILE := common.mk - -# Important locations and directory names. -RELPATH := ../.. -CONFIG_DIR := config - - - -# -# --- Include makefile configuration file -------------------------------------- -# +COMMON_MK_FILE := common.mk # Construct the path to the makefile configuration file that was generated by # the configure script. -COMMON_MK_PATH := $(RELPATH)/$(COMMON_MK_FILE) +COMMON_MK_PATH := $(DIST_PATH)/$(COMMON_MK_FILE) # Include the common makefile fragment. -include $(COMMON_MK_PATH) @@ -83,14 +83,6 @@ else COMMON_MK_PRESENT := no endif -# Override the DIST_PATH value obtained from config.mk, since it is relative -# to the build directory. -DIST_PATH := .. - -# Now we have access to CONFIG_NAME, which tells us which sub-directory of the -# config directory to use as our configuration. -CONFIG_PATH := $(RELPATH)/$(CONFIG_DIR)/$(CONFIG_NAME) - # @@ -184,8 +176,6 @@ BLA_DEF := -DBLAS # Complex implementation type D3MHW := -DIND=BLIS_3MH -D3M3 := -DIND=BLIS_3M3 -D3M2 := -DIND=BLIS_3M2 D3M1 := -DIND=BLIS_3M1 D4MHW := -DIND=BLIS_4MH D4M1B := -DIND=BLIS_4M1B @@ -195,8 +185,6 @@ DNAT := -DIND=BLIS_NAT # Implementation string STR_3MHW := -DSTR=\"3mhw\" -STR_3M3 := -DSTR=\"3m3\" -STR_3M2 := -DSTR=\"3m2\" STR_3M1 := -DSTR=\"3m1\" STR_4MHW := -DSTR=\"4mhw\" STR_4M1B := -DSTR=\"4m1b\" @@ -250,10 +238,6 @@ blis-gemm-st: \ \ test_cgemm_3mhw_blis_st.x \ test_zgemm_3mhw_blis_st.x \ - test_cgemm_3m3_blis_st.x \ - test_zgemm_3m3_blis_st.x \ - test_cgemm_3m2_blis_st.x \ - test_zgemm_3m2_blis_st.x \ test_cgemm_3m1_blis_st.x \ test_zgemm_3m1_blis_st.x \ test_cgemm_4mhw_blis_st.x \ @@ -273,10 +257,6 @@ blis-gemm-mt: \ \ test_cgemm_3mhw_blis_mt.x \ test_zgemm_3mhw_blis_mt.x \ - test_cgemm_3m3_blis_mt.x \ - test_zgemm_3m3_blis_mt.x \ - test_cgemm_3m2_blis_mt.x \ - test_zgemm_3m2_blis_mt.x \ test_cgemm_3m1_blis_mt.x \ test_zgemm_3m1_blis_mt.x \ test_cgemm_4mhw_blis_mt.x \ @@ -346,32 +326,6 @@ test_z%_3mhw_blis_mt.o: test_%.c test_c%_3mhw_blis_mt.o: test_%.c $(CC) $(CFLAGS) $(PDEF_MT) $(DT_C) $(BLI_DEF) $(D3MHW) $(STR_3MHW) $(STR_MT) -c $< -o $@ -# blis 3m3 -test_z%_3m3_blis_st.o: test_%.c - $(CC) $(CFLAGS) $(PDEF_ST) $(DT_Z) $(BLI_DEF) $(D3M3) $(STR_3M3) $(STR_ST) -c $< -o $@ - -test_c%_3m3_blis_st.o: test_%.c - $(CC) $(CFLAGS) $(PDEF_ST) $(DT_C) $(BLI_DEF) $(D3M3) $(STR_3M3) $(STR_ST) -c $< -o $@ - -test_z%_3m3_blis_mt.o: test_%.c - $(CC) $(CFLAGS) $(PDEF_MT) $(DT_Z) $(BLI_DEF) $(D3M3) $(STR_3M3) $(STR_MT) -c $< -o $@ - -test_c%_3m3_blis_mt.o: test_%.c - $(CC) $(CFLAGS) $(PDEF_MT) $(DT_C) $(BLI_DEF) $(D3M3) $(STR_3M3) $(STR_MT) -c $< -o $@ - -# blis 3m2 -test_z%_3m2_blis_st.o: test_%.c - $(CC) $(CFLAGS) $(PDEF_ST) $(DT_Z) $(BLI_DEF) $(D3M2) $(STR_3M2) $(STR_ST) -c $< -o $@ - -test_c%_3m2_blis_st.o: test_%.c - $(CC) $(CFLAGS) $(PDEF_ST) $(DT_C) $(BLI_DEF) $(D3M2) $(STR_3M2) $(STR_ST) -c $< -o $@ - -test_z%_3m2_blis_mt.o: test_%.c - $(CC) $(CFLAGS) $(PDEF_MT) $(DT_Z) $(BLI_DEF) $(D3M2) $(STR_3M2) $(STR_MT) -c $< -o $@ - -test_c%_3m2_blis_mt.o: test_%.c - $(CC) $(CFLAGS) $(PDEF_MT) $(DT_C) $(BLI_DEF) $(D3M2) $(STR_3M2) $(STR_MT) -c $< -o $@ - # blis 3m1 test_z%_3m1_blis_st.o: test_%.c $(CC) $(CFLAGS) $(PDEF_ST) $(DT_Z) $(BLI_DEF) $(D3M1) $(STR_3M1) $(STR_ST) -c $< -o $@ diff --git a/test/3m4m/test_gemm.c b/test/3m4m/test_gemm.c index 1f9ea036c..2b1c20d30 100644 --- a/test/3m4m/test_gemm.c +++ b/test/3m4m/test_gemm.c @@ -87,7 +87,7 @@ int main( int argc, char** argv ) #if 1 - cntx_t cntx; + cntx_t* cntx; ind_t ind_mod = ind; @@ -95,10 +95,10 @@ int main( int argc, char** argv ) if ( ind == BLIS_3M1 ) ind_mod = BLIS_1M; // Initialize a context for the current induced method and datatype. - bli_gemmind_cntx_init( ind_mod, dt, &cntx ); + cntx = bli_gks_query_ind_cntx( ind_mod, dt ); // Set k to the kc blocksize for the current datatype. - k_input = bli_cntx_get_blksz_def_dt( dt, BLIS_KC, &cntx ); + k_input = bli_cntx_get_blksz_def_dt( dt, BLIS_KC, cntx ); #elif 0 diff --git a/test/Makefile b/test/Makefile index 1472ae4b5..9906d6668 100644 --- a/test/Makefile +++ b/test/Makefile @@ -51,25 +51,25 @@ # -# --- Makefile initialization -------------------------------------------------- +# --- Distribution path override ----------------------------------------------- +# + +# Override the DIST_PATH value obtained from config.mk (via common.mk) by +# defining it here (prior to including the common.mk). +DIST_PATH := .. + + + +# +# --- Include common makefile definitions -------------------------------------- # # Define the name of the common makefile fragment. -COMMON_MK_FILE := common.mk - -# Important locations and directory names. -RELPATH := .. -CONFIG_DIR := config - - - -# -# --- Include makefile configuration file -------------------------------------- -# +COMMON_MK_FILE := common.mk # Construct the path to the makefile configuration file that was generated by # the configure script. -COMMON_MK_PATH := $(RELPATH)/$(COMMON_MK_FILE) +COMMON_MK_PATH := $(DIST_PATH)/$(COMMON_MK_FILE) # Include the common makefile fragment. -include $(COMMON_MK_PATH) @@ -82,14 +82,6 @@ else COMMON_MK_PRESENT := no endif -# Override the DIST_PATH value obtained from config.mk, since it is relative -# to the build directory. -DIST_PATH := .. - -# Now we have access to CONFIG_NAME, which tells us which sub-directory of the -# config directory to use as our configuration. -CONFIG_PATH := $(RELPATH)/$(CONFIG_DIR)/$(CONFIG_NAME) - # diff --git a/test/exec_sizes/Makefile b/test/exec_sizes/Makefile index 684ba9ba8..caddb0ef4 100644 --- a/test/exec_sizes/Makefile +++ b/test/exec_sizes/Makefile @@ -51,64 +51,35 @@ # -# --- Makefile initialization -------------------------------------------------- +# --- Distribution path override ----------------------------------------------- # -# Define the name of the configuration file. -CONFIG_MK_FILE := config.mk - -# Define the name of the file containing build and architecture-specific -# makefile definitions. -MAKE_DEFS_FILE := make_defs.mk - -# Locations of important files. -ROOT_PATH := ../.. -CONFIG_DIR := config +# Override the DIST_PATH value obtained from config.mk (via common.mk) by +# defining it here (prior to including the common.mk). +DIST_PATH := ../.. # -# --- Include makefile configuration file -------------------------------------- +# --- Include common makefile definitions -------------------------------------- # +# Define the name of the common makefile fragment. +COMMON_MK_FILE := common.mk + # Construct the path to the makefile configuration file that was generated by # the configure script. -CONFIG_MK_PATH := $(ROOT_PATH)/$(CONFIG_MK_FILE) +COMMON_MK_PATH := $(DIST_PATH)/$(COMMON_MK_FILE) -# Include the configuration file. --include $(CONFIG_MK_PATH) +# Include the common makefile fragment. +-include $(COMMON_MK_PATH) -# 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). -ifeq ($(strip $(CONFIG_MK_INCLUDED)),yes) -CONFIG_MK_PRESENT := yes +# Detect whether we actually got the common makefile fragment. If we didn't, +# then it is likely that the user has not yet generated it (via configure). +ifeq ($(strip $(COMMON_MK_INCLUDED)),yes) +COMMON_MK_PRESENT := yes else -CONFIG_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. -CONFIG_PATH := $(ROOT_PATH)/$(CONFIG_DIR)/$(CONFIG_NAME) - - - -# -# --- Include makefile definitions file ---------------------------------------- -# - -# Construct the path to the makefile definitions file residing inside of -# the configuration sub-directory. -MAKE_DEFS_MK_PATH := $(CONFIG_PATH)/$(MAKE_DEFS_FILE) - -# Include the makefile definitions file. --include $(MAKE_DEFS_MK_PATH) - -# 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 -else -MAKE_DEFS_MK_PRESENT := no +COMMON_MK_PRESENT := no endif diff --git a/test/exec_sizes/test_size.c b/test/exec_sizes/test_size.c index 45fad3167..7b9bf5bb2 100644 --- a/test/exec_sizes/test_size.c +++ b/test/exec_sizes/test_size.c @@ -89,7 +89,7 @@ int main( int argc, char** argv ) bli_randm( &c ); bli_setsc( (2.0/1.0), 0.0, &alpha ); - bli_setsc( -(1.0/1.0), 0.0, &beta ); + bli_setsc( (1.0/1.0), 0.0, &beta ); #endif @@ -99,18 +99,18 @@ int main( int argc, char** argv ) alpha.buffer = malloc( 1 * sizeof( double ) ); beta.buffer = malloc( 1 * sizeof( double ) ); + a.buffer = malloc( m * m * sizeof( double ) ); - a.m = m; - a.n = m; - a.cs = m; + bli_obj_set_dims( m, m, a ); + bli_obj_set_strides( m, 1, a ); + b.buffer = malloc( m * m * sizeof( double ) ); - b.m = m; - b.n = m; - b.cs = m; + bli_obj_set_dims( m, m, b ); + bli_obj_set_strides( m, 1, b ); + c.buffer = malloc( m * m * sizeof( double ) ); - c.m = m; - c.n = m; - c.cs = m; + bli_obj_set_dims( m, m, c ); + bli_obj_set_strides( m, 1, c ); *((double*)alpha.buffer) = 2.0; *((double*)beta.buffer) = -1.0; diff --git a/test/thread_ranges/Makefile b/test/thread_ranges/Makefile index b506f20ab..601a85f62 100644 --- a/test/thread_ranges/Makefile +++ b/test/thread_ranges/Makefile @@ -51,64 +51,35 @@ # -# --- Makefile initialization -------------------------------------------------- +# --- Distribution path override ----------------------------------------------- # -# Define the name of the configuration file. -CONFIG_MK_FILE := config.mk - -# Define the name of the file containing build and architecture-specific -# makefile definitions. -MAKE_DEFS_FILE := make_defs.mk - -# Locations of important files. -ROOT_PATH := ../.. -CONFIG_DIR := config +# Override the DIST_PATH value obtained from config.mk (via common.mk) by +# defining it here (prior to including the common.mk). +DIST_PATH := ../.. # -# --- Include makefile configuration file -------------------------------------- +# --- Include common makefile definitions -------------------------------------- # +# Define the name of the common makefile fragment. +COMMON_MK_FILE := common.mk + # Construct the path to the makefile configuration file that was generated by # the configure script. -CONFIG_MK_PATH := $(ROOT_PATH)/$(CONFIG_MK_FILE) +COMMON_MK_PATH := $(DIST_PATH)/$(COMMON_MK_FILE) -# Include the configuration file. --include $(CONFIG_MK_PATH) +# Include the common makefile fragment. +-include $(COMMON_MK_PATH) -# 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). -ifeq ($(strip $(CONFIG_MK_INCLUDED)),yes) -CONFIG_MK_PRESENT := yes +# Detect whether we actually got the common makefile fragment. If we didn't, +# then it is likely that the user has not yet generated it (via configure). +ifeq ($(strip $(COMMON_MK_INCLUDED)),yes) +COMMON_MK_PRESENT := yes else -CONFIG_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. -CONFIG_PATH := $(ROOT_PATH)/$(CONFIG_DIR)/$(CONFIG_NAME) - - - -# -# --- Include makefile definitions file ---------------------------------------- -# - -# Construct the path to the makefile definitions file residing inside of -# the configuration sub-directory. -MAKE_DEFS_MK_PATH := $(CONFIG_PATH)/$(MAKE_DEFS_FILE) - -# Include the makefile definitions file. --include $(MAKE_DEFS_MK_PATH) - -# 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 -else -MAKE_DEFS_MK_PRESENT := no +COMMON_MK_PRESENT := no endif diff --git a/test/thread_ranges/test_ranges.c b/test/thread_ranges/test_ranges.c index 6cd41d6d9..b0fb96957 100644 --- a/test/thread_ranges/test_ranges.c +++ b/test/thread_ranges/test_ranges.c @@ -112,7 +112,8 @@ int main( int argc, char** argv ) bool_t go_fwd; char out_ch; - obj_t a; + obj_t a; + blksz_t bfs; thrinfo_t thrinfo; dim_t m, n; @@ -279,6 +280,8 @@ int main( int argc, char** argv ) bli_randm( &a ); + bli_blksz_init_easy( &bfs, bf, bf, bf, bf ); + printf( "%4lu x %4lu ", m, n ); for ( t = t_begin; t != t_stop; t += t_inc ) @@ -287,13 +290,13 @@ int main( int argc, char** argv ) thrinfo.work_id = t; if ( part_n_dim && go_fwd ) - area = bli_thread_get_range_weighted_l2r( &thrinfo, &a, bf, &start, &end ); + area = bli_thread_get_range_weighted_l2r( &thrinfo, &a, &bfs, &start, &end ); else if ( part_n_dim && go_bwd ) - area = bli_thread_get_range_weighted_r2l( &thrinfo, &a, bf, &start, &end ); + area = bli_thread_get_range_weighted_r2l( &thrinfo, &a, &bfs, &start, &end ); else if ( part_m_dim && go_fwd ) - area = bli_thread_get_range_weighted_t2b( &thrinfo, &a, bf, &start, &end ); + area = bli_thread_get_range_weighted_t2b( &thrinfo, &a, &bfs, &start, &end ); else // ( part_m_dim && go_bwd ) - area = bli_thread_get_range_weighted_b2t( &thrinfo, &a, bf, &start, &end ); + area = bli_thread_get_range_weighted_b2t( &thrinfo, &a, &bfs, &start, &end ); width = end - start; diff --git a/testsuite/Makefile b/testsuite/Makefile index acbdd7bf3..d7880e2e2 100644 --- a/testsuite/Makefile +++ b/testsuite/Makefile @@ -37,7 +37,7 @@ # # Field G. Van Zee # -# Makefile for standalone BLIS test drivers. +# Makefile for BLIS testsuite. # # @@ -51,31 +51,24 @@ # -# --- Makefile initialization -------------------------------------------------- +# --- Distribution path override ----------------------------------------------- # +# Override the DIST_PATH value obtained from config.mk (via common.mk) by +# defining it here (prior to including the common.mk). +DIST_PATH := .. + + +# +# --- Include common makefile definitions -------------------------------------- +# # Define the name of the common makefile fragment. -COMMON_MK_FILE := common.mk - -# All makefile fragments in the tree will have this name. -FRAGMENT_MK := .fragment.mk - -# Important locations and directory names. -RELPATH := .. -CONFIG_DIR := config -FRAME_DIR := frame -LIB_DIR := lib - - - -# -# --- Include common makefile -------------------------------------------------- -# +COMMON_MK_FILE := common.mk # Construct the path to the makefile configuration file that was generated by # the configure script. -COMMON_MK_PATH := ../$(COMMON_MK_FILE) +COMMON_MK_PATH := $(DIST_PATH)/$(COMMON_MK_FILE) # Include the common makefile fragment. -include $(COMMON_MK_PATH) @@ -88,80 +81,20 @@ else COMMON_MK_PRESENT := no endif -# Override the DIST_PATH value obtained from config.mk, since it is relative -# to the build directory. -DIST_PATH := .. - -# Now we have access to CONFIG_NAME, which tells us which sub-directory of the -# config directory to use as our configuration. -CONFIG_PATH := $(DIST_PATH)/$(CONFIG_DIR)/$(CONFIG_NAME) -FRAME_PATH := $(DIST_PATH)/$(FRAME_DIR) - # -# --- Include makefile fragments ----------------------------------------------- +# --- Optional overrides ------------------------------------------------------- # -# 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) - +# Uncomment and modify these definitions if you wish to override the values +# present in the current BLIS configuration's makefile definitions file +# (ie: config//make_defs.mk). +# CC := gcc +# LINKER := $(CC) +# CFLAGS := -g -O2 -Wall -Wno-comment +# LDFLAGS := +# INSTALL_PREFIX := $(HOME)/blis @@ -192,21 +125,6 @@ BLIS_LIB := $(BLIS_LIB_PATH)/libblis.a -# -# --- Optional overrides ------------------------------------------------------- -# - -# Uncomment and modify these definitions if you wish to override the values -# present in the current BLIS configuration's makefile definitions file -# (ie: config//make_defs.mk). -# CC := gcc -# LINKER := $(CC) -# CFLAGS := -g -O2 -Wall -Wno-comment -# LDFLAGS := -# INSTALL_PREFIX := $(HOME)/blis - - - # # --- General build definitions ------------------------------------------------ # @@ -215,28 +133,19 @@ TEST_SRC_PATH := src TEST_OBJ_PATH := obj # Gather all local object files. -TEST_OBJS := $(patsubst $(TEST_SRC_PATH)/%.c, \ - $(TEST_OBJ_PATH)/%.o, \ - $(wildcard $(TEST_SRC_PATH)/*.c)) +TEST_OBJS := $(sort $(patsubst $(TEST_SRC_PATH)/%.c, \ + $(TEST_OBJ_PATH)/%.o, \ + $(wildcard $(TEST_SRC_PATH)/*.c))) -ifeq ($(CONFIG_NAME),pnacl) -# Linked executable -TEST_BIN := test_libblis.unstable.pexe -# Finalized executable -TEST_BIN_PNACL := test_libblis.pexe -# Translated executable for x86-64 -TEST_BIN_AMD64 := test_libblis.x86-64.nexe -# Translated executable for x86 -TEST_BIN_X86 := test_libblis.x86.nexe -# Translated executable for ARM -TEST_BIN_ARM := test_libblis.arm.nexe -else # Binary executable name. TEST_BIN := test_libblis.x -endif -# Add installed and local header paths to CFLAGS -CFLAGS += -I$(BLIS_INC_PATH) -I$(TEST_SRC_PATH) +# Use the CFLAGS for the configuration family. +CFLAGS := $(call get-frame-cflags-for,$(CONFIG_NAME)) + +# Add local header paths to CFLAGS +#CFLAGS += -I$(BLIS_INC_PATH) -I$(TEST_SRC_PATH) +CFLAGS += -I$(TEST_SRC_PATH) @@ -248,11 +157,7 @@ CFLAGS += -I$(BLIS_INC_PATH) -I$(TEST_SRC_PATH) all: check-env bin -ifeq ($(CONFIG_NAME),pnacl) -bin: check-env $(TEST_BIN) $(TEST_BIN_PNACL) $(TEST_BIN_AMD64) $(TEST_BIN_X86) $(TEST_BIN_ARM) -else bin: check-env $(TEST_BIN) -endif # --- Environment check rules --- @@ -296,68 +201,13 @@ else @$(LINKER) $(TEST_OBJS) $(BLIS_LIB) $(LDFLAGS) -o $@ endif -ifeq ($(CONFIG_NAME),pnacl) - -# Finalize PNaCl executable (i.e. convert from LLVM bitcode to PNaCl bitcode) -$(TEST_BIN_PNACL): $(TEST_BIN) -ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes) - $(FINALIZER) $(FINFLAGS) -o $@ $(TEST_BIN) -else - @echo "Finalizing $@" - @$(FINALIZER) $(FINFLAGS) -o $@ $(TEST_BIN) -endif - -# Translate PNaCl executable to x86-64 NaCl executable -$(TEST_BIN_AMD64): $(TEST_BIN_PNACL) -ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes) - $(TRANSLATOR) $(TRNSFLAGS) $(TRNSAMD64FLAGS) $< -o $@ -else - @echo "Translating $< -> $@" - @$(TRANSLATOR) $(TRNSFLAGS) $(TRNSAMD64FLAGS) $< -o $@ -endif - - -# Translate PNaCl executable to x86 NaCl executable -$(TEST_BIN_X86): $(TEST_BIN_PNACL) -ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes) - $(TRANSLATOR) $(TRNSFLAGS) $(TRNSX86FLAGS) $< -o $@ -else - @echo "Translating $< -> $@" - @$(TRANSLATOR) $(TRNSFLAGS) $(TRNSX86FLAGS) $< -o $@ -endif - -# Translate PNaCl executable to ARMv7 NaCl executable -$(TEST_BIN_ARM): $(TEST_BIN_PNACL) -ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes) - $(TRANSLATOR) $(TRNSFLAGS) $(TRNSARMFLAGS) $< -o $@ -else - @echo "Translating $< -> $@" - @$(TRANSLATOR) $(TRNSFLAGS) $(TRNSARMFLAGS) $< -o $@ -endif - -endif - # -- Test run rules -- -ifeq ($(CONFIG_NAME),pnacl) -run-amd64: $(TEST_BIN_AMD64) - $(NACL_SDK_ROOT)/tools/sel_ldr_x86_64 -a -c -q -B $(NACL_SDK_ROOT)/tools/irt_core_x86_64.nexe -- $(TEST_BIN_AMD64) -run-x86: $(TEST_BIN_X86) - $(NACL_SDK_ROOT)/tools/sel_ldr_x86_32 -a -c -q -B $(NACL_SDK_ROOT)/tools/irt_core_x86_32.nexe -- $(TEST_BIN_X86) -run-arm: $(TEST_BIN_ARM) - $(NACL_SDK_ROOT)/tools/sel_ldr_arm -a -c -q -B $(NACL_SDK_ROOT)/tools/irt_core_arm.nexe -- $(TEST_BIN_ARM) -else run: $(TEST_BIN) ./$(TEST_BIN) -endif # -- Clean rules -- -ifeq ($(CONFIG_NAME),pnacl) -clean: - - $(RM_F) $(TEST_OBJS) $(TEST_BIN) $(TEST_BIN_PNACL) $(TEST_BIN_AMD64) $(TEST_BIN_X86) $(TEST_BIN_ARM) -else clean: - $(RM_F) $(TEST_OBJS) $(TEST_BIN) -endif diff --git a/testsuite/input.general b/testsuite/input.general index b7fbd6b58..30b661d39 100644 --- a/testsuite/input.general +++ b/testsuite/input.general @@ -30,8 +30,6 @@ sdcz # Datatype(s) to test: 100 # Problem size: increment between experiments # Complex level-3 implementations to test 0 # 3mh ('1' = enable; '0' = disable) -0 # 3m3 ('1' = enable; '0' = disable) -0 # 3m2 ('1' = enable; '0' = disable) 0 # 3m1 ('1' = enable; '0' = disable) 0 # 4mh ('1' = enable; '0' = disable) 0 # 4m1b ('1' = enable; '0' = disable) diff --git a/testsuite/src/test_amaxv.c b/testsuite/src/test_amaxv.c index 9323ecbba..ef9684cac 100644 --- a/testsuite/src/test_amaxv.c +++ b/testsuite/src/test_amaxv.c @@ -286,7 +286,7 @@ void PASTEMAC(ch,opname) \ cntx_t* cntx \ ); \ -INSERT_GENTPROT_BASIC( amaxv_test ) +INSERT_GENTPROT_BASIC0( amaxv_test ) // // Define object-based interface for a local amaxv test operation. diff --git a/testsuite/src/test_axpy2v.c b/testsuite/src/test_axpy2v.c index 41c0b9160..b41be2673 100644 --- a/testsuite/src/test_axpy2v.c +++ b/testsuite/src/test_axpy2v.c @@ -165,10 +165,10 @@ void libblis_test_axpy2v_experiment obj_t alpha1, alpha2, x, y, z; obj_t z_save; - cntx_t cntx; + cntx_t* cntx; - // Initialize a context. - bli_axpy2v_cntx_init( datatype, &cntx ); + // Query a context. + cntx = bli_gks_query_cntx(); // Map the dimension specifier to an actual dimension. m = libblis_test_get_dim_from_prob_size( op->dim_spec[0], p_cur ); @@ -218,7 +218,7 @@ void libblis_test_axpy2v_experiment libblis_test_axpy2v_impl( iface, &alpha1, &alpha2, &x, &y, &z, - &cntx ); + cntx ); time_min = bli_clock_min_diff( time_min, time ); } @@ -238,9 +238,6 @@ void libblis_test_axpy2v_experiment bli_obj_free( &y ); bli_obj_free( &z ); bli_obj_free( &z_save ); - - // Finalize the context. - bli_axpy2v_cntx_finalize( &cntx ); } diff --git a/testsuite/src/test_axpyf.c b/testsuite/src/test_axpyf.c index 8da15c315..2bea0a5b4 100644 --- a/testsuite/src/test_axpyf.c +++ b/testsuite/src/test_axpyf.c @@ -163,16 +163,16 @@ void libblis_test_axpyf_experiment obj_t alpha, a, x, y; obj_t y_save; - cntx_t cntx; + cntx_t* cntx; - // Initialize a context. - bli_axpyf_cntx_init( datatype, &cntx ); + // Query a context. + cntx = bli_gks_query_cntx(); // Map the dimension specifier to an actual dimension. m = libblis_test_get_dim_from_prob_size( op->dim_spec[0], p_cur ); // Query the operation's fusing factor for the current datatype. - b_n = bli_cntx_get_blksz_def_dt( datatype, BLIS_AF, &cntx ); + b_n = bli_cntx_get_blksz_def_dt( datatype, BLIS_AF, cntx ); // Store the fusing factor so that the driver can retrieve the value // later when printing results. @@ -221,7 +221,7 @@ void libblis_test_axpyf_experiment libblis_test_axpyf_impl( iface, &alpha, &a, &x, &y, - &cntx ); + cntx ); time_min = bli_clock_min_diff( time_min, time ); } @@ -241,9 +241,6 @@ void libblis_test_axpyf_experiment bli_obj_free( &x ); bli_obj_free( &y ); bli_obj_free( &y_save ); - - // Finalize the context. - bli_axpyf_cntx_finalize( &cntx ); } diff --git a/testsuite/src/test_dotaxpyv.c b/testsuite/src/test_dotaxpyv.c index 6c1440e95..7a14d32f8 100644 --- a/testsuite/src/test_dotaxpyv.c +++ b/testsuite/src/test_dotaxpyv.c @@ -168,10 +168,10 @@ void libblis_test_dotaxpyv_experiment obj_t alpha, xt, x, y, rho, z; obj_t z_save; - cntx_t cntx; + cntx_t* cntx; - // Initialize a context. - bli_dotaxpyv_cntx_init( datatype, &cntx ); + // Query a context. + cntx = bli_gks_query_cntx(); // Map the dimension specifier to an actual dimension. m = libblis_test_get_dim_from_prob_size( op->dim_spec[0], p_cur ); @@ -238,7 +238,7 @@ void libblis_test_dotaxpyv_experiment libblis_test_dotaxpyv_impl( iface, &alpha, &xt, &x, &y, &rho, &z, - &cntx ); + cntx ); time_min = bli_clock_min_diff( time_min, time ); } @@ -258,9 +258,6 @@ void libblis_test_dotaxpyv_experiment bli_obj_free( &y ); bli_obj_free( &z ); bli_obj_free( &z_save ); - - // Finalize the context. - bli_dotaxpyv_cntx_finalize( &cntx ); } diff --git a/testsuite/src/test_dotxaxpyf.c b/testsuite/src/test_dotxaxpyf.c index a7abdba87..4ebcc6123 100644 --- a/testsuite/src/test_dotxaxpyf.c +++ b/testsuite/src/test_dotxaxpyf.c @@ -173,16 +173,16 @@ void libblis_test_dotxaxpyf_experiment obj_t alpha, at, a, w, x, beta, y, z; obj_t y_save, z_save; - cntx_t cntx; + cntx_t* cntx; - // Initialize a context. - bli_dotxaxpyf_cntx_init( datatype, &cntx ); + // Query a context. + cntx = bli_gks_query_cntx(); // Map the dimension specifier to an actual dimension. m = libblis_test_get_dim_from_prob_size( op->dim_spec[0], p_cur ); // Query the operation's fusing factor for the current datatype. - b_n = bli_cntx_get_blksz_def_dt( datatype, BLIS_XF, &cntx ); + b_n = bli_cntx_get_blksz_def_dt( datatype, BLIS_XF, cntx ); // Store the fusing factor so that the driver can retrieve the value // later when printing results. @@ -250,7 +250,7 @@ void libblis_test_dotxaxpyf_experiment libblis_test_dotxaxpyf_impl( iface, &alpha, &at, &a, &w, &x, &beta, &y, &z, - &cntx ); + cntx ); time_min = bli_clock_min_diff( time_min, time ); } @@ -274,9 +274,6 @@ void libblis_test_dotxaxpyf_experiment bli_obj_free( &z ); bli_obj_free( &y_save ); bli_obj_free( &z_save ); - - // Finalize the context. - bli_dotxaxpyf_cntx_finalize( &cntx ); } diff --git a/testsuite/src/test_dotxf.c b/testsuite/src/test_dotxf.c index 8adec7c1d..f52609195 100644 --- a/testsuite/src/test_dotxf.c +++ b/testsuite/src/test_dotxf.c @@ -165,16 +165,16 @@ void libblis_test_dotxf_experiment obj_t alpha, a, x, beta, y; obj_t y_save; - cntx_t cntx; + cntx_t* cntx; - // Initialize a context. - bli_dotxf_cntx_init( datatype, &cntx ); + // Query a context. + cntx = bli_gks_query_cntx(); // Map the dimension specifier to an actual dimension. m = libblis_test_get_dim_from_prob_size( op->dim_spec[0], p_cur ); // Query the operation's fusing factor for the current datatype. - b_n = bli_cntx_get_blksz_def_dt( datatype, BLIS_DF, &cntx ); + b_n = bli_cntx_get_blksz_def_dt( datatype, BLIS_DF, cntx ); // Store the fusing factor so that the driver can retrieve the value // later when printing results. @@ -226,7 +226,7 @@ void libblis_test_dotxf_experiment libblis_test_dotxf_impl( iface, &alpha, &a, &x, &beta, &y, - &cntx ); + cntx ); time_min = bli_clock_min_diff( time_min, time ); } @@ -246,9 +246,6 @@ void libblis_test_dotxf_experiment bli_obj_free( &x ); bli_obj_free( &y ); bli_obj_free( &y_save ); - - // Finalize the context. - bli_dotxf_cntx_finalize( &cntx ); } diff --git a/testsuite/src/test_gemm_ukr.c b/testsuite/src/test_gemm_ukr.c index d5061227a..07a56c97c 100644 --- a/testsuite/src/test_gemm_ukr.c +++ b/testsuite/src/test_gemm_ukr.c @@ -171,22 +171,22 @@ void libblis_test_gemm_ukr_experiment obj_t ap, bp; obj_t c_save; - cntx_t cntx; + cntx_t* cntx; - // Initialize a context. - bli_gemm_cntx_init( datatype, &cntx ); + // Query a context. + cntx = bli_gks_query_cntx(); // Map the dimension specifier to actual dimensions. k = libblis_test_get_dim_from_prob_size( op->dim_spec[0], p_cur ); // Fix m and n to MR and NR, respectively. - m = bli_cntx_get_blksz_def_dt( datatype, BLIS_MR, &cntx ); - n = bli_cntx_get_blksz_def_dt( datatype, BLIS_NR, &cntx ); + m = bli_cntx_get_blksz_def_dt( datatype, BLIS_MR, cntx ); + n = bli_cntx_get_blksz_def_dt( datatype, BLIS_NR, cntx ); // Also query PACKMR and PACKNR as the leading dimensions to ap and bp, // respectively. - ldap = bli_cntx_get_blksz_max_dt( datatype, BLIS_MR, &cntx ); - ldbp = bli_cntx_get_blksz_max_dt( datatype, BLIS_NR, &cntx ); + ldap = bli_cntx_get_blksz_max_dt( datatype, BLIS_MR, cntx ); + ldbp = bli_cntx_get_blksz_max_dt( datatype, BLIS_NR, cntx ); // Store the register blocksizes so that the driver can retrieve the // values later when printing results. @@ -237,7 +237,7 @@ void libblis_test_gemm_ukr_experiment BLIS_PACKED_ROW_PANELS, BLIS_BUFFER_FOR_A_BLOCK, &a, &ap, - &cntx + cntx ); cntl_t* cntl_b = libblis_test_pobj_create ( @@ -247,7 +247,7 @@ void libblis_test_gemm_ukr_experiment BLIS_PACKED_COL_PANELS, BLIS_BUFFER_FOR_B_PANEL, &b, &bp, - &cntx + cntx ); #endif @@ -265,16 +265,16 @@ void libblis_test_gemm_ukr_experiment void* buf_bp = bli_obj_buffer( bp ); bli_packm_init_pack( BLIS_NO_INVERT_DIAG, BLIS_PACKED_ROW_PANELS, BLIS_PACK_FWD_IF_UPPER, BLIS_PACK_FWD_IF_LOWER, - BLIS_MR, BLIS_KR, &a, &ap, &cntx ); + BLIS_MR, BLIS_KR, &a, &ap, cntx ); bli_packm_init_pack( BLIS_NO_INVERT_DIAG, BLIS_PACKED_COL_PANELS, BLIS_PACK_FWD_IF_UPPER, BLIS_PACK_FWD_IF_LOWER, - BLIS_KR, BLIS_NR, &b, &bp, &cntx ); + BLIS_KR, BLIS_NR, &b, &bp, cntx ); bli_obj_set_buffer( buf_ap, ap ); bli_obj_set_buffer( buf_bp, bp ); // Pack the data from the source objects. - bli_packm_blk_var1( &a, &ap, &cntx, NULL, &BLIS_PACKM_SINGLE_THREADED ); - bli_packm_blk_var1( &b, &bp, &cntx, NULL, &BLIS_PACKM_SINGLE_THREADED ); + bli_packm_blk_var1( &a, &ap, cntx, NULL, &BLIS_PACKM_SINGLE_THREADED ); + bli_packm_blk_var1( &b, &bp, cntx, NULL, &BLIS_PACKM_SINGLE_THREADED ); // Repeat the experiment n_repeats times and record results. for ( i = 0; i < n_repeats; ++i ) @@ -285,7 +285,7 @@ void libblis_test_gemm_ukr_experiment libblis_test_gemm_ukr_impl( iface, &alpha, &ap, &bp, &beta, &c, - &cntx ); + cntx ); time_min = bli_clock_min_diff( time_min, time ); } @@ -312,9 +312,6 @@ void libblis_test_gemm_ukr_experiment bli_obj_free( &b ); bli_obj_free( &c ); bli_obj_free( &c_save ); - - // Finalize the context. - bli_gemm_cntx_finalize( &cntx ); } diff --git a/testsuite/src/test_gemmtrsm_ukr.c b/testsuite/src/test_gemmtrsm_ukr.c index 1232a7c12..3d9c61a89 100644 --- a/testsuite/src/test_gemmtrsm_ukr.c +++ b/testsuite/src/test_gemmtrsm_ukr.c @@ -196,22 +196,22 @@ void libblis_test_gemmtrsm_ukr_experiment obj_t a1xp, a11p, bx1p, b11p; obj_t c11_save; - cntx_t cntx; + cntx_t* cntx; - // Initialize a context. - bli_trsm_cntx_init( datatype, &cntx ); + // Query a context. + cntx = bli_gks_query_cntx(); // Map the dimension specifier to actual dimensions. k = libblis_test_get_dim_from_prob_size( op->dim_spec[0], p_cur ); // Fix m and n to MR and NR, respectively. - m = bli_cntx_get_blksz_def_dt( datatype, BLIS_MR, &cntx ); - n = bli_cntx_get_blksz_def_dt( datatype, BLIS_NR, &cntx ); + m = bli_cntx_get_blksz_def_dt( datatype, BLIS_MR, cntx ); + n = bli_cntx_get_blksz_def_dt( datatype, BLIS_NR, cntx ); // Also query PACKMR and PACKNR as the leading dimensions to ap and bp, // respectively. - ldap = bli_cntx_get_blksz_max_dt( datatype, BLIS_MR, &cntx ); - ldbp = bli_cntx_get_blksz_max_dt( datatype, BLIS_NR, &cntx ); + ldap = bli_cntx_get_blksz_max_dt( datatype, BLIS_MR, cntx ); + ldbp = bli_cntx_get_blksz_max_dt( datatype, BLIS_NR, cntx ); // Store the register blocksizes so that the driver can retrieve the // values later when printing results. @@ -311,10 +311,10 @@ void libblis_test_gemmtrsm_ukr_experiment void* buf_bp = bli_obj_buffer( bp ); bli_packm_init_pack( BLIS_NO_INVERT_DIAG, BLIS_PACKED_ROW_PANELS, BLIS_PACK_FWD_IF_UPPER, BLIS_PACK_FWD_IF_LOWER, - BLIS_MR, BLIS_KR, &a, &ap, &cntx ); + BLIS_MR, BLIS_KR, &a, &ap, cntx ); bli_packm_init_pack( BLIS_NO_INVERT_DIAG, BLIS_PACKED_COL_PANELS, BLIS_PACK_FWD_IF_UPPER, BLIS_PACK_FWD_IF_LOWER, - BLIS_KR, BLIS_NR, &b, &bp, &cntx ); + BLIS_KR, BLIS_NR, &b, &bp, cntx ); bli_obj_set_buffer( buf_ap, ap ); bli_obj_set_buffer( buf_bp, bp ); @@ -328,8 +328,8 @@ void libblis_test_gemmtrsm_ukr_experiment bli_obj_set_uplo( uploa, ap ); // Pack the data from the source objects. - bli_packm_blk_var1( &a, &ap, &cntx, NULL, &BLIS_PACKM_SINGLE_THREADED ); - bli_packm_blk_var1( &b, &bp, &cntx, NULL, &BLIS_PACKM_SINGLE_THREADED ); + bli_packm_blk_var1( &a, &ap, cntx, NULL, &BLIS_PACKM_SINGLE_THREADED ); + bli_packm_blk_var1( &b, &bp, cntx, NULL, &BLIS_PACKM_SINGLE_THREADED ); // Create subpartitions from the a and b panels. bli_gemmtrsm_ukr_make_subparts( k, &ap, &bp, @@ -350,13 +350,13 @@ void libblis_test_gemmtrsm_ukr_experiment // Re-pack (restore) the contents of b to bp. //bli_packm_blk_var1( &b, &bp, &cntx, cntl_b, &BLIS_PACKM_SINGLE_THREADED ); - bli_packm_blk_var1( &b, &bp, &cntx, NULL, &BLIS_PACKM_SINGLE_THREADED ); + bli_packm_blk_var1( &b, &bp, cntx, NULL, &BLIS_PACKM_SINGLE_THREADED ); time = bli_clock(); libblis_test_gemmtrsm_ukr_impl( iface, side, &alpha, &a1xp, &a11p, &bx1p, &b11p, &c11, - &cntx ); + cntx ); time_min = bli_clock_min_diff( time_min, time ); } @@ -384,9 +384,6 @@ void libblis_test_gemmtrsm_ukr_experiment bli_obj_free( &b ); bli_obj_free( &c11 ); bli_obj_free( &c11_save ); - - // Finalize the context. - bli_trsm_cntx_finalize( &cntx ); } diff --git a/testsuite/src/test_libblis.c b/testsuite/src/test_libblis.c index 84552b569..e1a77388b 100644 --- a/testsuite/src/test_libblis.c +++ b/testsuite/src/test_libblis.c @@ -403,14 +403,6 @@ void libblis_test_read_params_file( char* input_filename, test_params_t* params libblis_test_read_next_line( buffer, input_stream ); sscanf( buffer, "%u ", &(params->ind_enable[ BLIS_3MH ]) ); - // Read whether to enable 3m3. - libblis_test_read_next_line( buffer, input_stream ); - sscanf( buffer, "%u ", &(params->ind_enable[ BLIS_3M3 ]) ); - - // Read whether to enable 3m2. - libblis_test_read_next_line( buffer, input_stream ); - sscanf( buffer, "%u ", &(params->ind_enable[ BLIS_3M2 ]) ); - // Read whether to enable 3m1. libblis_test_read_next_line( buffer, input_stream ); sscanf( buffer, "%u ", &(params->ind_enable[ BLIS_3M1 ]) ); @@ -601,12 +593,9 @@ void libblis_test_output_params_struct( FILE* os, test_params_t* params ) //char int_type_size_str[8]; gint_t int_type_size; ind_t im; - cntx_t cntx_local; - cntx_t cntx_local_c; - cntx_t cntx_local_z; - cntx_t* cntx = &cntx_local; - cntx_t* cntx_c = &cntx_local_c; - cntx_t* cntx_z = &cntx_local_z; + cntx_t* cntx; + cntx_t* cntx_c; + cntx_t* cntx_z; // If bli_info_get_int_type_size() returns 32 or 64, the size is forced. // Otherwise, the size is chosen automatically. We query the result of @@ -729,10 +718,8 @@ void libblis_test_output_params_struct( FILE* os, test_params_t* params ) bli_ind_oper_get_avail_impl_string( BLIS_GEMM, BLIS_DCOMPLEX ) ); libblis_test_fprintf_c( os, "\n" ); - // Initialize a context for the gemm family, assuming native execution. - // We use BLIS_DOUBLE for the datatype, but the dt argument is actually - // only used when initializing contexts for induced methods. - bli_gemmnat_cntx_init( BLIS_DOUBLE, cntx ); + // Query a native context. + cntx = bli_gks_query_nat_cntx(); libblis_test_fprintf_c( os, "level-3 blocksizes s d c z \n" ); libblis_test_fprintf_c( os, " mc %7d %7d %7d %7d\n", @@ -818,8 +805,6 @@ void libblis_test_output_params_struct( FILE* os, test_params_t* params ) libblis_test_fprintf_c( os, "\n" ); libblis_test_fprintf_c( os, "\n" ); - bli_gemmnat_cntx_finalize( cntx ); - libblis_test_fprintf_c( os, "--- BLIS induced implementation info ---\n" ); libblis_test_fprintf_c( os, "\n" ); @@ -830,80 +815,74 @@ void libblis_test_output_params_struct( FILE* os, test_params_t* params ) bli_ind_oper_enable_only( BLIS_GEMM, im, BLIS_SCOMPLEX ); bli_ind_oper_enable_only( BLIS_GEMM, im, BLIS_DCOMPLEX ); - libblis_test_fprintf_c( os, " c z \n" ); - libblis_test_fprintf_c( os, "complex implementation %7s %7s\n", + //libblis_test_fprintf_c( os, " c z \n" ); + libblis_test_fprintf_c( os, " c z \n" ); + libblis_test_fprintf_c( os, "complex implementation %7s %7s\n", bli_ind_oper_get_avail_impl_string( BLIS_GEMM, BLIS_SCOMPLEX ), bli_ind_oper_get_avail_impl_string( BLIS_GEMM, BLIS_DCOMPLEX ) ); libblis_test_fprintf_c( os, "\n" ); - bli_gemmind_cntx_init( im, BLIS_SCOMPLEX, cntx_c ); - bli_gemmind_cntx_init( im, BLIS_DCOMPLEX, cntx_z ); + // Query a native context. + cntx_c = bli_gks_query_ind_cntx( im, BLIS_SCOMPLEX ); + cntx_z = bli_gks_query_ind_cntx( im, BLIS_DCOMPLEX ); - libblis_test_fprintf_c( os, "level-3 blocksizes c z \n" ); - libblis_test_fprintf_c( os, " mc %7d %7d\n", + libblis_test_fprintf_c( os, "level-3 blocksizes c z \n" ); + libblis_test_fprintf_c( os, " mc %7d %7d\n", ( int )bli_cntx_get_blksz_def_dt( BLIS_SCOMPLEX, BLIS_MC, cntx_c ), ( int )bli_cntx_get_blksz_def_dt( BLIS_DCOMPLEX, BLIS_MC, cntx_z ) ); - libblis_test_fprintf_c( os, " kc %7d %7d\n", + libblis_test_fprintf_c( os, " kc %7d %7d\n", ( int )bli_cntx_get_blksz_def_dt( BLIS_SCOMPLEX, BLIS_KC, cntx_c ), ( int )bli_cntx_get_blksz_def_dt( BLIS_DCOMPLEX, BLIS_KC, cntx_z ) ); - libblis_test_fprintf_c( os, " nc %7d %7d\n", + libblis_test_fprintf_c( os, " nc %7d %7d\n", ( int )bli_cntx_get_blksz_def_dt( BLIS_SCOMPLEX, BLIS_NC, cntx_c ), ( int )bli_cntx_get_blksz_def_dt( BLIS_DCOMPLEX, BLIS_NC, cntx_z ) ); libblis_test_fprintf_c( os, "\n" ); - libblis_test_fprintf_c( os, " mc maximum %7d %7d\n", + libblis_test_fprintf_c( os, " mc maximum %7d %7d\n", ( int )bli_cntx_get_blksz_max_dt( BLIS_SCOMPLEX, BLIS_MC, cntx_c ), ( int )bli_cntx_get_blksz_max_dt( BLIS_DCOMPLEX, BLIS_MC, cntx_z ) ); - libblis_test_fprintf_c( os, " kc maximum %7d %7d\n", + libblis_test_fprintf_c( os, " kc maximum %7d %7d\n", ( int )bli_cntx_get_blksz_max_dt( BLIS_SCOMPLEX, BLIS_KC, cntx_c ), ( int )bli_cntx_get_blksz_max_dt( BLIS_DCOMPLEX, BLIS_KC, cntx_z ) ); - libblis_test_fprintf_c( os, " nc maximum %7d %7d\n", + libblis_test_fprintf_c( os, " nc maximum %7d %7d\n", ( int )bli_cntx_get_blksz_max_dt( BLIS_SCOMPLEX, BLIS_NC, cntx_c ), ( int )bli_cntx_get_blksz_max_dt( BLIS_DCOMPLEX, BLIS_NC, cntx_z ) ); libblis_test_fprintf_c( os, "\n" ); - libblis_test_fprintf_c( os, " mr %7d %7d\n", + libblis_test_fprintf_c( os, " mr %7d %7d\n", ( int )bli_cntx_get_blksz_def_dt( BLIS_SCOMPLEX, BLIS_MR, cntx_c ), ( int )bli_cntx_get_blksz_def_dt( BLIS_DCOMPLEX, BLIS_MR, cntx_z ) ); - libblis_test_fprintf_c( os, " nr %7d %7d\n", + libblis_test_fprintf_c( os, " nr %7d %7d\n", ( int )bli_cntx_get_blksz_def_dt( BLIS_SCOMPLEX, BLIS_NR, cntx_c ), ( int )bli_cntx_get_blksz_def_dt( BLIS_DCOMPLEX, BLIS_NR, cntx_z ) ); libblis_test_fprintf_c( os, "\n" ); - libblis_test_fprintf_c( os, " mr packdim %7d %7d\n", + libblis_test_fprintf_c( os, " mr packdim %7d %7d\n", ( int )bli_cntx_get_blksz_max_dt( BLIS_SCOMPLEX, BLIS_MR, cntx_c ), ( int )bli_cntx_get_blksz_max_dt( BLIS_DCOMPLEX, BLIS_MR, cntx_z ) ); - libblis_test_fprintf_c( os, " nr packdim %7d %7d\n", + libblis_test_fprintf_c( os, " nr packdim %7d %7d\n", ( int )bli_cntx_get_blksz_max_dt( BLIS_SCOMPLEX, BLIS_NR, cntx_c ), ( int )bli_cntx_get_blksz_max_dt( BLIS_DCOMPLEX, BLIS_NR, cntx_z ) ); libblis_test_fprintf_c( os, "\n" ); - libblis_test_fprintf_c( os, "micro-kernel types c z\n" ); - libblis_test_fprintf_c( os, " gemm %7s %7s\n", + libblis_test_fprintf_c( os, "micro-kernel types c z\n" ); + libblis_test_fprintf_c( os, " gemm %7s %7s\n", bli_info_get_gemm_ukr_impl_string( im, BLIS_SCOMPLEX ), bli_info_get_gemm_ukr_impl_string( im, BLIS_DCOMPLEX ) ); - libblis_test_fprintf_c( os, " gemmtrsm_l %7s %7s\n", + libblis_test_fprintf_c( os, " gemmtrsm_l %7s %7s\n", bli_info_get_gemmtrsm_l_ukr_impl_string( im, BLIS_SCOMPLEX ), bli_info_get_gemmtrsm_l_ukr_impl_string( im, BLIS_DCOMPLEX ) ); - libblis_test_fprintf_c( os, " gemmtrsm_u %7s %7s\n", + libblis_test_fprintf_c( os, " gemmtrsm_u %7s %7s\n", bli_info_get_gemmtrsm_u_ukr_impl_string( im, BLIS_SCOMPLEX ), bli_info_get_gemmtrsm_u_ukr_impl_string( im, BLIS_DCOMPLEX ) ); - libblis_test_fprintf_c( os, " trsm_l %7s %7s\n", + libblis_test_fprintf_c( os, " trsm_l %7s %7s\n", bli_info_get_trsm_l_ukr_impl_string( im, BLIS_SCOMPLEX ), bli_info_get_trsm_l_ukr_impl_string( im, BLIS_DCOMPLEX ) ); - libblis_test_fprintf_c( os, " trsm_u %7s %7s\n", + libblis_test_fprintf_c( os, " trsm_u %7s %7s\n", bli_info_get_trsm_u_ukr_impl_string( im, BLIS_SCOMPLEX ), bli_info_get_trsm_u_ukr_impl_string( im, BLIS_DCOMPLEX ) ); libblis_test_fprintf_c( os, "\n" ); - bli_gemmind_cntx_finalize( im, cntx_c ); - bli_gemmind_cntx_finalize( im, cntx_z ); } bli_ind_disable_all(); - // We use hemv's context because we know it is initialized with all of the fields - // we will be outputing. - // We use BLIS_DOUBLE for the datatype, but the dt argument is actually - // only used when initializing contexts for induced methods. - bli_hemv_cntx_init( BLIS_DOUBLE, cntx ); - libblis_test_fprintf_c( os, "\n" ); libblis_test_fprintf_c( os, "--- BLIS misc. other info ---\n" ); libblis_test_fprintf_c( os, "\n" ); @@ -938,8 +917,6 @@ void libblis_test_output_params_struct( FILE* os, test_params_t* params ) libblis_test_fprintf_c( os, "\n" ); libblis_test_fprintf( os, "\n" ); - bli_hemv_cntx_finalize( cntx ); - // Output the contents of the param struct. libblis_test_fprintf_c( os, "\n" ); libblis_test_fprintf_c( os, "--- BLIS test suite parameters ----------------------------\n" ); @@ -964,8 +941,6 @@ void libblis_test_output_params_struct( FILE* os, test_params_t* params ) libblis_test_fprintf_c( os, "problem size increment %u\n", params->p_inc ); libblis_test_fprintf_c( os, "complex implementations \n" ); libblis_test_fprintf_c( os, " 3mh? %u\n", params->ind_enable[ BLIS_3MH ] ); - libblis_test_fprintf_c( os, " 3m3? %u\n", params->ind_enable[ BLIS_3M3 ] ); - libblis_test_fprintf_c( os, " 3m2? %u\n", params->ind_enable[ BLIS_3M2 ] ); libblis_test_fprintf_c( os, " 3m1? %u\n", params->ind_enable[ BLIS_3M1 ] ); libblis_test_fprintf_c( os, " 4mh? %u\n", params->ind_enable[ BLIS_4MH ] ); libblis_test_fprintf_c( os, " 4m1b (4mb)? %u\n", params->ind_enable[ BLIS_4M1B ] ); diff --git a/testsuite/src/test_randm.h b/testsuite/src/test_randm.h index 5373613c3..3b2b71fcd 100644 --- a/testsuite/src/test_randm.h +++ b/testsuite/src/test_randm.h @@ -55,4 +55,4 @@ void PASTEMAC(ch,varname)( \ void* sum_x \ ); -INSERT_GENTPROTR_BASIC( absumm ) +INSERT_GENTPROTR_BASIC0( absumm ) diff --git a/testsuite/src/test_trsm_ukr.c b/testsuite/src/test_trsm_ukr.c index e7ccb4b43..2f2dd6cc0 100644 --- a/testsuite/src/test_trsm_ukr.c +++ b/testsuite/src/test_trsm_ukr.c @@ -175,14 +175,14 @@ void libblis_test_trsm_ukr_experiment obj_t ap, bp; obj_t c_save; - cntx_t cntx; + cntx_t* cntx; - // Initialize a context. - bli_trsm_cntx_init( datatype, &cntx ); + // Query a context. + cntx = bli_gks_query_cntx(); // Fix m and n to MR and NR, respectively. - m = bli_cntx_get_blksz_def_dt( datatype, BLIS_MR, &cntx ); - n = bli_cntx_get_blksz_def_dt( datatype, BLIS_NR, &cntx ); + m = bli_cntx_get_blksz_def_dt( datatype, BLIS_MR, cntx ); + n = bli_cntx_get_blksz_def_dt( datatype, BLIS_NR, cntx ); // Store the register blocksizes so that the driver can retrieve the // values later when printing results. @@ -231,7 +231,7 @@ void libblis_test_trsm_ukr_experiment BLIS_PACKED_ROW_PANELS, BLIS_BUFFER_FOR_A_BLOCK, &a, &ap, - &cntx + cntx ); cntl_t* cntl_b = libblis_test_pobj_create ( @@ -241,7 +241,7 @@ void libblis_test_trsm_ukr_experiment BLIS_PACKED_COL_PANELS, BLIS_BUFFER_FOR_B_PANEL, &b, &bp, - &cntx + cntx ); // Set the uplo field of ap since the default for packed objects is @@ -253,7 +253,7 @@ void libblis_test_trsm_ukr_experiment for ( i = 0; i < n_repeats; ++i ) { // Re-pack the contents of b to bp. - bli_packm_blk_var1( &b, &bp, &cntx, cntl_b, &BLIS_PACKM_SINGLE_THREADED ); + bli_packm_blk_var1( &b, &bp, cntx, cntl_b, &BLIS_PACKM_SINGLE_THREADED ); bli_copym( &c_save, &c ); @@ -261,7 +261,7 @@ void libblis_test_trsm_ukr_experiment libblis_test_trsm_ukr_impl( iface, side, &ap, &bp, &c, - &cntx ); + cntx ); time_min = bli_clock_min_diff( time_min, time ); } @@ -286,9 +286,6 @@ void libblis_test_trsm_ukr_experiment bli_obj_free( &b ); bli_obj_free( &c ); bli_obj_free( &c_save ); - - // Finalize the context. - bli_trsm_cntx_finalize( &cntx ); }