Commit f0aa935 1 parent 2a66d44 commit f0aa935 Copy full SHA for f0aa935
File tree 1 file changed +18
-2
lines changed
1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,24 @@ functionality to check arguments for correctness such as Python type.
70
70
71
71
By default, register arguments are understood as single registers. The
72
72
:py:obj: `vectorize ` decorator is an easy way to allow vector arguments
73
- if all register arguments have the same length. The vector size stored
74
- independently of the arguments.
73
+ if all register arguments have the same length. The vector size is
74
+ stored independently of the arguments. The decorator creates two
75
+ instructions, a base version for single registers and a vectorized
76
+ version, which is called as follows in the example for length
77
+ :py:obj: `n `::
78
+
79
+ vprefixsum(n, result, operand)
80
+
81
+ At the higher level, the vector length is usually derived from the
82
+ input using the :py:obj: `vectorize ` decorator as in
83
+ :py:func: `~Compiler.types.sint.prefix_sum `::
84
+
85
+ @vectorize
86
+ def prefix_sum(self):
87
+ """ Prefix sum. """
88
+ res = sint()
89
+ prefixsums(res, self)
90
+ return res
75
91
76
92
All instruction classes should inherit from :py:obj: `Instruction ` in
77
93
:download: `../Compiler/instructions_base.py `.
You can’t perform that action at this time.
0 commit comments