From 8b199e9c3348e66d1aa273385d80b7127f91d0de Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Fri, 12 Mar 2021 17:23:45 +0100 Subject: [PATCH] Add cuda_dnn option --- opencv.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opencv.spec b/opencv.spec index 259efe1..21c7bef 100644 --- a/opencv.spec +++ b/opencv.spec @@ -45,6 +45,7 @@ %global _cuda_version 11.2 %global _cuda_rpm_version 11-2 %global _cuda_prefix /usr/local/cuda-%{_cuda_version} +%bcond_without dnn_cuda %endif Name: opencv @@ -81,6 +82,7 @@ BuildRequires: cuda-minimal-build-%{?_cuda_rpm_version} BuildRequires: pkgconfig(cublas-%{?_cuda_version}) BuildRequires: pkgconfig(cufft-%{?_cuda_version}) BuildRequires: pkgconfig(nppc-%{?_cuda_version}) +%{?with_dnn_cuda:BuildRequires: libcudnn8-devel} } %{?with_eigen2:BuildRequires: eigen2-devel} %{?with_eigen3:BuildRequires: eigen3-devel} @@ -301,6 +303,7 @@ install -pm 0644 %{SOURCE4} .cache/ade/ -DCUDA_VERBOSE_BUILD=ON \ -DCUDA_PROPAGATE_HOST_FLAGS=OFF \ -DCUDA_NVCC_FLAGS="-Xcompiler -fPIC" \ + %{?with_dnn_cuda:-DOPENCV_DNN_CUDA=ON} \ } \ %{?with_openni: -DWITH_OPENNI=ON } \ %{!?with_xine: -DWITH_XINE=OFF } \