]> git.unchartedbackwaters.co.uk Git - francis/ofc.git/commitdiff
Random notes on consumers and producers.
authorFrancis Russell <francis@unchartedbackwaters.co.uk>
Mon, 2 Apr 2012 16:36:11 +0000 (17:36 +0100)
committerFrancis Russell <francis@unchartedbackwaters.co.uk>
Mon, 2 Apr 2012 16:36:11 +0000 (17:36 +0100)
docs/combining_producers_consumers.txt [new file with mode: 0644]

diff --git a/docs/combining_producers_consumers.txt b/docs/combining_producers_consumers.txt
new file mode 100644 (file)
index 0000000..32e8c84
--- /dev/null
@@ -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.