| 30 | |
| 31 | namespace { |
| 32 | Tensor 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 | |
| 53 | Tensor Threshold(Tensor &input, Tensor &thresh, Tensor &maxval, uint32_t type, std::optional<Stream> pstream) |
| 54 | { |
no test coverage detected