Question: Would anyone like to take a crack at providing some pseudo-code that would demonstrate how gather/scatter work? Your solution may implement the the index/result vectors and memory as arrays.
Gather:
for(i = 0; i < N; i++) { R1[i] = mem_base[R0[i]]; }
Scatter:
for(i = 0; i < N; i++) { mem_base[R0[i]] = R1[i]; }
Question: Would anyone like to take a crack at providing some pseudo-code that would demonstrate how gather/scatter work? Your solution may implement the the index/result vectors and memory as arrays.
Gather:
Scatter: