| 32 | |
| 33 | namespace { |
| 34 | Tensor RotateInto(Tensor &output, Tensor &input, double angleDeg, const std::tuple<double, double> &shift, |
| 35 | NVCVInterpolationType interpolation, std::optional<Stream> pstream) |
| 36 | { |
| 37 | if (!pstream) |
| 38 | { |
| 39 | pstream = Stream::Current(); |
| 40 | } |
| 41 | |
| 42 | auto rotate = CreateOperator<cvcuda::Rotate>(0); |
| 43 | |
| 44 | ResourceGuard guard(*pstream); |
| 45 | guard.add(LockMode::LOCK_MODE_READ, {input}); |
| 46 | guard.add(LockMode::LOCK_MODE_WRITE, {output}); |
| 47 | guard.add(LockMode::LOCK_MODE_READWRITE, {*rotate}); |
| 48 | |
| 49 | double2 shiftArg{std::get<0>(shift), std::get<1>(shift)}; |
| 50 | |
| 51 | rotate->submit(pstream->cudaHandle(), input, output, angleDeg, shiftArg, interpolation); |
| 52 | |
| 53 | return output; |
| 54 | } |
| 55 | |
| 56 | Tensor Rotate(Tensor &input, double angleDeg, const std::tuple<double, double> &shift, |
| 57 | const NVCVInterpolationType interpolation, std::optional<Stream> pstream) |
no test coverage detected