diff --git a/0001-tests-fix-build-issues-on-QNX.patch b/0001-tests-fix-build-issues-on-QNX.patch new file mode 100644 index 0000000000000000000000000000000000000000..6e548658dc30685627f05c6f6932d64385d7ca7d --- /dev/null +++ b/0001-tests-fix-build-issues-on-QNX.patch @@ -0,0 +1,63 @@ +From bae5eda24f3d5e257a99bdffafc91d87e1e1278e Mon Sep 17 00:00:00 2001 +From: Pablo Romero +Date: Sun, 3 Oct 2021 07:48:39 +0200 +Subject: [PATCH 1/4] tests: fix build issues on QNX + +This fixes #1164. Add required macros and libraries for QNX. +This fixes #1165. Set required libraries to link for QNX. +--- + tests/benchdnn/CMakeLists.txt | 7 +++++-- + tests/benchdnn/dnnl_common.cpp | 2 +- + tests/gtests/gtest/CMakeLists.txt | 4 +++- + 3 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/tests/benchdnn/CMakeLists.txt b/tests/benchdnn/CMakeLists.txt +index c4d7e00ee..4ff1bd281 100644 +--- a/tests/benchdnn/CMakeLists.txt ++++ b/tests/benchdnn/CMakeLists.txt +@@ -35,10 +35,13 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + append_if(UNIX CMAKE_CXX_FLAGS "-prec-div -prec-sqrt -fp-model precise") + endif() + +-if(UNIX AND NOT APPLE) ++if(UNIX AND NOT APPLE AND NOT QNXNTO) + find_library(LIBRT rt) ++elseif(QNXNTO) ++ find_library(LIBREGEX regex) ++ find_library(LIBSOCKET socket) + endif() +-register_exe(benchdnn "${SOURCES}" "" "${LIBRT}") ++register_exe(benchdnn "${SOURCES}" "" "${LIBRT};${LIBREGEX};${LIBSOCKET}") + + file(COPY inputs DESTINATION .) + +diff --git a/tests/benchdnn/dnnl_common.cpp b/tests/benchdnn/dnnl_common.cpp +index 18af190e7..244583bd1 100644 +--- a/tests/benchdnn/dnnl_common.cpp ++++ b/tests/benchdnn/dnnl_common.cpp +@@ -460,7 +460,7 @@ static size_t get_cpu_ram_size() { + GlobalMemoryStatusEx(&s); + return s.ullTotalPhys; + } +-#elif defined(__APPLE__) || defined(__FreeBSD__) ++#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__QNXNTO__) + #include + #include + +diff --git a/tests/gtests/gtest/CMakeLists.txt b/tests/gtests/gtest/CMakeLists.txt +index eacac64f1..2fb7b4f4f 100644 +--- a/tests/gtests/gtest/CMakeLists.txt ++++ b/tests/gtests/gtest/CMakeLists.txt +@@ -13,6 +13,8 @@ add_library(${TARGET_NAME} STATIC ${MAIN_SRC}) + # In that case FindThreads module may skip adding any flags for pthread library + # because they are not needed for C compiler but this may led to issues with + # C++ compiler which is not checked. +-if(UNIX OR MINGW) ++if((UNIX AND NOT QNXNTO) OR MINGW) + target_link_libraries(${TARGET_NAME} pthread) ++elseif(QNXNTO) ++ target_link_libraries(${TARGET_NAME} regex) + endif() +-- +2.17.1 + diff --git a/0002-build-fix-to-include-path-for-ArmPL-builds.-1111.patch b/0002-build-fix-to-include-path-for-ArmPL-builds.-1111.patch new file mode 100644 index 0000000000000000000000000000000000000000..7641b0cd45cf65f80e03e6a761855f74b2307b24 --- /dev/null +++ b/0002-build-fix-to-include-path-for-ArmPL-builds.-1111.patch @@ -0,0 +1,31 @@ +From a66a10e8b9b11ee238a82058bb2bb895b018cb24 Mon Sep 17 00:00:00 2001 +From: nSircombe <32057673+nSircombe@users.noreply.github.com> +Date: Fri, 9 Jul 2021 01:02:34 +0100 +Subject: [PATCH 2/4] build: fix to include path for ArmPL builds. (#1111) + +--- + cmake/blas.cmake | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/cmake/blas.cmake b/cmake/blas.cmake +index 4a5712496..7dc113fd5 100644 +--- a/cmake/blas.cmake ++++ b/cmake/blas.cmake +@@ -1,5 +1,5 @@ + # ******************************************************************************* +-# Copyright 2020 Arm Limited and affiliates. ++# Copyright 2020-2021 Arm Limited and affiliates. + # SPDX-License-Identifier: Apache-2.0 + # + # Licensed under the Apache License, Version 2.0 (the "License"); +@@ -51,6 +51,7 @@ if(DNNL_BLAS_VENDOR STREQUAL "MKL") + elseif(DNNL_BLAS_VENDOR STREQUAL "OPENBLAS") + set(BLA_VENDOR "OpenBLAS") + elseif(DNNL_BLAS_VENDOR STREQUAL "ARMPL") ++ set(CBLAS_HEADERS "armpl.h") + expect_arch_or_generic("AARCH64") + if(DNNL_CPU_RUNTIME STREQUAL "OMP") + set(BLA_VENDOR "Arm_mp") +-- +2.17.1 + diff --git a/0003-cpu-aarch64-missing-include-for-arm_compute-Schedule.patch b/0003-cpu-aarch64-missing-include-for-arm_compute-Schedule.patch new file mode 100644 index 0000000000000000000000000000000000000000..8951ddf7dda010a12c9a958e7469324633403eb4 --- /dev/null +++ b/0003-cpu-aarch64-missing-include-for-arm_compute-Schedule.patch @@ -0,0 +1,24 @@ +From e2f932bbf0d06734461a3f344c9d6a5062723057 Mon Sep 17 00:00:00 2001 +From: Alexandre Truong +Date: Wed, 28 Apr 2021 10:32:35 +0100 +Subject: [PATCH 3/4] cpu: aarch64: missing include for arm_compute::Scheduler + +--- + src/cpu/aarch64/acl_indirect_gemm_convolution.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/cpu/aarch64/acl_indirect_gemm_convolution.hpp b/src/cpu/aarch64/acl_indirect_gemm_convolution.hpp +index 86d2bed73..040311f8c 100644 +--- a/src/cpu/aarch64/acl_indirect_gemm_convolution.hpp ++++ b/src/cpu/aarch64/acl_indirect_gemm_convolution.hpp +@@ -26,6 +26,7 @@ + + #include "arm_compute/runtime/FunctionDescriptors.h" + #include "arm_compute/runtime/NEON/NEFunctions.h" ++#include "arm_compute/runtime/Scheduler.h" + + namespace dnnl { + namespace impl { +-- +2.17.1 + diff --git a/0004-cpu-x64-amx-Remove-errorneous-use-of-UINT8_C.patch b/0004-cpu-x64-amx-Remove-errorneous-use-of-UINT8_C.patch new file mode 100644 index 0000000000000000000000000000000000000000..b6dafd01cd9d4fe3136484e0be3e10102071bd69 --- /dev/null +++ b/0004-cpu-x64-amx-Remove-errorneous-use-of-UINT8_C.patch @@ -0,0 +1,28 @@ +From 6067e2fd599b1133c0d7b404fe7a1ca0e04432b0 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Mon, 8 Mar 2021 11:22:22 -0600 +Subject: [PATCH 4/4] cpu: x64: amx: Remove errorneous use of UINT8_C + +UINT8_C should only be used for converting an integer literal to uint8_t, +but 'no' is not an integer literal an is a uint8_t variable. If UINT8_C(v) +is defined as 'v ## U`, then this fails to compile +--- + src/cpu/x64/jit_avx512_core_amx_conv_kernel.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cpu/x64/jit_avx512_core_amx_conv_kernel.cpp b/src/cpu/x64/jit_avx512_core_amx_conv_kernel.cpp +index 00792f450..9cc71b2ad 100644 +--- a/src/cpu/x64/jit_avx512_core_amx_conv_kernel.cpp ++++ b/src/cpu/x64/jit_avx512_core_amx_conv_kernel.cpp +@@ -480,7 +480,7 @@ void jit_avx512_core_amx_copy_to_wbuffer_t::generate() { + const uint8_t nr = is_bf16 ? 2 : 4; // 2r or 4r + for (uint8_t o = 0; o < no; ++o) { + for (uint8_t r = 0; r < nr; r++) { +- const uint8_t index = o + r * UINT8_C(no); ++ const uint8_t index = o + r * no; + if (is_bf16) + dw(index); + else +-- +2.17.1 + diff --git a/onednn.spec b/onednn.spec index fe6c3bf4673f2ee5436c38ceb69e386cd19f4308..5b20a08a46da327cff6b86296c01a86f8583a7db 100644 --- a/onednn.spec +++ b/onednn.spec @@ -2,13 +2,18 @@ Name: onednn Version: 2.2 -Release: 1 +Release: 2 Summary: Deep Neural Network Library License: ASL 2.0 and BSD and Boost and MIT URL: https://github.com/oneapi-src/oneDNN/ Source0: %{url}/archive/v%{version}/onednn-%{version}.tar.gz +Patch0: 0001-tests-fix-build-issues-on-QNX.patch +Patch1: 0002-build-fix-to-include-path-for-ArmPL-builds.-1111.patch +Patch2: 0003-cpu-aarch64-missing-include-for-arm_compute-Schedule.patch +Patch3: 0004-cpu-x64-amx-Remove-errorneous-use-of-UINT8_C.patch + # This package only work in few arches for now ExclusiveArch: x86_64 aarch64 ppc64le @@ -96,7 +101,8 @@ rm -rf %{buildroot}%{_docdir}/dnnl %changelog - +* Wed Dec 1 2021 baihuawei - 2.2-2 +- Fix bugs. * Wed Sep 30 2021 baihuawei - 2.2-1 - Update to 2.2 to match latest MindSpore. * Sun Dec 13 2020 sinever - 1.6-1