| 36 | namespace { |
| 37 | |
| 38 | Tensor CvtColorInto(Tensor &output, Tensor &input, NVCVColorConversionCode code, std::optional<Stream> pstream) |
| 39 | { |
| 40 | if (!pstream) |
| 41 | { |
| 42 | pstream = Stream::Current(); |
| 43 | } |
| 44 | |
| 45 | auto cvtColor = CreateOperator<cvcuda::CvtColor>(); |
| 46 | |
| 47 | ResourceGuard guard(*pstream); |
| 48 | guard.add(LockMode::LOCK_MODE_READWRITE, {input}); |
| 49 | guard.add(LockMode::LOCK_MODE_WRITE, {output}); |
| 50 | guard.add(LockMode::LOCK_MODE_NONE, {*cvtColor}); |
| 51 | |
| 52 | cvtColor->submit(pstream->cudaHandle(), input, output, code); |
| 53 | |
| 54 | return output; |
| 55 | } |
| 56 | |
| 57 | Tensor CvtColor(Tensor &input, NVCVColorConversionCode code, std::optional<Stream> pstream) |
| 58 | { |
no test coverage detected