| 100 | |
| 101 | template<class InputContainer> |
| 102 | TupleTensor3 MaxLocInto(Tensor &maxVal, Tensor &maxLoc, Tensor &numMax, InputContainer &input, |
| 103 | std::optional<Stream> pstream) |
| 104 | { |
| 105 | if (!pstream) |
| 106 | { |
| 107 | pstream = Stream::Current(); |
| 108 | } |
| 109 | |
| 110 | auto op = CreateOperator<cvcuda::MinMaxLoc>(); |
| 111 | |
| 112 | ResourceGuard guard(*pstream); |
| 113 | guard.add(LockMode::LOCK_MODE_READ, {input}); |
| 114 | guard.add(LockMode::LOCK_MODE_WRITE, {maxVal, maxLoc, numMax}); |
| 115 | guard.add(LockMode::LOCK_MODE_NONE, {*op}); |
| 116 | |
| 117 | op->submit(pstream->cudaHandle(), input, nullptr, nullptr, nullptr, maxVal, maxLoc, numMax); |
| 118 | |
| 119 | return TupleTensor3(std::move(maxVal), std::move(maxLoc), std::move(numMax)); |
| 120 | } |
| 121 | |
| 122 | TupleTensor3 MaxLocTensorInto(Tensor &maxVal, Tensor &maxLoc, Tensor &numMax, Tensor &input, |
| 123 | std::optional<Stream> pstream) |
no test coverage detected