| 27 | |
| 28 | namespace { |
| 29 | Tensor MinAreaRectInto(Tensor &output, Tensor &input, Tensor &numPointsInContour, const int totalContours, |
| 30 | std::optional<Stream> pstream) |
| 31 | { |
| 32 | if (!pstream) |
| 33 | { |
| 34 | pstream = Stream::Current(); |
| 35 | } |
| 36 | |
| 37 | auto minAreaRect = CreateOperator<cvcuda::MinAreaRect>(totalContours); |
| 38 | |
| 39 | ResourceGuard guard(*pstream); |
| 40 | guard.add(LockMode::LOCK_MODE_READ, {input, numPointsInContour}); |
| 41 | guard.add(LockMode::LOCK_MODE_WRITE, {output}); |
| 42 | guard.add(LockMode::LOCK_MODE_READWRITE, {*minAreaRect}); |
| 43 | |
| 44 | minAreaRect->submit(pstream->cudaHandle(), input, output, numPointsInContour, totalContours); |
| 45 | |
| 46 | return std::move(output); |
| 47 | } |
| 48 | |
| 49 | Tensor MinAreaRect(Tensor &input, Tensor &numPointsInContour, const int totalContours, std::optional<Stream> pstream) |
| 50 | { |
no test coverage detected