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