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