diff --git a/MEMO b/MEMO index 50a45695db86a6f8bbddc64491bd8b207f281a95..05c5cd2ea53b750e0f819d7b7b07a773a484a898 100644 --- a/MEMO +++ b/MEMO @@ -54,8 +54,6 @@ To-do - Expose iname-duplicate-and-rename as a primitive. -- add_prefetch gets a flag to separate out each access - - Allow parameters to be varying during run-time, substituting values that depend on other inames? @@ -63,11 +61,15 @@ To-do - Scalar insn priority -- : in prefetches +- add_prefetch tagging + +- : (as in, Matlab full-sclice) in prefetches Future ideas ^^^^^^^^^^^^ +- (Web) UI + - Check for unordered (no-dependency) writes to the same location - String instructions? diff --git a/doc/reference.rst b/doc/reference.rst index 3202fe000b5c3b5c97290fc0a005f0fbf37da7c6..279572c246eb0375c88dd32264d231846a9a5ad3 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -8,7 +8,16 @@ This guide defines all functionality exposed by loopy. If you would like a more gentle introduction, you may consider reading the example-based guide :ref:`guide` instead. -.. _tags: +Inames +------ + +Loops are (by default) entered exactly once. This is necessary to preserve +depdency semantics--otherwise e.g. a fetch could happen inside one loop nest, +and then the instruction using that fetch could be inside a wholly different +loop nest. + +Integer Domain +-------------- Expressions ----------- @@ -17,17 +26,40 @@ Expressions * `reductions` * duplication of reduction inames * complex-valued arithmetic +* tagging of array access and substitution rule use ("$") Assignments and Substitution Rules ---------------------------------- -Inames ------- +Syntax of an instruction:: -Loops are (by default) entered exactly once. This is necessary to preserve -depdency semantics--otherwise e.g. a fetch could happen inside one loop nest, -and then the instruction using that fetch could be inside a wholly different -loop nest. + label: [i,j|k,l] <float32> lhs[i,j,k] = EXPRESSION : dep_label, dep_label_2 + +The above example illustrates all the parts that are allowed in loo.py's +instruction syntax. All of these except for `lhs` and `EXPRESSION` are +optional. + +* `label` is a unique identifier for this instruction, enabling you to + refer back to the instruction uniquely during further transformation + as well as specifying ordering dependencies. + +* `dep_label,dep_label_2` are dependencies of the current instruction. + Loo.py will enforce that the instructions marked with these labels + are scheduled before this instruction. + +* `<float32>` declares `lhs` as a temporary variable, with shape given + by the ranges of the `lhs` subscripts. (Note that in this case, the + `lhs` subscripts must be pure inames, not expressions, for now.) + +* `[i,j|k,l]` specifies the inames within which this instruction is run. + Independent copies of the inames `k` and `l` will be made for this + instruction. + +Syntax of an substitution rule:: + + rule_name(arg1, arg2) := EXPRESSION + +.. _tags: Tags ----