tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Adding CUDA support to graphics/opencv
I'd like to add CUDA support to opencv. This tested fine on Linux. In theory,
FreeBSD would support this too. Any objections?
patches/patch-modules_cudalegacy_src_graphcuts.cpp:
# BOF
$NetBSD$
--- modules/cudalegacy/src/graphcuts.cpp.orig 2015-12-18 15:02:16.000000000 +0000
+++ modules/cudalegacy/src/graphcuts.cpp
@@ -42,7 +42,7 @@
#include "precomp.hpp"
-#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
+#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000)
void cv::cuda::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); }
void cv::cuda::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); }
# EOF
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/opencv/PLIST,v
retrieving revision 1.16
diff -r1.16 PLIST
93a94,186
> ${PLIST.cuda}include/opencv2/cudaarithm.hpp
> ${PLIST.cuda}include/opencv2/cudabgsegm.hpp
> ${PLIST.cuda}include/opencv2/cudacodec.hpp
> ${PLIST.cuda}include/opencv2/cudafeatures2d.hpp
> ${PLIST.cuda}include/opencv2/cudafilters.hpp
> ${PLIST.cuda}include/opencv2/cudaimgproc.hpp
> ${PLIST.cuda}include/opencv2/cudalegacy.hpp
> ${PLIST.cuda}include/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp
> ${PLIST.cuda}include/opencv2/cudalegacy/NCVHaarObjectDetection.hpp
> ${PLIST.cuda}include/opencv2/cudalegacy/NCV.hpp
> ${PLIST.cuda}include/opencv2/cudalegacy/NCVPyramid.hpp
> ${PLIST.cuda}include/opencv2/cudalegacy/NPP_staging.hpp
> ${PLIST.cuda}include/opencv2/cudalegacy/private.hpp
> ${PLIST.cuda}include/opencv2/cudaobjdetect.hpp
> ${PLIST.cuda}include/opencv2/cudaoptflow.hpp
> ${PLIST.cuda}include/opencv2/cudastereo.hpp
> ${PLIST.cuda}include/opencv2/cudawarping.hpp
> ${PLIST.cuda}include/opencv2/cudev/block/block.hpp
> ${PLIST.cuda}include/opencv2/cudev/block/detail/reduce.hpp
> ${PLIST.cuda}include/opencv2/cudev/block/detail/reduce_key_val.hpp
> ${PLIST.cuda}include/opencv2/cudev/block/dynamic_smem.hpp
> ${PLIST.cuda}include/opencv2/cudev/block/reduce.hpp
> ${PLIST.cuda}include/opencv2/cudev/block/scan.hpp
> ${PLIST.cuda}include/opencv2/cudev/block/vec_distance.hpp
> ${PLIST.cuda}include/opencv2/cudev/common.hpp
> ${PLIST.cuda}include/opencv2/cudev/expr/binary_func.hpp
> ${PLIST.cuda}include/opencv2/cudev/expr/binary_op.hpp
> ${PLIST.cuda}include/opencv2/cudev/expr/color.hpp
> ${PLIST.cuda}include/opencv2/cudev/expr/deriv.hpp
> ${PLIST.cuda}include/opencv2/cudev/expr/expr.hpp
> ${PLIST.cuda}include/opencv2/cudev/expr/per_element_func.hpp
> ${PLIST.cuda}include/opencv2/cudev/expr/reduction.hpp
> ${PLIST.cuda}include/opencv2/cudev/expr/unary_func.hpp
> ${PLIST.cuda}include/opencv2/cudev/expr/unary_op.hpp
> ${PLIST.cuda}include/opencv2/cudev/expr/warping.hpp
> ${PLIST.cuda}include/opencv2/cudev/functional/color_cvt.hpp
> ${PLIST.cuda}include/opencv2/cudev/functional/detail/color_cvt.hpp
> ${PLIST.cuda}include/opencv2/cudev/functional/functional.hpp
> ${PLIST.cuda}include/opencv2/cudev/functional/tuple_adapter.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/copy.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/copy.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/histogram.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/integral.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/minmaxloc.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/pyr_down.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/pyr_up.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/reduce.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/reduce_to_column.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/reduce_to_row.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/split_merge.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/transform.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/detail/transpose.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/histogram.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/integral.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/pyramids.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/reduce.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/reduce_to_vec.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/split_merge.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/transform.hpp
> ${PLIST.cuda}include/opencv2/cudev/grid/transpose.hpp
> ${PLIST.cuda}include/opencv2/cudev.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/constant.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/deriv.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/detail/gpumat.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/extrapolation.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/glob.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/gpumat.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/interpolation.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/lut.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/mask.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/remap.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/resize.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/texture.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/traits.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/transform.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/warping.hpp
> ${PLIST.cuda}include/opencv2/cudev/ptr2d/zip.hpp
> ${PLIST.cuda}include/opencv2/cudev/util/atomic.hpp
> ${PLIST.cuda}include/opencv2/cudev/util/detail/tuple.hpp
> ${PLIST.cuda}include/opencv2/cudev/util/detail/type_traits.hpp
> ${PLIST.cuda}include/opencv2/cudev/util/limits.hpp
> ${PLIST.cuda}include/opencv2/cudev/util/saturate_cast.hpp
> ${PLIST.cuda}include/opencv2/cudev/util/simd_functions.hpp
> ${PLIST.cuda}include/opencv2/cudev/util/tuple.hpp
> ${PLIST.cuda}include/opencv2/cudev/util/type_traits.hpp
> ${PLIST.cuda}include/opencv2/cudev/util/vec_math.hpp
> ${PLIST.cuda}include/opencv2/cudev/util/vec_traits.hpp
> ${PLIST.cuda}include/opencv2/cudev/warp/detail/reduce.hpp
> ${PLIST.cuda}include/opencv2/cudev/warp/detail/reduce_key_val.hpp
> ${PLIST.cuda}include/opencv2/cudev/warp/reduce.hpp
> ${PLIST.cuda}include/opencv2/cudev/warp/scan.hpp
> ${PLIST.cuda}include/opencv2/cudev/warp/shuffle.hpp
> ${PLIST.cuda}include/opencv2/cudev/warp/warp.hpp
209a303,338
> ${PLIST.cuda}lib/libopencv_cudaarithm.so
> ${PLIST.cuda}lib/libopencv_cudaarithm.so.3.1
> ${PLIST.cuda}lib/libopencv_cudaarithm.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudabgsegm.so
> ${PLIST.cuda}lib/libopencv_cudabgsegm.so.3.1
> ${PLIST.cuda}lib/libopencv_cudabgsegm.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudacodec.so
> ${PLIST.cuda}lib/libopencv_cudacodec.so.3.1
> ${PLIST.cuda}lib/libopencv_cudacodec.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudafeatures2d.so
> ${PLIST.cuda}lib/libopencv_cudafeatures2d.so.3.1
> ${PLIST.cuda}lib/libopencv_cudafeatures2d.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudafilters.so
> ${PLIST.cuda}lib/libopencv_cudafilters.so.3.1
> ${PLIST.cuda}lib/libopencv_cudafilters.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudaimgproc.so
> ${PLIST.cuda}lib/libopencv_cudaimgproc.so.3.1
> ${PLIST.cuda}lib/libopencv_cudaimgproc.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudalegacy.so
> ${PLIST.cuda}lib/libopencv_cudalegacy.so.3.1
> ${PLIST.cuda}lib/libopencv_cudalegacy.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudaobjdetect.so
> ${PLIST.cuda}lib/libopencv_cudaobjdetect.so.3.1
> ${PLIST.cuda}lib/libopencv_cudaobjdetect.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudaoptflow.so
> ${PLIST.cuda}lib/libopencv_cudaoptflow.so.3.1
> ${PLIST.cuda}lib/libopencv_cudaoptflow.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudastereo.so
> ${PLIST.cuda}lib/libopencv_cudastereo.so.3.1
> ${PLIST.cuda}lib/libopencv_cudastereo.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudawarping.so
> ${PLIST.cuda}lib/libopencv_cudawarping.so.3.1
> ${PLIST.cuda}lib/libopencv_cudawarping.so.${PKGVERSION}
> ${PLIST.cuda}lib/libopencv_cudev.so
> ${PLIST.cuda}lib/libopencv_cudev.so.3.1
> ${PLIST.cuda}lib/libopencv_cudev.so.${PKGVERSION}
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/opencv/distinfo,v
retrieving revision 1.35
diff -r1.35 distinfo
16a17
> SHA1 (patch-modules_cudalegacy_src_graphcuts.cpp) = 8027d82d87b9162c586ed6d5a372fd5ff1023b6f
Index: options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/opencv/options.mk,v
retrieving revision 1.6
diff -r1.6 options.mk
4c4,5
< PKG_SUPPORTED_OPTIONS= ffmpeg
---
> PKG_SUPPORTED_OPTIONS= cuda ffmpeg
> PLIST_VARS+= cuda
7a9,16
> .if !empty(PKG_OPTIONS:Mcuda)
> CUDA_LOCALBASE?= /usr/local
> BUILDLINK_PASSTHRU_DIRS+= ${CUDA_LOCALBASE}
> BUILDLINK_PASSTHRU_RPATHDIRS+= ${CUDA_LOCALBASE}
> LDFLAGS+= ${COMPILER_RPATH_FLAG}${CUDA_LOCALBASE}/cuda/lib64
> PLIST.cuda= yes
> .endif
>
Home |
Main Index |
Thread Index |
Old Index