|
|
|
@ -45,5 +45,15 @@ class cuda_test(NewOpenCVTests): |
|
|
|
|
asyncstream = cv.cuda_Stream(1) # cudaStreamNonBlocking |
|
|
|
|
self.assertTrue(asyncstream.cudaPtr() != 0) |
|
|
|
|
|
|
|
|
|
def test_cuda_buffer_pool(self): |
|
|
|
|
cv.cuda.setBufferPoolUsage(True) |
|
|
|
|
cv.cuda.setBufferPoolConfig(cv.cuda.getDevice(), 1024 * 1024 * 64, 2) |
|
|
|
|
stream_a = cv.cuda.Stream() |
|
|
|
|
pool_a = cv.cuda.BufferPool(stream_a) |
|
|
|
|
cuMat = pool_a.getBuffer(1024, 1024, cv.CV_8UC3) |
|
|
|
|
cv.cuda.setBufferPoolUsage(False) |
|
|
|
|
self.assertEqual(cuMat.size(), (1024, 1024)) |
|
|
|
|
self.assertEqual(cuMat.type(), cv.CV_8UC3) |
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
|
NewOpenCVTests.bootstrap() |
|
|
|
|