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

Function AdaptiveThresholdInto

python/mod_cvcuda/operators/OpAdaptiveThreshold.cpp:32–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31namespace {
32Tensor AdaptiveThresholdInto(Tensor &output, Tensor &input, double max_value, NVCVAdaptiveThresholdType adaptive_method,
33 NVCVThresholdType threshold_type, int32_t block_size, double c,
34 std::optional<Stream> pstream)
35{
36 if (!pstream)
37 {
38 pstream = Stream::Current();
39 }
40
41 auto adaptiveThreshold = CreateOperator<cvcuda::AdaptiveThreshold>(block_size, 0);
42
43 ResourceGuard guard(*pstream);
44 guard.add(LockMode::LOCK_MODE_READ, {input});
45 guard.add(LockMode::LOCK_MODE_WRITE, {output});
46 guard.add(LockMode::LOCK_MODE_READWRITE, {*adaptiveThreshold});
47
48 adaptiveThreshold->submit(pstream->cudaHandle(), input, output, max_value, adaptive_method, threshold_type,
49 block_size, c);
50
51 return output;
52}
53
54Tensor AdaptiveThreshold(Tensor &input, double max_value, NVCVAdaptiveThresholdType adaptive_method,
55 NVCVThresholdType threshold_type, int32_t block_size, double c, std::optional<Stream> pstream)

Callers 1

AdaptiveThresholdFunction · 0.85

Calls 3

cudaHandleMethod · 0.80
addMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected