public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/onednn] f45: Add XPU support to existing pkgs
@ 2026-11-24 22:56 Pavel Androniychuk
  0 siblings, 0 replies; only message in thread
From: Pavel Androniychuk @ 2026-11-24 22:56 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/onednn
            Branch : f45
            Commit : 3742e6fed18c36f9a34364b8ef0434fb2319889d
            Author : Pavel Androniychuk <pavel.androniychuk@intel.com>
            Date   : 2026-10-22T21:40:27+00:00
            Stats  : +50/-267 in 7 file(s)
            URL    : https://src.fedoraproject.org/rpms/onednn/c/3742e6fed18c36f9a34364b8ef0434fb2319889d?branch=f45

            Log:
            Add XPU support to existing pkgs

Drop old patches

---
diff --git a/0001-Add-thread-for-gcc-11.patch b/0001-Add-thread-for-gcc-11.patch
deleted file mode 100644
index 9dc9fd5..0000000
--- a/0001-Add-thread-for-gcc-11.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From c3b239d62d6853e0f4343c43ada31b201788f683 Mon Sep 17 00:00:00 2001
-From: Nicolas Chauvet <kwizart@gmail.com>
-Date: Sat, 3 Apr 2021 13:55:28 +0200
-Subject: [PATCH 1/2] Add thread for gcc-11
-
-Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
----
- src/common/primitive_cache.cpp | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/common/primitive_cache.cpp b/src/common/primitive_cache.cpp
-index 3df1a6370eed..f33950ce0098 100644
---- a/src/common/primitive_cache.cpp
-+++ b/src/common/primitive_cache.cpp
-@@ -28,6 +28,7 @@
- #endif
- 
- #include <algorithm>
-+#include <thread>
- #include <unordered_map>
- 
- #ifdef _WIN32
--- 
-2.31.1
-

