| 30 | |
| 31 | namespace { |
| 32 | Tensor 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 | |
| 54 | Tensor AdaptiveThreshold(Tensor &input, double max_value, NVCVAdaptiveThresholdType adaptive_method, |
| 55 | NVCVThresholdType threshold_type, int32_t block_size, double c, std::optional<Stream> pstream) |
no test coverage detected