Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
31f531f4ee
!21 添加loongarch64架构支持
From: @zhong-wei-shen 
Reviewed-by: @zhunaipan, @sinever, @wisespreading 
Signed-off-by: @zhunaipan, @sinever
2025-03-06 11:21:11 +00:00
沈仲伟
a8334cbeec add loongarch64 support
modify spec

modify spec
2024-05-16 20:32:50 +08:00
openeuler-ci-bot
87a9859d6f
!16 将riscv64加入支持的架构
From: @laokz 
Reviewed-by: @sinever 
Signed-off-by: @sinever
2023-03-08 08:52:04 +00:00
laokz
a75f42c515
add riscv64 to ExclusiveArch
Signed-off-by: laokz <zhangkai@iscas.ac.cn>
2023-02-08 02:05:11 +00:00
openeuler-ci-bot
d45a48dfe0
!14 [sync] PR-10: update oneDNN to 2.6 for AMX support
From: @openeuler-sync-bot 
Reviewed-by: @sinever 
Signed-off-by: @sinever
2022-10-31 14:32:42 +00:00
Jincheng Miao
a755901812 Update to 2.6 for AMX
Signed-off-by: Jincheng Miao <jincheng.miao@intel.com>
(cherry picked from commit 9caa1d09c41c48a4a3622f750520a9267a629ad8)
2022-10-28 18:25:26 +08:00
openeuler-ci-bot
a1cfc51f10 !8 fix spec file
Merge pull request !8 from baihuawei/fix_spec
2021-12-23 12:28:16 +00:00
baihuawei
ec40608a4a fix spec file 2021-12-22 16:45:17 +08:00
openeuler-ci-bot
c3b67245eb !6 bugfix
From: @huaweib
Reviewed-by: @sinever
Signed-off-by: @sinever
2021-12-01 09:16:40 +00:00
baihuawei
82666d93de bugfix 2021-12-01 16:19:20 +08:00
4 changed files with 64 additions and 15 deletions

View File

@ -0,0 +1,46 @@
diff -Naur oneDNN-2.6.bak/cmake/platform.cmake oneDNN-2.6/cmake/platform.cmake
--- oneDNN-2.6.bak/cmake/platform.cmake 2024-05-16 19:21:17.453108850 +0800
+++ oneDNN-2.6/cmake/platform.cmake 2024-05-16 19:38:59.705108850 +0800
@@ -195,8 +195,10 @@
if (CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR)
append(DEF_ARCH_OPT_FLAGS "-march=native")
endif()
- elseif(DNNL_TARGET_ARCH STREQUAL "X64")
- set(DEF_ARCH_OPT_FLAGS "-msse4.1")
+ elseif(DNNL_TARGET_ARCH STREQUAL "LOONGARCH64")
+ set(DEF_ARCH_OPT_FLAGS "-O3")
+ elseif(DNNL_TARGET_ARCH STREQUAL "X64")
+ set(DEF_ARCH_OPT_FLAGS "-msse4.1")
endif()
# Clang cannot vectorize some loops with #pragma omp simd and gets
# very upset. Tell it that it's okay and that we love it
@@ -297,7 +299,16 @@
elseif(DNNL_TARGET_ARCH STREQUAL "RV64")
# G = General-purpose extensions, C = Compression extension (very common).
append(DEF_ARCH_OPT_FLAGS "-march=rv64gc")
- elseif(DNNL_TARGET_ARCH STREQUAL "X64")
+ elseif(DNNL_TARGET_ARCH STREQUAL "LOONGARCH64")
+ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(DEF_ARCH_OPT_FLAGS "-O3")
+ endif()
+ # In GCC, -ftree-vectorize is turned on under -O3 since 2007.
+ # For native compilation tune for the host processor
+ if (CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR)
+ append(DEF_ARCH_OPT_FLAGS "-march=native")
+ endif()
+ elseif(DNNL_TARGET_ARCH STREQUAL "X64")
platform_gnu_x64_arch_ccxx_flags(DEF_ARCH_OPT_FLAGS)
endif()
platform_gnu_nowarn_ccxx_flags(CMAKE_CCXX_NOWARN_FLAGS ${CMAKE_CXX_COMPILER_VERSION})
diff -Naur oneDNN-2.6.bak/CMakeLists.txt oneDNN-2.6/CMakeLists.txt
--- oneDNN-2.6.bak/CMakeLists.txt 2024-05-16 19:21:17.449108850 +0800
+++ oneDNN-2.6/CMakeLists.txt 2024-05-16 19:33:40.165108850 +0800
@@ -95,6 +95,8 @@
set(DNNL_TARGET_ARCH "S390X")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(rv.*|RV.*|riscv.*|RISCV.*)")
set(DNNL_TARGET_ARCH "RV64")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(larch64.*|loongarch64.*|loongarch64-64.*)")
+ set(DNNL_TARGET_ARCH "LOONGARCH64")
else()
set(DNNL_TARGET_ARCH "X64")
endif()

Binary file not shown.

BIN
onednn-2.6.tar.gz Normal file

Binary file not shown.

View File

@ -1,16 +1,17 @@
%global __cmake_in_source_build 1
Name: onednn
Version: 2.2
Release: 1
Version: 2.6
Release: 3
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-oneDNN-2.6.2-add-loongarch64-support.patch
# This package only work in few arches for now
ExclusiveArch: x86_64 aarch64 ppc64le
# This package only work in 64bit arches for now
ExclusiveArch: x86_64 aarch64 riscv64 loongarch64
BuildRequires: cmake doxygen gcc-c++
@ -59,7 +60,7 @@ mkdir -p build && cd build
%make_build
%check
ctest
cd build && ctest
%install
cd build
@ -78,25 +79,27 @@ rm -rf %{buildroot}%{_docdir}/dnnl
%doc README.md CONTRIBUTING.md CODE_OF_CONDUCT.md
%{_libdir}/libdnnl.so.2
%{_libdir}/libdnnl.so.2.*
%{_libdir}/libmkldnn.so.2
%{_libdir}/libmkldnn.so.2.*
%files devel
%{_includedir}/mkldnn*.h*
%dir %{_includedir}/oneapi
%{_includedir}/oneapi/dnnl
%{_includedir}/dnnl*.h*
%dir %{_includedir}/oneapi/dnnl
%{_includedir}/oneapi/dnnl/*
%{_libdir}/libdnnl.so
%{_libdir}/libmkldnn.so
%dir %{_libdir}/cmake/dnnl
%{_libdir}/cmake/dnnl/*.cmake
%dir %{_libdir}/cmake/mkldnn
%{_libdir}/cmake/mkldnn/*.cmake
%changelog
* Thu May 16 2024 shenzhongwei <shenzhongwei@kylinos.cn> - 2.6-3
- Add loongarch64 support
* Wed Feb 8 2023 laokz <zhangkai@iscas.ac.cn> - 2.6-2
- Add riscv64 to ExclusiveArch.
* Sat Aug 6 2022 wisespreading <wisespreading@gmail.com> - 2.6-1
- Update to 2.6 for AMX
* Wed Dec 22 2021 baihuawei <baihuawei@huawei.com> - 2.2-3
- Fix spec file.
* Wed Dec 1 2021 baihuawei <baihuawei@huawei.com> - 2.2-2
- Fix bugs.
* Wed Sep 30 2021 baihuawei <baihuawei@huawei.com> - 2.2-1
- Update to 2.2 to match latest MindSpore.
* Sun Dec 13 2020 sinever <sinever@126.com> - 1.6-1