Skip to content

Commit

Permalink
Blis AOCL 3.1 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
dzambare committed Dec 13, 2021
2 parents d3a65bd + e3d9b83 commit 3aa0044
Show file tree
Hide file tree
Showing 215 changed files with 59,371 additions and 45,210 deletions.
86 changes: 60 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")


SET(AOCL_BLIS_FAMILY "zen" CACHE STRING "AOCL BLIS family name")
SET(OPENMP_PATH "C:\\Program Files\\LLVM\\lib" CACHE STRING "openmp library
path")
set(TARGET_ARCH ${AOCL_BLIS_FAMILY})
set(AOCL_BLIS_ZEN TRUE)
set (PYTHON_EXE "python")

if ("${AOCL_BLIS_FAMILY}" STREQUAL "")
message(FATAL_ERROR "Machine configuration missing! Select one of zen, zen2, zen3 or amd64")
message(FATAL_ERROR "Machine configuration missing! Select one of zen, zen2, zen3 or amdzen")
endif ()

if (${AOCL_BLIS_FAMILY} STREQUAL "auto")
Expand Down Expand Up @@ -48,9 +50,9 @@ elseif (${AOCL_BLIS_FAMILY} STREQUAL "zen3")
add_definitions(-DBLIS_KERNELS_ZEN2)
add_definitions(-DBLIS_KERNELS_ZEN)
add_definitions(-DBLIS_KERNELS_HASWELL)
elseif (${AOCL_BLIS_FAMILY} STREQUAL "amd64")
elseif (${AOCL_BLIS_FAMILY} STREQUAL "amdzen")
set(AOCL_BLIS_ZEN FALSE)
add_definitions(-DBLIS_FAMILY_AMD64)
add_definitions(-DBLIS_FAMILY_AMDZEN)
add_definitions(-DBLIS_CONFIG_ZEN3)
add_definitions(-DBLIS_CONFIG_ZEN2)
add_definitions(-DBLIS_CONFIG_ZEN)
Expand All @@ -61,7 +63,7 @@ elseif (${AOCL_BLIS_FAMILY} STREQUAL "amd64")
add_definitions(-DBLIS_KERNELS_ZEN)
add_definitions(-DBLIS_KERNELS_GENERIC)
else ()
message(FATAL_ERROR "Wrong machine configuration. Select one of zen, zen2, zen3 or amd64")
message(FATAL_ERROR "Wrong machine configuration. Select one of zen, zen2, zen3 or amdzen")
endif ()

set(TARGET_ARCH ${AOCL_BLIS_FAMILY})
Expand Down Expand Up @@ -89,11 +91,23 @@ option(ENABLE_INT_TYPE_SIZE " Internal BLIS integers ,used in native BLIS interf
option(ENABLE_BLASTEST "Enable the blastest" OFF)
option(ENABLE_TESTCPP_TESTING "Enabling testcpp" OFF)
option (ENABLE_NO_UNDERSCORE_API "export APIs without underscore" ON)
option (ENABLE_UPPERCASE "export APIs with uppercase" OFF)
option (ENABLE_UPPERCASE_API "export APIs with uppercase" OFF)
option (ENABLE_API_WRAPPER "Enable wrapper code" OFF)
option (ENABLE_COMPLEX_RETURN_INTEL "Enable complex_return_intel" OFF)
option (ENABLE_TRSM_PREINVERSION "Enable TRSM preinversion" ON)
option (ENABLE_AOCL_DYNAMIC "Enable Dynamic Multi-threading" OFF)

if (${AOCL_BLIS_FAMILY} STREQUAL "amdzen")
set(REF_KERNEL_MIRRORING_PY "${CMAKE_SOURCE_DIR}/build/blis_ref_kernel_mirror.py")
message("ref_kernel mirroring for fat binary")
# Run python script to find the architecture family name
execute_process(
COMMAND ${PYTHON_EXE} ${REF_KERNEL_MIRRORING_PY} ${CMAKE_BINARY_DIR}
RESULT_VARIABLE CMD_RESULT
OUTPUT_VARIABLE CMD_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE)
message( STATUS "Ref Kernel Mirroring :" ${CMD_OUTPUT})
endif()
if(ENABLE_NO_UNDERSCORE_API)
add_definitions(-DBLIS_ENABLE_NO_UNDERSCORE_API)
endif()
Expand All @@ -104,8 +118,12 @@ else()
set(BLIS_DISABLE_COMPLEX_RETURN_INTEL TRUE)
endif()

if(ENABLE_UPPERCASE)
add_definitions(-DBLIS_ENABLE_UPPERCASE)
if(ENABLE_UPPERCASE_API)
add_definitions(-DBLIS_ENABLE_UPPERCASE_API)
endif()

if(ENABLE_API_WRAPPER)
add_definitions(-DBLIS_ENABLE_API_WRAPPER)
endif()

if(ENABLE_AOCL_DYNAMIC)
Expand All @@ -132,7 +150,7 @@ endif ()
if (ENABLE_TRSM_PREINVERSION)
set(BLIS_ENABLE_TRSM_PREINVERSION TRUE)
else()
set(BLIS_DISABLE_TRSM_PREINVERSION TRUE)
add_definitions(-DBLIS_DISABLE_TRSM_PREINVERSION)
endif()

if (ENABLE_INT_TYPE_SIZE)
Expand Down Expand Up @@ -242,6 +260,7 @@ if(ENABLE_MULTITHREADING)
find_package(OpenMP)
if (OPENMP_FOUND)
set(BLIS_ENABLE_OPENMP TRUE)
add_compile_options(-Xclang -fopenmp)
else()
message (FATAL_ERROR "Openmp Not Found")
endif()
Expand Down Expand Up @@ -291,14 +310,16 @@ endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0 ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Oi")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
set(INTR_GENERAL_LINK_FLAGS "${INTR_GENERAL_LINK_FLAGS} /RELEGE")
set(INTR_GENERAL_LINK_FLAGS "${INTR_GENERAL_LINK_FLAGS} /RELEGE")

add_definitions(-D_CRT_SECURE_NO_DEPRECATE)

#add_definitions(-DBLIS_OS_WINDOWS)
add_definitions(-D_MSC_VER)
if (${AOCL_BLIS_FAMILY} STREQUAL "amdzen")
else()
add_definitions(-DBLIS_CNAME=${TARGET_ARCH})

endif()
# Generate the bli_config.h header file
configure_file (build/bli_win_config.h.in ${CMAKE_SOURCE_DIR}/bli_config.h @ONLY)

Expand Down Expand Up @@ -372,6 +393,12 @@ include_directories(${CMAKE_SOURCE_DIR}/config/generic)
include_directories(${CMAKE_SOURCE_DIR}/config/zen)
include_directories(${CMAKE_SOURCE_DIR}/config/zen2)
include_directories(${CMAKE_SOURCE_DIR}/config/zen3)
if(${AOCL_BLIS_FAMILY} STREQUAL "amdzen")
include_directories(${CMAKE_BINARY_DIR}/ref_kernels/generic)
include_directories(${CMAKE_BINARY_DIR}/ref_kernels/zen)
include_directories(${CMAKE_BINARY_DIR}/ref_kernels/zen2)
include_directories(${CMAKE_BINARY_DIR}/ref_kernels/zen3)
endif()
include_directories(${CMAKE_SOURCE_DIR}/ref_kernels)
include_directories(${CMAKE_SOURCE_DIR}/kernels)
include_directories(${CMAKE_SOURCE_DIR}/kernels/haswell)
Expand All @@ -394,22 +421,20 @@ find_package(PythonLibs 3 REQUIRED)

string(APPEND HEADER_PATH
if(${AOCL_BLIS_FAMILY} STREQUAL "zen")
" ${CMAKE_CURRENT_SOURCE_DIR}/config/zen/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/zen/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/haswell/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/zen/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/zen/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/haswell/"
elseif (${AOCL_BLIS_FAMILY} STREQUAL "zen2")
" ${CMAKE_CURRENT_SOURCE_DIR}/config/zen2/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/zen/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/haswell/"
elseif (${AOCL_BLIS_FAMILY} STREQUAL "amd64")
" ${CMAKE_CURRENT_SOURCE_DIR}/config/amd64/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/bulldozer/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/excavator/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/zen2/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/zen/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/haswell/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/amdzen/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/zen/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/zen2/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/zen3/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/generic/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/piledriver/"
" ${CMAKE_CURRENT_SOURCE_DIR}/config/steamroller/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/piledriver/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/bulldozer/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/zen/"
" ${CMAKE_CURRENT_SOURCE_DIR}/kernels/haswell/"
endif ()
" ${CMAKE_CURRENT_SOURCE_DIR}/frame/0/"
" ${CMAKE_CURRENT_SOURCE_DIR}/frame/0/copysc/"
Expand Down Expand Up @@ -502,19 +527,28 @@ message( STATUS "Generating monolithic header file :" ${CMD_OUTPUT})
# setting the blis version string
file (STRINGS "version" BLIS_VERSION)
set(BLIS_VERSION_STRING ${BLIS_VERSION})
add_definitions(-DBLIS_VERSION_STRING="${BLIS_VERSION_STRING}")
add_definitions(-DBLIS_VERSION_STRING="AOCL BLIS ${BLIS_VERSION_STRING}")

message( STATUS "OPENMP PATH:" ${OPENMP_PATH})
link_directories("${OPENMP_PATH}")

if(BUILD_SHARED_LIBS)
add_library("${PROJECT_NAME}" SHARED ${CMAKE_SOURCE_DIR}/bli_config.h
${CMAKE_SOURCE_DIR}/include/${TARGET_ARCH}/blis.h
${headers})
if(ENABLE_OPENMP)
target_link_libraries("${PROJECT_NAME}" PUBLIC "${OPENMP_PATH}/libomp.lib")
endif()
target_compile_definitions("${PROJECT_NAME}" PUBLIC -DBLIS_IS_BUILDING_LIBRARY)
set_target_properties("${PROJECT_NAME}" PROPERTIES LINKER_LANGUAGE C OUTPUT_NAME "${LIB_NAME}")
endif()
if(NOT BUILD_SHARED_LIBS)
add_library("${PROJECT_NAME}" STATIC ${CMAKE_SOURCE_DIR}/bli_config.h
${CMAKE_SOURCE_DIR}/include/${TARGET_ARCH}/blis.h
${headers})
if(ENABLE_OPENMP)
target_link_libraries("${PROJECT_NAME}" PUBLIC "${OPENMP_PATH}/libomp.lib")
endif()
set_target_properties("${PROJECT_NAME}" PROPERTIES LINKER_LANGUAGE C OUTPUT_NAME "${LIB_NAME}")
endif()

Expand All @@ -529,7 +563,7 @@ add_subdirectory(aocl_dtl)
add_subdirectory(test)
add_subdirectory(testsuite)
if(ENABLE_TESTCPP_TESTING)
add_subdirectory(testcpp)
add_subdirectory(vendor/testcpp)
endif()
if (ENABLE_BLASTEST)
add_subdirectory(blastest)
Expand Down
63 changes: 31 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#
#
# BLIS
# BLIS
# An object-based framework for developing high-performance BLAS-like
# libraries.
#
# Copyright (C) 2014, The University of Texas at Austin
# Copyright (C) 2021, Advanced Micro Devices, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -36,7 +37,7 @@
# Makefile
#
# Field G. Van Zee
#
#
# Top-level makefile for libflame linear algebra library.
#
#
Expand Down Expand Up @@ -257,16 +258,9 @@ ifeq ($(MK_ENABLE_CBLAS),yes)
HEADERS_TO_INSTALL += $(CBLAS_H_FLAT)
endif

# Install BLIS CPP Template header files
HEADERS_TO_INSTALL += $(CPP_HEADER_DIR)/*.hh

# If requested, include AMD's C++ template header files in the list of headers
# Include AMD's C++ template header files in the list of headers
# to install.
ifeq ($(INSTALL_HH),yes)
HEADERS_TO_INSTALL += $(wildcard $(VEND_CPP_PATH)/*.hh)
endif



#
# --- public makefile fragment definitions -------------------------------------
Expand Down Expand Up @@ -720,7 +714,7 @@ endif

# --- BLAS test suite rules ---

testblas: blastest-run
testblas: blastest-run

blastest-f2c: check-env $(BLASTEST_F2C_LIB)

Expand Down Expand Up @@ -903,7 +897,7 @@ endif

# Check results of BLIS CPP Template tests
checkbliscpp:
$(MAKE) -C $(CPP_TEST_DIR)
$(MAKE) -C $(VEND_TESTCPP_DIR)

# Check the results of the BLIS testsuite.
checkblis: testsuite-run
Expand Down Expand Up @@ -1091,24 +1085,29 @@ endif # ifeq ($(IS_WIN),no)
# --- Query current configuration ---

showconfig: check-env
@echo "configuration family: $(CONFIG_NAME)"
@echo "sub-configurations: $(CONFIG_LIST)"
@echo "requisite kernels sets: $(KERNEL_LIST)"
@echo "kernel-to-config map: $(KCONFIG_MAP)"
@echo "configuration family: $(CONFIG_NAME)"
@echo "sub-configurations: $(CONFIG_LIST)"
@echo "requisite kernels sets: $(KERNEL_LIST)"
@echo "kernel-to-config map: $(KCONFIG_MAP)"
@echo "-------------------------"
@echo "BLIS version string: $(VERSION)"
@echo ".so major version: $(SO_MAJOR)"
@echo ".so minor.build vers: $(SO_MINORB)"
@echo "install libdir: $(INSTALL_LIBDIR)"
@echo "install includedir: $(INSTALL_INCDIR)"
@echo "install sharedir: $(INSTALL_SHAREDIR)"
@echo "debugging status: $(DEBUG_TYPE)"
@echo "multithreading status: $(THREADING_MODEL)"
@echo "enable BLAS API? $(MK_ENABLE_BLAS)"
@echo "enable CBLAS API? $(MK_ENABLE_CBLAS)"
@echo "build static library? $(MK_ENABLE_STATIC)"
@echo "build shared library? $(MK_ENABLE_SHARED)"
@echo "ARG_MAX hack enabled? $(ARG_MAX_HACK)"
@echo "BLIS version string: $(VERSION)"
@echo ".so major version: $(SO_MAJOR)"
@echo ".so minor.build vers: $(SO_MINORB)"
@echo "install libdir: $(INSTALL_LIBDIR)"
@echo "install includedir: $(INSTALL_INCDIR)"
@echo "install sharedir: $(INSTALL_SHAREDIR)"
@echo "debugging status: $(DEBUG_TYPE)"
@echo "multithreading status: $(THREADING_MODEL)"
@echo "enable BLAS API? $(MK_ENABLE_BLAS)"
@echo "enable CBLAS API? $(MK_ENABLE_CBLAS)"
@echo "build static library? $(MK_ENABLE_STATIC)"
@echo "build shared library? $(MK_ENABLE_SHARED)"
@echo "ARG_MAX hack enabled? $(ARG_MAX_HACK)"
@echo "complex return scheme: $(MK_COMPLEX_RETURN_SCHEME)"
@echo "enable trsm preinversion: $(MK_ENABLE_TRSM_PREINVERSION)"
@echo "enable AOCL dynamic threads: $(MK_ENABLE_AOCL_DYNAMIC)"
@echo "BLAS Integer size(LP/ILP): $(MK_BLAS_INT_TYPE_SIZE)"



# --- Clean rules ---
Expand Down Expand Up @@ -1242,13 +1241,13 @@ ifeq ($(IS_CONFIGURED),yes)
ifeq ($(ENABLE_VERBOSE),yes)
- $(FIND) $(TESTSUITE_DIR)/$(OBJ_DIR) -name "*.o" | $(XARGS) $(RM_F)
- $(RM_F) $(TESTSUITE_DIR)/$(TESTSUITE_BIN)
- $(MAKE) -C $(CPP_TEST_DIR) clean
- $(MAKE) -C $(VEND_TESTCPP_DIR) clean
else
@echo "Removing object files from $(TESTSUITE_DIR)/$(OBJ_DIR)"
@- $(FIND) $(TESTSUITE_DIR)/$(OBJ_DIR) -name "*.o" | $(XARGS) $(RM_F)
@echo "Removing binary $(TESTSUITE_DIR)/$(TESTSUITE_BIN)"
@- $(RM_F) $(TESTSUITE_DIR)/$(TESTSUITE_BIN)
@$(MAKE) -C $(CPP_TEST_DIR) clean
@$(MAKE) -C $(VEND_TESTCPP_DIR) clean
endif # ENABLE_VERBOSE
endif # IS_CONFIGURED

Expand Down Expand Up @@ -1282,7 +1281,7 @@ endif

changelog:
@echo "Updating '$(DIST_PATH)/$(CHANGELOG)' via '$(GIT_LOG)'"
@$(GIT_LOG) > $(DIST_PATH)/$(CHANGELOG)
@$(GIT_LOG) > $(DIST_PATH)/$(CHANGELOG)


# --- Uninstall rules ---
Expand Down
Loading

0 comments on commit 3aa0044

Please sign in to comment.