| 49 | |
| 50 | template<typename Op, typename Src, typename Dst, typename Call> |
| 51 | auto runGuard(Op &op, Src &src, Dst &dst, const Tensor &twist, std::optional<Stream> &pstream, Call &&call) |
| 52 | { |
| 53 | if (!pstream) |
| 54 | { |
| 55 | pstream = Stream::Current(); |
| 56 | } |
| 57 | |
| 58 | ResourceGuard guard(*pstream); |
| 59 | guard.add(LockMode::LOCK_MODE_READ, {src, twist}); |
| 60 | guard.add(LockMode::LOCK_MODE_WRITE, {dst}); |
| 61 | guard.add(LockMode::LOCK_MODE_NONE, {*op}); |
| 62 | |
| 63 | call(*pstream); |
| 64 | } |
| 65 | |
| 66 | Tensor ColorTwistMatrixInto(Tensor &dst, Tensor &src, Tensor &twist, std::optional<Stream> pstream) |
| 67 | { |
no test coverage detected