MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / NormalizeInto

Function NormalizeInto

python/mod_cvcuda/operators/OpNormalize.cpp:41–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40namespace {
41Tensor 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
66Tensor Normalize(Tensor &input, Tensor &base, Tensor &scale, std::optional<uint32_t> flags, float globalScale,
67 float globalShift, float epsilon, std::optional<Stream> pstream)

Callers 1

NormalizeFunction · 0.85

Calls 3

cudaHandleMethod · 0.80
addMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected