%global upstreamname rpp %global rocm_release 6.0 %global rocm_patch 2 %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" %global llvm_maj_ver 17 %bcond_without compat_build %bcond_with check %global gpu gfx1102 %if %{with check} %global __cmake_in_source_build 1 %endif 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: half-devel BuildRequires: ninja-build BuildRequires: opencv-devel BuildRequires: rocm-cmake BuildRequires: rocm-comgr-devel BuildRequires: rocm-hip-devel BuildRequires: rocm-runtime-devel BuildRequires: rocm-rpm-macros %if %{with compat_build} BuildRequires: lld%{llvm_maj_ver} BuildRequires: libomp%{llvm_maj_ver}-devel %else BuildRequires: lld BuildRequires: libomp-devel %endif # 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 # remove clang++ sed -i -e '/set(CMAKE_CXX_COMPILER clang++)/d' CMakeLists.txt # soften openmp requirement sed -i -e 's/OpenMP REQUIRED/OpenMP/' CMakeLists.txt # #include -> for f in `find . -type f -name '*.hpp' -o -name '*.cpp' `; do sed -i -e 's@#include @#include @' $f done # Remove guardrails on in source builds sed -i -e '/In-source builds are not allowed/d' CMakeLists.txt %build export HIP_PATH=`hipconfig -p` export ROCM_PATH=`hipconfig -R` export HIP_CLANG_PATH=`hipconfig -l` RESOURCE_DIR=`${HIP_CLANG_PATH}/clang -print-resource-dir` export DEVICE_LIB_PATH=${RESOURCE_DIR}/amdgcn/bitcode %cmake -G Ninja \ -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \ -DROCM_SYMLINK_LIBS=OFF \ -DHIP_PLATFORM=amd \ -DBACKEND=HIP \ %if %{with check} -DAMDGPU_TARGETS=%{gpu} \ %else -DAMDGPU_TARGETS=%{all_rocm_gpus} \ %endif -DCMAKE_BUILD_TYPE=RelWithDebugInfo \ -DROCM_PATH=%{_prefix} \ -DHIP_PATH=%{_prefix} \ -DCMAKE_INSTALL_LIBDIR=%{_libdir} %cmake_build %if %{with check} %check export HIP_PATH=`hipconfig -p` export ROCM_PATH=`hipconfig -R` export HIP_CLANG_PATH=`hipconfig -l` RESOURCE_DIR=`${HIP_CLANG_PATH}/clang -print-resource-dir` export DEVICE_LIB_PATH=${RESOURCE_DIR}/amdgcn/bitcode cd utilities/rpp-unittests/HIP_NEW ./testAllScript.sh %endif %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