public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Pavel Androniychuk <pavel.androniychuk@intel.com>
To: git-commits@fedoraproject.org
Subject: [rpms/onednn] xpu-support-single-build: Add XPU support to existing pkgs
Date: Mon, 19 Oct 2026 21:41:13 GMT	[thread overview]
Message-ID: <179244607309.1.4580575035833697193.rpms-onednn-ba6dc7b561f1@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/onednn
Branch : xpu-support-single-build
Commit : ba6dc7b561f14f764eeae692ff2f29dab67a99f4
Author : Pavel Androniychuk <pavel.androniychuk@intel.com>
Date   : 2026-10-19T21:47:59+00:00
Stats  : +56/-1 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/onednn/c/ba6dc7b561f14f764eeae692ff2f29dab67a99f4?branch=xpu-support-single-build

Log:
Add XPU support to existing pkgs

---
diff --git a/onednn.spec b/onednn.spec
index 7c6b086..01f87ae 100644
--- a/onednn.spec
+++ b/onednn.spec
@@ -1,3 +1,21 @@
+%if 0%{?fedora} >= 44
+%ifarch x86_64
+%global with_sycl 1
+%global toolchain clang
+%global __cc %{_bindir}/dpclang
+%global __cxx %{_bindir}/dpclang++
+%global __cpp %{_bindir}/dpclang -E
+%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
+%endif
+
 Name:           onednn
 Version:        3.13.4
 Release:        %autorelease
@@ -20,6 +38,14 @@ BuildRequires:  chrpath
 # Optionals not yet enabled
 BuildRequires:  pkgconfig(OpenCL)
 #BuildRequires:  pkgconfig(tbb)
+%if 0%{?with_sycl}
+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
+%endif
 
 # Virtual provides mkldnn
 Provides: mkldnn = %{version}-%{release}
@@ -27,6 +53,9 @@ Provides: mkl-dnn = %{version}-%{release}
 Obsoletes: mkl-dnn < 1.3
 # Provides oneDNN
 Provides: oneDNN = %{version}-%{release}
+%if 0%{?with_sycl}
+Requires:       intel-dpcpp-runtime%{?_isa}
+%endif
 
 
 %description
@@ -43,6 +72,11 @@ interested in improving application performance on Intel CPUs and GPUs.
 %package        devel
 Summary:        Development files for %{name}
 Requires:       %{name}%{?_isa} = %{version}-%{release}
+%if 0%{?with_sycl}
+Requires:       intel-dpcpp-devel%{?_isa}
+Requires:       oneapi-level-zero-devel
+Requires:       opencl-headers
+%endif
 
 %description    devel
 The %{name}-devel package contains libraries and header files for
@@ -69,15 +103,35 @@ functionality on target hardware.
 %prep
 %autosetup -p1 -n oneDNN-%{version}
 
+%if 0%{?with_sycl}
+mkdir omp-inc
+ln -s %{_prefix}/lib/clang/22/include/omp.h omp-inc/omp.h
+%endif
+
 
 %build
+%if 0%{?with_sycl}
+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 \
+%if 0%{?with_sycl}
+  -DONEDNN_CPU_RUNTIME=OMP \
+  -DOpenMP_C_FLAGS="-fopenmp -I$PWD/omp-inc" \
+  -DOpenMP_CXX_FLAGS="-fopenmp -I$PWD/omp-inc" \
+  -DOpenMP_C_LIB_NAMES=omp \
+  -DOpenMP_CXX_LIB_NAMES=omp \
+  -DOpenMP_omp_LIBRARY=%{omp_libdir}/libomp.so \
+  -DONEDNN_GPU_RUNTIME=SYCL \
+  -DONEDNN_OCL_INCLUDE_DIR=%{_includedir} \
+  -DONEDNN_ZE_INCLUDE_DIR=%{_includedir}
+%else
   -DONEDNN_GPU_RUNTIME=OCL
+%endif
 
 %cmake_build
 
@@ -106,7 +160,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
 

                 reply	other threads:[~2026-10-19 21:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179244607309.1.4580575035833697193.rpms-onednn-ba6dc7b561f1@fedoraproject.org \
    --to=pavel.androniychuk@intel.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox