MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / update_tile_repeat_state

Function update_tile_repeat_state

dnn/src/common/tile_repeat_helper.cpp:43–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42template <typename T>
43void 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>( \

Callers 4

execMethod · 0.85
execMethod · 0.85
exec_internalMethod · 0.85
exec_internalMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected