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

Function ThresholdInto

python/mod_cvcuda/operators/OpThreshold.cpp:32–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31namespace {
32Tensor ThresholdInto(Tensor &output, Tensor &input, Tensor &thresh, Tensor &maxval, uint32_t type,
33 std::optional<Stream> pstream)
34{
35 if (!pstream)
36 {
37 pstream = Stream::Current();
38 }
39
40 nvcv::TensorShape shape = input.shape();
41 auto threshold = CreateOperator<cvcuda::Threshold>(type, (int)shape[0]);
42
43 ResourceGuard guard(*pstream);
44 guard.add(LockMode::LOCK_MODE_READ, {input, thresh, maxval});
45 guard.add(LockMode::LOCK_MODE_WRITE, {output});
46 guard.add(LockMode::LOCK_MODE_READWRITE, {*threshold});
47
48 threshold->submit(pstream->cudaHandle(), input, output, thresh, maxval);
49
50 return output;
51}
52
53Tensor Threshold(Tensor &input, Tensor &thresh, Tensor &maxval, uint32_t type, std::optional<Stream> pstream)
54{

Callers 1

ThresholdFunction · 0.85

Calls 4

cudaHandleMethod · 0.80
shapeMethod · 0.45
addMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected