Skip to content

Commit 090a9c1

Browse files
author
Jae J4 Lo Presti
committed
fix#: try to add flag to disable avx
1 parent 2920608 commit 090a9c1

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/build-ydms.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Generate build files
3232
working-directory: ${{ env.wps }}
3333
run: |
34-
cmake -DOPTION_ENABLE_ALL_APPS=OFF -DOPTION_BUILD_CMP_SDK=ON -DOPTION_CMP_QT=OFF -DOPTION_BUILD_KTX2=ON -DOPTION_BUILD_EXR=ON -DOPTION_BUILD_GUI=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS="-march=icelake-client -mno-avx512f" ..
34+
cmake -DOPTION_ENABLE_ALL_APPS=OFF -DOPTION_BUILD_CMP_SDK=ON -DOPTION_CMP_QT=OFF -DOPTION_BUILD_KTX2=ON -DOPTION_BUILD_EXR=ON -DOPTION_BUILD_GUI=OFF -DBUILD_SHARED_LIBS=ON -DENABLE_AVX512=OFF ..
3535
- name: Build library
3636
working-directory: ${{ env.wps }}
3737
run: |

CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,17 @@ include(external/cmake/dependencyinfo.cmake)
287287
include(external/cmake/CMakeLists.txt)
288288
include(external/CMakeLists.txt)
289289

290+
include(CheckCXXCompilerFlag)
291+
check_cxx_compiler_flag("-mavx512f" COMPILER_SUPPORTS_AVX512F)
292+
293+
option(ENABLE_AVX512 "Build with AVX-512 support" OFF)
294+
295+
if (ENABLE_AVX512 AND COMPILER_SUPPORTS_AVX512F)
296+
add_library(CMP_Core_AVX512 cmp_core/source/core_simd_avx512.cpp)
297+
target_compile_options(CMP_Core_AVX512 PRIVATE -mavx512f)
298+
# Link and use as required
299+
endif()
300+
290301
if (CMP_HOST_WINDOWS)
291302
add_compile_definitions(_WIN32)
292303

@@ -598,4 +609,4 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "AMD")
598609
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://gpuopen.com/compressonator/")
599610
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
600611

601-
include(CPack)
612+
include(CPack)

0 commit comments

Comments
 (0)