Skip to content

Commit 4aeca15

Browse files
committed
add desciriopn for chunk == 1
1 parent 8e097c8 commit 4aeca15

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/VecSim/spaces/functions/implementation_chooser.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@
2323

2424
// Macros for folding cases of a switch statement, for easier readability.
2525
// Each macro expands into a sequence of cases, from 0 to N-1, doubling the previous macro.
26-
#define C2(func, N) C1(func, 2 * (N)) C1(func, 2 * (N) + 1)
27-
#define C4(func, N) C2(func, 2 * (N)) C2(func, 2 * (N) + 1)
28-
#define C8(func, N) C4(func, 2 * (N)) C4(func, 2 * (N) + 1)
29-
#define C16(func, N) C8(func, 2 * (N)) C8(func, 2 * (N) + 1)
30-
#define C32(func, N) C16(func, 2 * (N)) C16(func, 2 * (N) + 1)
31-
#define C64(func, N) C32(func, 2 * (N)) C32(func, 2 * (N) + 1)
32-
#define C128(func, N) C64(func, 2 * (N)) C64(func, 2 * (N) + 1)
33-
#define C256(func, N) C128(func, 2 * (N)) C128(func, 2 * (N) + 1)
34-
#define C512(func, N) C256(func, 2 * (N)) C256(func, 2 * (N) + 1)
35-
#define C1024(func, N) C512(func, 2 * (N)) C512(func, 2 * (N) + 1)
26+
#define C2(func, N) C1(func, 2 * (N)) C1(func, 2 * (N) + 1)
27+
#define C4(func, N) C2(func, 2 * (N)) C2(func, 2 * (N) + 1)
28+
#define C8(func, N) C4(func, 2 * (N)) C4(func, 2 * (N) + 1)
29+
#define C16(func, N) C8(func, 2 * (N)) C8(func, 2 * (N) + 1)
30+
#define C32(func, N) C16(func, 2 * (N)) C16(func, 2 * (N) + 1)
31+
#define C64(func, N) C32(func, 2 * (N)) C32(func, 2 * (N) + 1)
3632

3733
// Macros for 8, 16, 32 and 64 cases. Used to collapse the switch statement.
3834
// Expands into 0-7, 0-15, 0-31 or 0-63 cases respectively.
@@ -50,6 +46,8 @@
5046
// func: The templated function that we want to choose the implementation for.
5147
// chunk: The chunk size. Can be 64, 32, 16 or 8. Should be the number of elements of the expected
5248
// type fitting in the expected register size.
49+
// chunk == 1 means that there's no use of the residual, and we can use the function
50+
// directly.
5351
#define CHOOSE_IMPLEMENTATION(out, dim, chunk, func) \
5452
do { \
5553
decltype(out) __ret_dist_func; \

0 commit comments

Comments
 (0)