You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/core/include/opencv2/core/cuda.hpp
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -567,6 +567,29 @@ The function does not reallocate memory if the matrix has proper attributes alre
567
567
*/
568
568
CV_EXPORTS_W voidensureSizeIsEnough(int rows, int cols, int type, OutputArray arr);
569
569
570
+
/** @brief Python overload to create a GpuMat from existing GPU memory
571
+
572
+
@param rows Row count.
573
+
@param cols Column count.
574
+
@param type Type of the matrix.
575
+
@param cudaMemoryAddress Address of the allocated GPU memory on the device. This does not allocate matrix data. Instead, it just initializes the matrix header that points to the specified cudaMemoryAddress, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it.
576
+
@param step Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See GpuMat::elemSize.
577
+
*/
578
+
CV_EXPORTS_W GpuMat inlinecreateGpuMat(int rows, int cols, int type, uint64 cudaMemoryAddress, size_t step = Mat::AUTO_STEP) {
@param size 2D array size: Size(cols, rows). In the Size() constructor, the number of rows and the number of columns go in the reverse order.
585
+
@param type Type of the matrix.
586
+
@param cudaMemoryAddress Address of the allocated GPU memory on the device. This does not allocate matrix data. Instead, it just initializes the matrix header that points to the specified cudaMemoryAddress, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it.
587
+
@param step Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See GpuMat::elemSize.
BufferPool utilizes Stream's allocator to create new buffers for GpuMat's. It is
@@ -921,6 +944,13 @@ class CV_EXPORTS_W Stream
921
944
friendclassDefaultDeviceInitializer;
922
945
};
923
946
947
+
948
+
/** @brief Python overload to create a Stream object from the address stored in an existing CUDA Runtime API stream pointer (cudaStream_t)
949
+
950
+
@param cudaStreamMemoryAddress Memory address stored in a CUDA Runtime API stream pointer (cudaStream_t). The created Stream object does not perform and allocation or deallocation and simply wraps existing raw CUDA Runtime API stream pointer.
0 commit comments