diff --git a/0001-ppc64-nerf-the-cpu-code.patch b/0001-ppc64-nerf-the-cpu-code.patch
deleted file mode 100644
index 9305202..0000000
--- a/0001-ppc64-nerf-the-cpu-code.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 70e4a7d1d18b00223ba211606394bbf45504cc69 Mon Sep 17 00:00:00 2001
-From: Adam Jackson <ajax@redhat.com>
-Date: Thu, 11 Sep 2025 14:56:55 -0400
-Subject: [PATCH] ppc64: nerf the cpu code
-
----
- src/cpu/CMakeLists.txt                         | 13 -------------
- src/cpu/reorder/cpu_reorder_regular_f32_u8.cpp |  2 --
- 2 files changed, 15 deletions(-)
-
-diff --git a/src/cpu/CMakeLists.txt b/src/cpu/CMakeLists.txt
-index 10504d1a34..9ce7e00901 100644
---- a/src/cpu/CMakeLists.txt
-+++ b/src/cpu/CMakeLists.txt
-@@ -39,16 +39,6 @@ if((DNNL_TARGET_ARCH STREQUAL "X64") OR (DNNL_TARGET_ARCH STREQUAL "AARCH64"))
-     endforeach()
- endif()
- 
--if(DNNL_TARGET_ARCH STREQUAL "PPC64")
--    file(GLOB FILES_REQUIRED_OPT
--        ${CMAKE_CURRENT_SOURCE_DIR}/gemm/*.[ch]pp
--    )
--    if(NOT UPPERCASE_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
--        set_source_files_properties(${FILES_REQUIRED_OPT}
--            PROPERTIES COMPILE_FLAGS "-O3 -funroll-loops")
--    endif()
--endif()
--
- if(NOT DNNL_ENABLE_JIT_PROFILING)
-     # XXX: the profiling interface will still be built and present
-     add_definitions_with_host_compiler(-DDNNL_ENABLE_JIT_PROFILING=0)
-@@ -138,9 +128,6 @@ endif()
- if (DNNL_TARGET_ARCH STREQUAL "AARCH64")
-     add_subdirectory(aarch64)
- endif()
--if (DNNL_TARGET_ARCH STREQUAL "PPC64")
--    add_subdirectory(ppc64)
--endif()
- if (DNNL_TARGET_ARCH STREQUAL "S390X")
-     add_subdirectory(s390x)
- endif()
-diff --git a/src/cpu/reorder/cpu_reorder_regular_f32_u8.cpp b/src/cpu/reorder/cpu_reorder_regular_f32_u8.cpp
-index 264168500a..c8ddb0d8ad 100644
---- a/src/cpu/reorder/cpu_reorder_regular_f32_u8.cpp
-+++ b/src/cpu/reorder/cpu_reorder_regular_f32_u8.cpp
-@@ -36,8 +36,6 @@ const impl_list_map_t &regular_f32_u8_impl_list_map() {
-             DNNL_AARCH64_ONLY(CPU_REORDER_INSTANCE(aarch64::jit_blk_reorder_t))
-             DNNL_AARCH64_ONLY(CPU_REORDER_INSTANCE(aarch64::jit_uni_reorder_t))
- 
--	    DNNL_PPC64_ONLY(CPU_REORDER_INSTANCE(ppc64::ppc64_matrixA_reorder_t))
--
- 	    REG_FAST_DIRECT_COPY(f32, u8)
- 
-             DNNL_NON_X64_ONLY(REG_SR_BIDIR(f32, any, u8, nChw16c))
--- 
-2.51.0
-

diff --git a/0002-Use-__INTEL_COMPILER-guard.patch b/0002-Use-__INTEL_COMPILER-guard.patch
deleted file mode 100644
index 7682c58..0000000
--- a/0002-Use-__INTEL_COMPILER-guard.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 2654b133917480ff6860c4c8b4b9df11c9c95bf5 Mon Sep 17 00:00:00 2001
-From: Nicolas Chauvet <kwizart@gmail.com>
-Date: Tue, 17 Aug 2021 09:36:19 +0200
-Subject: [PATCH 2/2] Use __INTEL_COMPILER guard
-
-This fixes compilation on non-x86 arches
-
-Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
----
- src/gpu/jit/ngen/ngen_utils.hpp | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/gpu/jit/ngen/ngen_utils.hpp b/src/gpu/jit/ngen/ngen_utils.hpp
-index 508756a080fd..2b736927db35 100644
---- a/src/gpu/jit/ngen/ngen_utils.hpp
-+++ b/src/gpu/jit/ngen/ngen_utils.hpp
-@@ -19,7 +19,9 @@
- 
- #include <cstdint>
- 
-+#ifdef __INTEL_COMPILER
- #include <immintrin.h>
-+#endif
- 
- #ifdef _MSC_VER
- #include <intrin.h>
--- 
-2.31.1
-

diff --git a/1937.patch b/1937.patch
deleted file mode 100644
index 48439c0..0000000
--- a/1937.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 33f03a52d1ccd24898131509a704e35538988fb1 Mon Sep 17 00:00:00 2001
-From: Abdelrauf <quickwritereader@gmail.com>
-Date: Thu, 30 May 2024 12:56:31 +0000
-Subject: [PATCH] qualify the function saturate with q10n:: specifier to
- prevent ambiguity
-
----
- src/cpu/s390x/gemmu16.cpp | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/src/cpu/s390x/gemmu16.cpp b/src/cpu/s390x/gemmu16.cpp
-index 632a263361c..9ed51f2673f 100644
---- a/src/cpu/s390x/gemmu16.cpp
-+++ b/src/cpu/s390x/gemmu16.cpp
-@@ -50,7 +50,7 @@ __attribute__((noinline)) void addResults(offset_type offsetType, dim_t m,
-                 for (dim_t i = 0; i < m; i++) {
-                     double val = alpha * (double)Ctemp[j * ldCtemp + i] + co[0];
-                     gPtr(i, j) = static_cast<int32_t>(
--                            nearbyint(saturate<int32_t, double>(val)));
-+                            nearbyint(q10n::saturate<int32_t, double>(val)));
-                 }
-             }
-         } else {
-@@ -59,7 +59,7 @@ __attribute__((noinline)) void addResults(offset_type offsetType, dim_t m,
-                     double val = beta * (double)gPtr(i, j)
-                             + alpha * (double)Ctemp[j * ldCtemp + i] + co[0];
-                     gPtr(i, j) = static_cast<int32_t>(
--                            nearbyint(saturate<int32_t, double>(val)));
-+                            nearbyint(q10n::saturate<int32_t, double>(val)));
-                 }
-             }
-         }
-@@ -69,7 +69,7 @@ __attribute__((noinline)) void addResults(offset_type offsetType, dim_t m,
-                 for (dim_t i = 0; i < m; i++) {
-                     double val = alpha * (double)Ctemp[j * ldCtemp + i] + co[i];
-                     gPtr(i, j) = static_cast<int32_t>(
--                            nearbyint(saturate<int32_t, double>(val)));
-+                            nearbyint(q10n::saturate<int32_t, double>(val)));
-                 }
-             }
-         } else {
-@@ -78,7 +78,7 @@ __attribute__((noinline)) void addResults(offset_type offsetType, dim_t m,
-                     double val = beta * (double)gPtr(i, j)
-                             + alpha * (double)Ctemp[j * ldCtemp + i] + co[i];
-                     gPtr(i, j) = static_cast<int32_t>(
--                            nearbyint(saturate<int32_t, double>(val)));
-+                            nearbyint(q10n::saturate<int32_t, double>(val)));
-                 }
-             }
-         }
-@@ -89,7 +89,7 @@ __attribute__((noinline)) void addResults(offset_type offsetType, dim_t m,
-                 for (dim_t i = 0; i < m; i++) {
-                     double val = alpha * (double)Ctemp[j * ldCtemp + i] + co[j];
-                     gPtr(i, j) = static_cast<int32_t>(
--                            nearbyint(saturate<int32_t, double>(val)));
-+                            nearbyint(q10n::saturate<int32_t, double>(val)));
-                 }
-             }
-         } else {
-@@ -98,7 +98,7 @@ __attribute__((noinline)) void addResults(offset_type offsetType, dim_t m,
-                     double val = beta * (double)gPtr(i, j)
-                             + alpha * (double)Ctemp[j * ldCtemp + i] + co[j];
-                     gPtr(i, j) = static_cast<int32_t>(
--                            nearbyint(saturate<int32_t, double>(val)));
-+                            nearbyint(q10n::saturate<int32_t, double>(val)));
-                 }
-             }
-         }
-@@ -107,7 +107,7 @@ __attribute__((noinline)) void addResults(offset_type offsetType, dim_t m,
-             for (dim_t j = 0; j < n; j++) {
-                 for (dim_t i = 0; i < m; i++) {
-                     gPtr(i, j) = static_cast<int32_t>(
--                            nearbyint(saturate<int32_t, double>(
-+                            nearbyint(q10n::saturate<int32_t, double>(
-                                     alpha * (double)Ctemp[j * ldCtemp + i])));
-                 }
-             }
-@@ -117,7 +117,7 @@ __attribute__((noinline)) void addResults(offset_type offsetType, dim_t m,
-                     double val = beta * (double)gPtr(i, j)
-                             + alpha * (double)Ctemp[j * ldCtemp + i];
-                     gPtr(i, j) = static_cast<int32_t>(
--                            nearbyint(saturate<int32_t, double>(val)));
-+                            nearbyint(q10n::saturate<int32_t, double>(val)));
-                 }
-             }
-         }

diff --git a/4364.patch b/4364.patch
deleted file mode 100644
index a9b1e13..0000000
--- a/4364.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 9f89e2ad78c57da650435e1cd3c7ab9c5229b828 Mon Sep 17 00:00:00 2001
-From: Arseniy Obolenskiy <gooddoog@student.su>
-Date: Fri, 21 Nov 2025 14:55:51 +0100
-Subject: [PATCH] cpu: s390x: fix ALWAYS_INLINE placement in helpers
-
----
- src/cpu/s390x/helpers.h | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/src/cpu/s390x/helpers.h b/src/cpu/s390x/helpers.h
-index 9817aad5776..5b65cf03618 100644
---- a/src/cpu/s390x/helpers.h
-+++ b/src/cpu/s390x/helpers.h
-@@ -49,34 +49,34 @@ struct vec_type_t {
- 
-     ALWAYS_INLINE vec_type_t(Type v) : _val {v} {}
- 
--    static vec_type_t<T> ALWAYS_INLINE loadu(const void *ptr) {
-+    ALWAYS_INLINE static vec_type_t<T> loadu(const void *ptr) {
-         return {vec_xl(0, reinterpret_cast<const ElementType *>(ptr))};
-     }
- 
--    static ALWAYS_INLINE vec_type_t<T> loadLen(
-+    ALWAYS_INLINE static vec_type_t<T> loadLen(
-             const void *ptr, uint32_t BYTE_INDEX) {
-         return {vec_load_len(
-                 reinterpret_cast<const ElementType *>(ptr), BYTE_INDEX)};
-     }
- 
--    static vec_type_t<T> ALWAYS_INLINE load_hinted(const void *ptr) {
-+    ALWAYS_INLINE static vec_type_t<T> load_hinted(const void *ptr) {
-         Type const *addr = (Type const *)ptr;
-         Type y;
-         y = *addr;
-         return y;
-     }
- 
--    void ALWAYS_INLINE store(void *ptr) const {
-+    ALWAYS_INLINE void store(void *ptr) const {
-         vec_xst(_val, 0, reinterpret_cast<ElementType *>(ptr));
-     }
- 
--    void ALWAYS_INLINE storeLen(void *ptr, uint32_t BYTE_INDEX) const {
-+    ALWAYS_INLINE void storeLen(void *ptr, uint32_t BYTE_INDEX) const {
-         vec_store_len(_val, reinterpret_cast<ElementType *>(ptr), BYTE_INDEX);
-     }
- 
-     ALWAYS_INLINE const Type &vec() const { return _val; }
- 
--    vec_type_t<T> &ALWAYS_INLINE operator+=(const vec_type_t<T> &other) {
-+    ALWAYS_INLINE vec_type_t<T> &operator+=(const vec_type_t<T> &other) {
-         _val = _val + other._val;
-         return *this;
-     }

diff --git a/aarch64-gcc13.patch b/aarch64-gcc13.patch
deleted file mode 100644
index 43fb9fb..0000000
--- a/aarch64-gcc13.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/cpu/aarch64/xbyak_aarch64/xbyak_aarch64/xbyak_aarch64.h	2023-01-30 17:07:43.480192587 +0200
-+++ b/src/cpu/aarch64/xbyak_aarch64/xbyak_aarch64/xbyak_aarch64.h	2023-01-30 18:00:20.557232004 +0200
-@@ -53,6 +53,7 @@
- 
- #include <iomanip>
- #include <sstream>
-+#include <cstdint>
- 
- #ifndef NDEBUG
- #include <iostream>

diff --git a/onednn.spec b/onednn.spec
index 7c6b086..d8dd505 100644
--- a/onednn.spec
+++ b/onednn.spec
@@ -1,3 +1,15 @@
+%ifarch x86_64
+%global toolchain clang
+%global _lto_cflags %{nil}
+%if 0%{?fedora} >= 45
+%global omp_devel libomp22-devel
+%global omp_libdir %{_libdir}/llvm22/lib64
+%else
+%global omp_devel libomp-devel
+%global omp_libdir %{_libdir}
+%endif
+%endif
+
 Name:           onednn
 Version:        3.13.4
 Release:        %autorelease
@@ -17,9 +29,16 @@ BuildRequires:  doxygen
 BuildRequires:  gcc-c++
 BuildRequires:  chrpath
 
-# Optionals not yet enabled
+%ifarch x86_64
+BuildRequires:  intel-dpcpp
+BuildRequires:  intel-dpcpp-devel
+BuildRequires:  %{omp_devel}
+BuildRequires:  oneapi-level-zero-devel
+BuildRequires:  intel-level-zero-devel
+BuildRequires:  intel-metrics-discovery-devel
+%else
 BuildRequires:  pkgconfig(OpenCL)
-#BuildRequires:  pkgconfig(tbb)
+%endif
 
 # Virtual provides mkldnn
 Provides: mkldnn = %{version}-%{release}
@@ -27,6 +46,9 @@ Provides: mkl-dnn = %{version}-%{release}
 Obsoletes: mkl-dnn < 1.3
 # Provides oneDNN
 Provides: oneDNN = %{version}-%{release}
+%ifarch x86_64
+Requires:       intel-dpcpp-runtime
+%endif
 
 
 %description
@@ -43,6 +65,11 @@ interested in improving application performance on Intel CPUs and GPUs.
 %package        devel
 Summary:        Development files for %{name}
 Requires:       %{name}%{?_isa} = %{version}-%{release}
+%ifarch x86_64
+Requires:       intel-dpcpp-devel
+Requires:       oneapi-level-zero-devel
+Requires:       opencl-headers
+%endif
 
 %description    devel
 The %{name}-devel package contains libraries and header files for
@@ -71,13 +98,25 @@ functionality on target hardware.
 
 
 %build
+%ifarch x86_64
+export CFLAGS="$CFLAGS -idirafter %{_prefix}/lib/clang/22/include"
+export CXXFLAGS="$CXXFLAGS -idirafter %{_prefix}/lib/clang/22/include"
+export LDFLAGS="$LDFLAGS -L%{omp_libdir}"
+%endif
 %cmake \
   -DDNNL_ARCH_OPT_FLAGS="" \
   -DDNNL_BUILD_EXAMPLES=OFF \
   -DDNNL_BUILD_TESTS=ON \
-  -DCMAKE_C_STD=11 \
-  -DCMAKE_CPP_STD=17 \
+%ifarch x86_64
+  -DCMAKE_C_COMPILER=%{_bindir}/dpclang \
+  -DCMAKE_CXX_COMPILER=%{_bindir}/dpclang++ \
+  -DONEDNN_CPU_RUNTIME=OMP \
+  -DONEDNN_GPU_RUNTIME=SYCL \
+  -DONEDNN_OCL_INCLUDE_DIR=%{_includedir} \
+  -DONEDNN_ZE_INCLUDE_DIR=%{_includedir}
+%else
   -DONEDNN_GPU_RUNTIME=OCL
+%endif
 
 %cmake_build
 
@@ -106,7 +145,8 @@ chmod 0755 %{buildroot}%{_bindir}/benchdnn
 install -d %{buildroot}%{_libexecdir}/onednn/gtests
 find %{_vpath_builddir}/tests/gtests -maxdepth 1 -type f -executable -name 'test_*' \
     -exec install -pm0755 {} %{buildroot}%{_libexecdir}/onednn/gtests/ \;
-install -pm0755 %{_vpath_builddir}/tests/api-c %{buildroot}%{_libexecdir}/onednn/gtests/
+[ -f %{_vpath_builddir}/tests/api-c ] && \
+  install -pm0755 %{_vpath_builddir}/tests/api-c %{buildroot}%{_libexecdir}/onednn/gtests/ || true
 [ -f %{_vpath_builddir}/tests/test_c_symbols-c ] && \
   install -pm0755 %{_vpath_builddir}/tests/test_c_symbols-c %{buildroot}%{_libexecdir}/onednn/gtests/ || true
 
@@ -121,10 +161,14 @@ chmod 0755 %{buildroot}%{_bindir}/onednn-test
 
 
 # Some ocl/gpu tests will fails if lacking an appropriate implementation
-%{?_with_tests:
 %check
+%ifarch x86_64
+%ctest -E "benchdnn|gpu|test_api_sycl"
+%else
+%{?_with_tests:
 %ctest
 }
+%endif
 
 
 %files

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-24 22:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 22:56 [rpms/onednn] f45: Add XPU support to existing pkgs Pavel Androniychuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox