%global upstreamname rpp %global rocm_release 6.0 %global rocm_patch 0 %global rocm_version %{rocm_release}.%{rocm_patch} %global toolchain rocm # hipcc does not support some clang flags %global build_cxxflags %(echo %{optflags} | sed -e 's/-fstack-protector-strong/-Xarch_host -fstack-protector-strong/' -e 's/-fcf-protection/-Xarch_host -fcf-protection/') # gfx941 - has in internal build error even when BUILD_WITH_AMD_ADVANCE=ON, remove from the list # The default list in the project does not cover our expected targets %global all_rocm_gpus "gfx803;gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx942;gfx1010;gfx1012;gfx1030;gfx1100;gfx1101;gfx1102" Name: rocm-rpp Version: %{rocm_version} Release: %autorelease Summary: ROCm Performace Primatives for computer vision Url: https://github.com/ROCm/%{upstreamname} License: MIT AND Apache-2.0 AND LicenseRef-Fedora-Public-Domain # The main license is MIT # A couple of files have Apache-2.0 # src/include/common/rpp/kernel_cache.hpp # src/modules/kernel_cache.cpp # A Public Domain # src/modules/md5.cpp Source0: %{url}/archive/rocm-%{rocm_version}.tar.gz#/%{upstreamname}-%{rocm_version}.tar.gz BuildRequires: cmake BuildRequires: clang BuildRequires: clang-devel BuildRequires: compiler-rt BuildRequires: half-devel BuildRequires: lld BuildRequires: llvm-devel BuildRequires: ninja-build BuildRequires: libomp-devel BuildRequires: opencv-devel BuildRequires: rocm-cmake BuildRequires: rocm-comgr-devel BuildRequires: rocm-hip-devel BuildRequires: rocm-runtime-devel BuildRequires: rocm-rpm-macros # Only x86_64 works right now: ExclusiveArch: x86_64 %description AMD ROCm Performance Primitives (RPP) library is a comprehensive, high-performance computer vision library for AMD processors that have HIP, OpenCL, or CPU backends. %package devel Summary: Libraries and headers for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary} %prep %autosetup -p1 -n %{upstreamname}-rocm-%{version} # hip compiler sed -i -e 's@set(COMPILER_FOR_HIP ${ROCM_PATH}/llvm/bin/clang++)@set(COMPILER_FOR_HIP hipcc)@' CMakeLists.txt # #include -> for f in `find . -type f -name '*.hpp' -o -name '*.cpp' `; do sed -i -e 's@#include @#include @' $f done %build %cmake -G Ninja \ -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \ -DROCM_SYMLINK_LIBS=OFF \ -DHIP_PLATFORM=amd \ -DAMDGPU_TARGETS=%{all_rocm_gpus} \ -DCMAKE_BUILD_TYPE=RelWithDebugInfo \ -DROCM_PATH=%{_prefix} \ -DHIP_PATH=%{_prefix} \ -DCMAKE_INSTALL_LIBDIR=%{_libdir} %cmake_build %install %cmake_install %files %license LICENSE %exclude %{_docdir}/rpp/LICENSE %exclude %{_docdir}/rpp-asan/LICENSE %{_libdir}/librpp.so.* %files devel %doc README.md %{_includedir}/rpp/ %{_libdir}/librpp.so %changelog %autochangelog