Skip to content
Snippets Groups Projects
Verified Commit 40d61780 authored by raphael.bach's avatar raphael.bach
Browse files

Rewrite `FMPI_TASK_REGISTER_N()` to take a `N` parameter

parent 9dd133e8
No related branches found
No related tags found
No related merge requests found
...@@ -55,11 +55,11 @@ int FUNC##_##N( \ ...@@ -55,11 +55,11 @@ int FUNC##_##N( \
.cnt = 0 \ .cnt = 0 \
}) })
#define FMPI_TASK_REGISTER_N(ctx, func, stencil, arg_out, ...) \ #define FMPI_TASK_REGISTER_N(N, ctx, func, stencil, arg_out, ...) \
fmpi_task_register((ctx), FMPI_PRIV_TASK_CONCAT(func##_, CPL_ARG_COUNT(__VA_ARGS__)), #func, stencil, &(struct fmpi_task_args){ \ fmpi_task_register((ctx), func##_##N, #func, stencil, &(struct fmpi_task_args){ \
.in = {__VA_ARGS__}, \ .in = {__VA_ARGS__}, \
.out = (arg_out), \ .out = (arg_out), \
.cnt = CPL_ARG_COUNT(__VA_ARGS__) \ .cnt = N \
}) })
#define FMPI_TASK_FUNC_0(func, ctx, args) \ #define FMPI_TASK_FUNC_0(func, ctx, args) \
...@@ -349,37 +349,37 @@ int FUNC##_##N( \ ...@@ -349,37 +349,37 @@ int FUNC##_##N( \
args->in[30].start, args->in[31] \ args->in[30].start, args->in[31] \
) )
#define FMPI_TASK_REGISTER_2(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_2(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(1, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_3(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_3(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(2, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_4(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_4(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(3, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_5(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_5(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(4, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_6(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_6(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(5, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_7(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_7(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(6, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_8(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_8(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(7, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_9(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_9(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(8, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_10(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_10(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(9, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_11(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_11(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(10, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_12(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_12(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(11, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_13(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_13(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(12, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_14(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_14(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(13, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_15(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_15(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(14, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_16(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_16(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(15, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_17(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_17(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(16, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_18(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_18(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(17, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_19(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_19(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(18, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_20(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_20(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(19, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_21(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_21(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(20, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_22(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_22(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(21, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_23(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_23(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(22, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_24(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_24(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(23, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_25(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_25(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(24, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_26(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_26(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(25, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_27(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_27(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(26, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_28(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_28(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(27, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_29(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_29(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(28, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_30(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_30(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(29, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_31(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_31(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(30, ctx, func, stencil, __VA_ARGS__)
#define FMPI_TASK_REGISTER_32(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(ctx, func, stencil, __VA_ARGS__) #define FMPI_TASK_REGISTER_32(ctx, func, stencil, ...) FMPI_TASK_REGISTER_N(31, ctx, func, stencil, __VA_ARGS__)
/*============================================================================== /*==============================================================================
GUARD GUARD
==============================================================================*/ ==============================================================================*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment