| 39 | |
| 40 | namespace { |
| 41 | Tensor NormalizeInto(Tensor &output, Tensor &input, Tensor &base, Tensor &scale, std::optional<uint32_t> flags, |
| 42 | float globalScale, float globalShift, float epsilon, std::optional<Stream> pstream) |
| 43 | { |
| 44 | if (!pstream) |
| 45 | { |
| 46 | pstream = Stream::Current(); |
| 47 | } |
| 48 | |
| 49 | if (!flags) |
| 50 | { |
| 51 | flags = 0; |
| 52 | } |
| 53 | |
| 54 | auto normalize = CreateOperator<cvcuda::Normalize>(); |
| 55 | |
| 56 | ResourceGuard guard(*pstream); |
| 57 | guard.add(LockMode::LOCK_MODE_READ, {input, base, scale}); |
| 58 | guard.add(LockMode::LOCK_MODE_WRITE, {output}); |
| 59 | guard.add(LockMode::LOCK_MODE_NONE, {*normalize}); |
| 60 | |
| 61 | normalize->submit(pstream->cudaHandle(), input, base, scale, output, globalScale, globalShift, epsilon, *flags); |
| 62 | |
| 63 | return std::move(output); |
| 64 | } |
| 65 | |
| 66 | Tensor Normalize(Tensor &input, Tensor &base, Tensor &scale, std::optional<uint32_t> flags, float globalScale, |
| 67 | float globalShift, float epsilon, std::optional<Stream> pstream) |
no test coverage detected