Fix gcc 7.5 compilation error for zen4 and above configs

For gcc greater than or equal to 7.0 version added AVX512 compiler flags
    in makde_defs.mk and make_defs.cmake. AVX512VNNI compiler flag is only
    supported from gcc version 8 or greater. So added another else condition
    for gcc version greater than or equal to 7 - enabling avx512 flags.
    This enables compilation of AVX512 assembly code paths with gcc 7.5 version.

Change-Id: I2cda00e578010db5e5a515b506c0b99f685307e0
This commit is contained in:
Kiran Varaganti
2024-02-15 11:35:49 +05:30
committed by Jagadish1 R
parent aacb5f6b3a
commit 0784679d4d
2 changed files with 12 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
##Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. ##
##Copyright (C) 2023-2024, Advanced Micro Devices, Inc. All rights reserved. ##
# FLAGS that are specific to the 'zen4' architecture are added here.
# FLAGS that are common for all the AMD architectures are present in
@@ -52,8 +52,12 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# gcc 8.0 or later
list(APPEND CKVECFLAGS -march=znver1 -mavx512f -mavx512dq -mavx512bw -mavx512vl -mavx512vnni)
list(APPEND CRVECFLAGS -march=znver1)
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0.0)
# gcc 7.0 or later
list(APPEND CKVECFLAGS -march=znver1 -mavx512f -mavx512dq -mavx512bw -mavx512vl)
list(APPEND CRVECFLAGS -march=znver1)
else()
# If gcc is older than 8.0.0 but at least 6.1.0, then we can use -march=znver1
# If gcc is older than 7.0.0 but at least 6.1.0, then we can use -march=znver1
# as the fallback option.
list(APPEND CKVECFLAGS -march=znver1 -mno-avx256-split-unaligned-store)
list(APPEND CRVECFLAGS -march=znver1 -mno-avx256-split-unaligned-store)

View File

@@ -4,7 +4,7 @@
# An object-based framework for developing high-performance BLAS-like
# libraries.
#
# Copyright (C) 2022 - 2023, Advanced Micro Devices, Inc. All rights reserved.
# Copyright (C) 2022 - 2024, 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
@@ -102,8 +102,12 @@ ifeq ($(CC_VENDOR),gcc)
# gcc 8.0 or later
CKVECFLAGS += -march=znver1 -mavx512f -mavx512dq -mavx512bw -mavx512vl -mavx512vnni
CRVECFLAGS += -march=znver1
else ifeq ($(shell test $(GCC_VERSION) -ge 7; echo $$?),0)
# gcc 7.0 or later
CKVECFLAGS += -march=znver1 -mavx512f -mavx512dq -mavx512bw -mavx512vl
CRVECFLAGS += -march=znver1
else
# If gcc is older than 8.0.0 but at least 6.1.0, then we can use -march=znver1
# If gcc is older than 7.0.0 but at least 6.1.0, then we can use -march=znver1
# as the fallback option.
CKVECFLAGS += -march=znver1 -mno-avx256-split-unaligned-store
CRVECFLAGS += -march=znver1 -mno-avx256-split-unaligned-store