From db789d8d789dc38c1cc404bedbbf831447acd436 Mon Sep 17 00:00:00 2001 From: Francis Russell Date: Mon, 2 Apr 2012 17:36:11 +0100 Subject: [PATCH] Random notes on consumers and producers. --- docs/combining_producers_consumers.txt | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docs/combining_producers_consumers.txt diff --git a/docs/combining_producers_consumers.txt b/docs/combining_producers_consumers.txt new file mode 100644 index 0000000..32e8c84 --- /dev/null +++ b/docs/combining_producers_consumers.txt @@ -0,0 +1,51 @@ +How do we combine producers and consumers? +------------------------------------------ + +Assume some producer x generating points: + +Loop A + Loop B + x(A, B, v) + + +Case 1: Consumer y operates point-wise: + +Loop A + Loop B + y(A, B, v) + + +Case 2: Consumer y operates block-wise: + +Loop A + Loop B + y_in(A, B, v) + +y_opaque + +Loop C + Loop D + y_out(C, D, v) + + +In both cases, we can always substitute the point receiver of y into the +body of loop B. However, depending on whether y is point-wise or +block-wise, we may have intermediate code and the output expression may +be either in the original loops, or new generated loops. How do we +generalise the templating scheme for either strategy? + +We cannot just substitute y into x since code in y may exist outside of +y's loops (the block-wise case). We cannot substitute x into y since the +body of y may also need to exist within x's loops (the point-wise case). + +We have two types of granularity when considering producers and +consumers: + +1. The type of object on which an operator conceptually operates. +2. The number of elements each operator needs before it can operate. + +An fftbox operator operators conceptually on blocks, but can be applied +on a point-wise basis since it merely filters point. + +A reciprocal operator (the FFT) requires all points in a spatial block +before it can operate. -- 2.47.3