| 41 | |
| 42 | template <typename T> |
| 43 | void update_tile_repeat_state( |
| 44 | const T* /* src */, T* dst, T* workspace0, T* workspace1, T*& current, T*& next, |
| 45 | size_t& state, size_t nr_reduces) { |
| 46 | current = next; |
| 47 | if (nr_reduces == 1) { |
| 48 | next = nullptr; |
| 49 | } else if (nr_reduces == 2) { |
| 50 | if (state == 0) { |
| 51 | next = dst; |
| 52 | } else { |
| 53 | next = nullptr; |
| 54 | } |
| 55 | } else { |
| 56 | if (state == 0) { |
| 57 | next = workspace1; |
| 58 | } else if (state + 1 == nr_reduces) { |
| 59 | next = nullptr; |
| 60 | } else if (state + 2 == nr_reduces) { |
| 61 | next = dst; |
| 62 | } else { |
| 63 | megdnn_assert( |
| 64 | current == workspace0 || current == workspace1, |
| 65 | "Impossible happened; internal bug."); |
| 66 | next = (current == workspace0 ? workspace1 : workspace0); |
| 67 | } |
| 68 | } |
| 69 | ++state; |
| 70 | } |
| 71 | |
| 72 | #define INST(T) \ |
| 73 | template void tile_or_repeat_single_axis<T>( \ |
no outgoing calls
no test coverage detected