OpenCV中GPU模块 CUDA 函数

本文介绍了OpenCV中的GPU模块,利用NVIDIA CUDA Runtime API实现GPU计算功能。包括设备管理、特性集、设备信息类等,并详细列举了如getCudaEnabledDeviceCount、setDevice、GpuMat等关键函数,涉及图像处理、矩阵运算、流处理等多个方面。
摘要由CSDN通过智能技术生成

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

The OpenCV GPU module is a set of classes and functions to utilize GPU computational capabilities. It is implemented using NVIDIA* CUDA* Runtime API and supports only NVIDIA GPUs.

 

1.      getCudaEnableDeviceCount:returns the number of installed CUDA-enabled devices;

2.      setDevice:sets adevice and initializes it for the current thread;

3.      getDevice:returns the current device index set or initialized by default;

4.      resetDevice:explicitly destroys and cleans up all resources associated with the current device in the current process;

5.      FeatureSet:enumeration providing GPU computing features;

6.      class::TargetArchs:class providing a set of static methods to check what NVIDIA card architecture the GPU module was built for;

7.      class::DeviceInfo:class providing functionality for querying the specified GPU properties;

8.      DeviceInfo::name:returns the device name;

9.      DeviceInfo::majorVersion:returns the major compute capability version;

10.  DeviceInfo::minorVersion:returns the minor compute capability version;

11.  DeviceInfo::multiProcessorCount:returns the number of streaming multiprocessors;

12.  DeviceInfo::freeMemory:returns the amount of free memory in bytes;

13.  DeviceInfo::totalMemory:returns the amount of total memory in bytes;

14.  DeviceInfo::supports:provides information on GPU feature support;

15.  DeviceInfo::isCompatible:checks the GPU module and device compatibility;

16.  DeviceInfo::deviceID:returns system index of the GPU device starting with 0;

17.  struct::PtrStepSz:lightweight class encapsulating pitched memory on a GPU and passed to nvcc-compiled code(CUDA kernels);

18.  struct::PtrStep:structure similar to gpu::PtrStepSz but containing only a pointer and row step;

19.  class::GpuMat:base storage class for GPU memory with reference counting. Its interface matches the Mat interface;

20.  createContinuous:creates a continuous matrix in the GPU memory;

21.  ensureSizeIsEnough:ensures that the size of a matrix is big enough and the matrix has a proper type;

22.  registerPageLocked:page-locks the memory of matrix and maps it for the device(s);

23.  unregisterPageLocked:unmaps the memory of matrix and makes it pageable again;

24.  class::CudaMem:class with reference counting wrapping special memory type allocation functions from CUDA. Its interface is also Mat()-like but with additional memory type parameters;

25.  CudaMem::createMatHeader:creates a header without reference counting to gpu::CudaMem data;

26.  CudaMem::createGpuMatHeader:maps CPU memory to GPU address space and create the gpu::GpuMat header without reference counting for it;

27.  CudaMem::canMapHostMemory:returns true if the current  hardware supports address space mapping and ALLOC_ZEROCOPY memory allocation;

28.  class::Stream:this class encapsulates a queue of asynchronous calls. Some functions have overloads with the additional gpu::Stream parameter;

29.  Stream::queryIfComplete:returns true if the current stream queue is finished, otherwise, it returns false;

30.  Stream::waitForCompletion:blocks the current CPU thread until all operations in the stream are complete;

31.  Stream::enqueueDownload:copies data from device to host;

32.  Stream::enqueueUpload:copies data from host to device;

33.  Stream::enqueueCopy:copies data from device to device;

34.  Stream::enqueueMemSet:initializes or sets device memory to a value;

35.  Stream::enqueueConvert:converts matrix type, ex from float to uchar depending on type;

36.  Stream::enqueueHostCallback:adds a callback to be called on the host after all currently enqueued items in the stream have completed;

37.  struct::StreamAccessor:class that enables getting cuda Stream_t from gpu::Stream and is declared in stream_accessor.hpp because it is the only public header that depends on the CUDA Runtime API;

38.  gemm(cv::gemm):performs generalized matrix multiplication;

39.  transpose(cv::transpose):transpose a matrix;

40.  flip(cv::flip):flips a 2D matrix around vertical, horizontal, or both axes;

41.  LUT(cv::LUT):transforms the source matrix into the destination matrix using the given look-up table:dst(I) = lut(src(I));

42.  merge(cv::merge):makes a multi-channel matrix out of several single-channel matrices;

43.  split(cv::split):copies each plane of a multi-channel matrix into an array;

44.  magnitude(cv::magnitude):computes magnitudes of complex matrix elements;

45.  magnitudeSqr:computes squared magnitudes of complex matrix elements;

46.  phase(cv::phase):computes polar angles of complex matrix elements;

47.  cartToPolar(cv::cartToPolar):converts Cartesian coordinates into polar;

48.  polarToCart(cv::polarToCart):converts polar coordinates into Cartesian;

49.  normalize(cv::normalize):normalizes the norm or value range of an array;

50.  add(cv::add):computes a matrix-matrix or matrix-scalar sum;

51.  subtract(cv::subtract):computes a matrix-matrix or matrix-scalar difference;

52.  multiply(cv::multiply):computes a matrix-matrix or matrix-scalar per-element product;

53.  divide(cv::divide):computes a matrix-matrix or matrix-scalar division;

54.  addWeighted(cv::addWeighted):computes the weighted sum of two arrays;

55.  abs(cv::abs):computes an absolute value of each matrix element;

56.  sqr:computes a square value of each matrix element;

57.  sqrt(cv::sqrt):computes a square root of each matrix element;

58.  exp(cv::exp):computes an exponent of each matrix element;

59.  log(cv::log):computes a natural logarithm of absolute value of each matrix element;

60.  pow(cv::pow):raises every matrix elem

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值