mirror of
https://github.com/amd/blis.git
synced 2026-05-25 02:44:31 +00:00
- This change in made in CMAKE build system only. - Removed -fno-tree-loop-vectorize from global kernel flags, instead added it to lpgemm specific kernels only. - If this flag is not used , then gcc tries to auto vectorize the code which results in usages of vector registers, if the auto vectorized function is using intrinsics then the total numbers of vector registers used by intrinsic and auto vectorized code becomes more than the registers available in machine which causes read and writes to stack, which is causing regression in lpgemm. - If this flag is enabled globally, then the files which do not use any intrinsic code do not get auto vectorized. - To get optimal performance for both blis and lpgemm, this flag is enabled for lpgemm kernels only. Change-Id: I14e5c18cd53b058bfc9d764a8eaf825b4d0a81c4
47 lines
1.3 KiB
CMake
47 lines
1.3 KiB
CMake
##Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc. All rights reserved. ##
|
|
|
|
# Include file containing common flags for all AMD architectures
|
|
include(${CMAKE_SOURCE_DIR}/config/zen/amd_config.cmake)
|
|
if(NOT WIN32)
|
|
if(NOT (DEBUG_TYPE STREQUAL "off"))
|
|
set(CDBGFLAGS -g)
|
|
endif()
|
|
|
|
if(DEBUG_TYPE STREQUAL "noopt")
|
|
set(COPTFLAGS -O0)
|
|
else() # off or opt
|
|
set(COPTFLAGS -O3)
|
|
endif()
|
|
endif()
|
|
|
|
# Flags specific to LPGEMM kernels.
|
|
set(CKLPOPTFLAGS "")
|
|
|
|
# Flags specific to optimized kernels.
|
|
# NOTE: The -fomit-frame-pointer option is needed for some kernels because
|
|
# they make explicit use of the rbp register.
|
|
if(MSVC)
|
|
set(CKOPTFLAGS ${COPTFLAGS} /Oy)
|
|
else()
|
|
set(CKOPTFLAGS ${COPTFLAGS} -fomit-frame-pointer)
|
|
endif()
|
|
|
|
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
|
list(APPEND CKVECFLAGS -march=znver1)
|
|
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0.0)
|
|
list(APPEND CKLPOPTFLAGS -fno-tree-partial-pre -fno-tree-pre -fno-tree-loop-vectorize -fno-gcse)
|
|
endif()
|
|
endif()
|
|
|
|
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
|
list(APPEND CKVECFLAGS -march=znver1)
|
|
endif() # clang
|
|
|
|
# Flags specific to reference kernels.
|
|
set(CROPTFLAGS ${CKOPTFLAGS})
|
|
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
|
set(CRVECFLAGS ${CKVECFLAGS})
|
|
else()
|
|
set(CRVECFLAGS ${CKVECFLAGS})
|
|
endif()
|