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