public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/onednn] xpu-support-single-build: Add XPU support to existing pkgs
@ 2026-10-19 21:41 Pavel Androniychuk
0 siblings, 0 replies; only message in thread
From: Pavel Androniychuk @ 2026-10-19 21:41 UTC (permalink / raw)
To: git-commits
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-19 21:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-19 21:41 [rpms/onednn] xpu-support-single-build: 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