| 133 | |
| 134 | template<class InputContainer> |
| 135 | TupleTensor6 MinMaxLocInto(Tensor &minVal, Tensor &minLoc, Tensor &numMin, Tensor &maxVal, Tensor &maxLoc, |
| 136 | Tensor &numMax, InputContainer &input, std::optional<Stream> pstream) |
| 137 | { |
| 138 | if (!pstream) |
| 139 | { |
| 140 | pstream = Stream::Current(); |
| 141 | } |
| 142 | |
| 143 | auto op = CreateOperator<cvcuda::MinMaxLoc>(); |
| 144 | |
| 145 | ResourceGuard guard(*pstream); |
| 146 | guard.add(LockMode::LOCK_MODE_READ, {input}); |
| 147 | guard.add(LockMode::LOCK_MODE_WRITE, {minVal, minLoc, numMin, maxVal, maxLoc, numMax}); |
| 148 | guard.add(LockMode::LOCK_MODE_NONE, {*op}); |
| 149 | |
| 150 | op->submit(pstream->cudaHandle(), input, minVal, minLoc, numMin, maxVal, maxLoc, numMax); |
| 151 | |
| 152 | return TupleTensor6(std::move(minVal), std::move(minLoc), std::move(numMin), std::move(maxVal), std::move(maxLoc), |
| 153 | std::move(numMax)); |
| 154 | } |
| 155 | |
| 156 | TupleTensor6 MinMaxLocTensorInto(Tensor &minVal, Tensor &minLoc, Tensor &numMin, Tensor &maxVal, Tensor &maxLoc, |
| 157 | Tensor &numMax, Tensor &input, std::optional<Stream> pstream) |
no test coverage detected