20 #ifndef _PLASMA_GLOBAL_H_
21 #define _PLASMA_GLOBAL_H_
27 #if defined( _WIN32 ) || defined( _WIN64 )
28 #include "plasmawinthread.h"
37 #define CONTEXTS_MAX 256
39 #define CONTEXT_THREADS_MAX 256
41 #define ARGS_BUFF_SIZE 512
43 #define CACHE_LINE_SIZE 128
45 #define STANDARD_PAGE_SIZE 4096
50 #define PLASMA_ACT_STAND_BY 0
51 #define PLASMA_ACT_PARALLEL 1
52 #define PLASMA_ACT_DYNAMIC 2
53 #define PLASMA_ACT_FINALIZE 3
58 #define PLASMA_FUNC_SGELS 1
59 #define PLASMA_FUNC_SPOSV 2
60 #define PLASMA_FUNC_SGESV 3
61 #define PLASMA_FUNC_DGELS 4
62 #define PLASMA_FUNC_DPOSV 5
63 #define PLASMA_FUNC_DGESV 6
64 #define PLASMA_FUNC_CGELS 7
65 #define PLASMA_FUNC_CPOSV 8
66 #define PLASMA_FUNC_CGESV 9
67 #define PLASMA_FUNC_ZGELS 10
68 #define PLASMA_FUNC_ZPOSV 11
69 #define PLASMA_FUNC_ZGESV 12
70 #define PLASMA_FUNC_ZCGESV 13
71 #define PLASMA_FUNC_DSGESV 14
72 #define PLASMA_FUNC_ZCPOSV 15
73 #define PLASMA_FUNC_DSPOSV 16
74 #define PLASMA_FUNC_DSGELS 17
75 #define PLASMA_FUNC_ZCGELS 18
76 #define PLASMA_FUNC_SGEMM 19
77 #define PLASMA_FUNC_DGEMM 20
78 #define PLASMA_FUNC_CGEMM 21
79 #define PLASMA_FUNC_ZGEMM 22
80 #define PLASMA_FUNC_SSYMM 23
81 #define PLASMA_FUNC_DSYMM 24
82 #define PLASMA_FUNC_CSYMM 25
83 #define PLASMA_FUNC_ZSYMM 26
84 #define PLASMA_FUNC_CHERK 27
85 #define PLASMA_FUNC_ZHERK 28
86 #define PLASMA_FUNC_SSYRK 29
87 #define PLASMA_FUNC_DSYRK 30
88 #define PLASMA_FUNC_CSYRK 31
89 #define PLASMA_FUNC_ZSYRK 32
90 #define PLASMA_FUNC_CHEMM 33
91 #define PLASMA_FUNC_ZHEMM 34
92 #define PLASMA_FUNC_ZHEEV 35
93 #define PLASMA_FUNC_CHEEV 36
94 #define PLASMA_FUNC_DSYEV 37
95 #define PLASMA_FUNC_SSYEV 38
96 #define PLASMA_FUNC_ZHEEVD 39
97 #define PLASMA_FUNC_CHEEVD 40
98 #define PLASMA_FUNC_DSYEVD 41
99 #define PLASMA_FUNC_SSYEVD 42
100 #define PLASMA_FUNC_ZHEGST 43
101 #define PLASMA_FUNC_CHEGST 44
102 #define PLASMA_FUNC_DSYGST 45
103 #define PLASMA_FUNC_SSYGST 46
104 #define PLASMA_FUNC_ZHEGV 47
105 #define PLASMA_FUNC_CHEGV 48
106 #define PLASMA_FUNC_DSYGV 49
107 #define PLASMA_FUNC_SSYGV 50
108 #define PLASMA_FUNC_ZHEGVD 51
109 #define PLASMA_FUNC_CHEGVD 52
110 #define PLASMA_FUNC_DSYGVD 53
111 #define PLASMA_FUNC_SSYGVD 54
112 #define PLASMA_FUNC_ZHETRD 55
113 #define PLASMA_FUNC_CHETRD 56
114 #define PLASMA_FUNC_DSYTRD 57
115 #define PLASMA_FUNC_SSYTRD 58
116 #define PLASMA_FUNC_ZGESVD 59
117 #define PLASMA_FUNC_CGESVD 60
118 #define PLASMA_FUNC_DGESVD 61
119 #define PLASMA_FUNC_SGESVD 62
120 #define PLASMA_FUNC_ZGEEV 63
121 #define PLASMA_FUNC_CGEEV 64
122 #define PLASMA_FUNC_DGEEV 65
123 #define PLASMA_FUNC_SGEEV 66
124 #define PLASMA_FUNC_ZGEHRD 67
125 #define PLASMA_FUNC_CGEHRD 68
126 #define PLASMA_FUNC_DGEHRD 69
127 #define PLASMA_FUNC_SGEHRD 70
128 #define PLASMA_FUNC_ZGEBRD 71
129 #define PLASMA_FUNC_CGEBRD 72
130 #define PLASMA_FUNC_DGEBRD 73
131 #define PLASMA_FUNC_SGEBRD 74
136 #define plasma_pack_args_1( \
139 type1 var1 = (arg1); \
140 unsigned char *plasma_ptr = plasma->args_buff; \
141 if (sizeof(type1) > ARGS_BUFF_SIZE) \
142 plasma_fatal_error("plasma_pack_args_1", "arguments buffer too small"); \
143 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
146 #define plasma_pack_args_2( \
150 type1 var1 = (arg1); \
151 type2 var2 = (arg2); \
152 unsigned char *plasma_ptr = plasma->args_buff; \
153 if (sizeof(type1) + \
154 sizeof(type2) > ARGS_BUFF_SIZE) \
155 plasma_fatal_error("plasma_pack_args_2", "arguments buffer too small"); \
156 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
157 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
160 #define plasma_pack_args_3( \
165 type1 var1 = (arg1); \
166 type2 var2 = (arg2); \
167 type3 var3 = (arg3); \
168 unsigned char *plasma_ptr = plasma->args_buff; \
169 if (sizeof(type1) + \
171 sizeof(type3) > ARGS_BUFF_SIZE) \
172 plasma_fatal_error("plasma_pack_args_3", "arguments buffer too small"); \
173 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
174 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
175 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
178 #define plasma_pack_args_4( \
184 type1 var1 = (arg1); \
185 type2 var2 = (arg2); \
186 type3 var3 = (arg3); \
187 type4 var4 = (arg4); \
188 unsigned char *plasma_ptr = plasma->args_buff; \
189 if (sizeof(type1) + \
192 sizeof(type4) > ARGS_BUFF_SIZE) \
193 plasma_fatal_error("plasma_pack_args_4", "arguments buffer too small"); \
194 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
195 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
196 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
197 memcpy(plasma_ptr, &var4, sizeof(type4)); plasma_ptr += sizeof(type4); \
200 #define plasma_pack_args_5( \
207 type1 var1 = (arg1); \
208 type2 var2 = (arg2); \
209 type3 var3 = (arg3); \
210 type4 var4 = (arg4); \
211 type5 var5 = (arg5); \
212 unsigned char *plasma_ptr = plasma->args_buff; \
213 if (sizeof(type1) + \
217 sizeof(type5) > ARGS_BUFF_SIZE) \
218 plasma_fatal_error("plasma_pack_args_5", "arguments buffer too small"); \
219 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
220 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
221 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
222 memcpy(plasma_ptr, &var4, sizeof(type4)); plasma_ptr += sizeof(type4); \
223 memcpy(plasma_ptr, &var5, sizeof(type5)); plasma_ptr += sizeof(type5); \
226 #define plasma_pack_args_6( \
234 type1 var1 = (arg1); \
235 type2 var2 = (arg2); \
236 type3 var3 = (arg3); \
237 type4 var4 = (arg4); \
238 type5 var5 = (arg5); \
239 type6 var6 = (arg6); \
240 unsigned char *plasma_ptr = plasma->args_buff; \
241 if (sizeof(type1) + \
246 sizeof(type6) > ARGS_BUFF_SIZE) \
247 plasma_fatal_error("plasma_pack_args_6", "arguments buffer too small"); \
248 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
249 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
250 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
251 memcpy(plasma_ptr, &var4, sizeof(type4)); plasma_ptr += sizeof(type4); \
252 memcpy(plasma_ptr, &var5, sizeof(type5)); plasma_ptr += sizeof(type5); \
253 memcpy(plasma_ptr, &var6, sizeof(type6)); plasma_ptr += sizeof(type6); \
256 #define plasma_pack_args_7( \
265 type1 var1 = (arg1); \
266 type2 var2 = (arg2); \
267 type3 var3 = (arg3); \
268 type4 var4 = (arg4); \
269 type5 var5 = (arg5); \
270 type6 var6 = (arg6); \
271 type7 var7 = (arg7); \
272 unsigned char *plasma_ptr = plasma->args_buff; \
273 if (sizeof(type1) + \
279 sizeof(type7) > ARGS_BUFF_SIZE) \
280 plasma_fatal_error("plasma_pack_args_7", "arguments buffer too small"); \
281 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
282 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
283 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
284 memcpy(plasma_ptr, &var4, sizeof(type4)); plasma_ptr += sizeof(type4); \
285 memcpy(plasma_ptr, &var5, sizeof(type5)); plasma_ptr += sizeof(type5); \
286 memcpy(plasma_ptr, &var6, sizeof(type6)); plasma_ptr += sizeof(type6); \
287 memcpy(plasma_ptr, &var7, sizeof(type7)); plasma_ptr += sizeof(type7); \
290 #define plasma_pack_args_8( \
300 type1 var1 = (arg1); \
301 type2 var2 = (arg2); \
302 type3 var3 = (arg3); \
303 type4 var4 = (arg4); \
304 type5 var5 = (arg5); \
305 type6 var6 = (arg6); \
306 type7 var7 = (arg7); \
307 type8 var8 = (arg8); \
308 unsigned char *plasma_ptr = plasma->args_buff; \
309 if (sizeof(type1) + \
316 sizeof(type8) > ARGS_BUFF_SIZE) \
317 plasma_fatal_error("plasma_pack_args_8", "arguments buffer too small"); \
318 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
319 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
320 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
321 memcpy(plasma_ptr, &var4, sizeof(type4)); plasma_ptr += sizeof(type4); \
322 memcpy(plasma_ptr, &var5, sizeof(type5)); plasma_ptr += sizeof(type5); \
323 memcpy(plasma_ptr, &var6, sizeof(type6)); plasma_ptr += sizeof(type6); \
324 memcpy(plasma_ptr, &var7, sizeof(type7)); plasma_ptr += sizeof(type7); \
325 memcpy(plasma_ptr, &var8, sizeof(type8)); plasma_ptr += sizeof(type8); \
328 #define plasma_pack_args_9( \
339 type1 var1 = (arg1); \
340 type2 var2 = (arg2); \
341 type3 var3 = (arg3); \
342 type4 var4 = (arg4); \
343 type5 var5 = (arg5); \
344 type6 var6 = (arg6); \
345 type7 var7 = (arg7); \
346 type8 var8 = (arg8); \
347 type9 var9 = (arg9); \
348 unsigned char *plasma_ptr = plasma->args_buff; \
349 if (sizeof(type1) + \
357 sizeof(type9) > ARGS_BUFF_SIZE) \
358 plasma_fatal_error("plasma_pack_args_9", "arguments buffer too small"); \
359 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
360 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
361 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
362 memcpy(plasma_ptr, &var4, sizeof(type4)); plasma_ptr += sizeof(type4); \
363 memcpy(plasma_ptr, &var5, sizeof(type5)); plasma_ptr += sizeof(type5); \
364 memcpy(plasma_ptr, &var6, sizeof(type6)); plasma_ptr += sizeof(type6); \
365 memcpy(plasma_ptr, &var7, sizeof(type7)); plasma_ptr += sizeof(type7); \
366 memcpy(plasma_ptr, &var8, sizeof(type8)); plasma_ptr += sizeof(type8); \
367 memcpy(plasma_ptr, &var9, sizeof(type9)); plasma_ptr += sizeof(type9); \
370 #define plasma_pack_args_10( \
382 type1 var1 = (arg1); \
383 type2 var2 = (arg2); \
384 type3 var3 = (arg3); \
385 type4 var4 = (arg4); \
386 type5 var5 = (arg5); \
387 type6 var6 = (arg6); \
388 type7 var7 = (arg7); \
389 type8 var8 = (arg8); \
390 type9 var9 = (arg9); \
391 type10 var10 = (arg10); \
392 unsigned char *plasma_ptr = plasma->args_buff; \
393 if (sizeof(type1) + \
402 sizeof(type10) > ARGS_BUFF_SIZE) \
403 plasma_fatal_error("plasma_pack_args_9", "arguments buffer too small"); \
404 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
405 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
406 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
407 memcpy(plasma_ptr, &var4, sizeof(type4)); plasma_ptr += sizeof(type4); \
408 memcpy(plasma_ptr, &var5, sizeof(type5)); plasma_ptr += sizeof(type5); \
409 memcpy(plasma_ptr, &var6, sizeof(type6)); plasma_ptr += sizeof(type6); \
410 memcpy(plasma_ptr, &var7, sizeof(type7)); plasma_ptr += sizeof(type7); \
411 memcpy(plasma_ptr, &var8, sizeof(type8)); plasma_ptr += sizeof(type8); \
412 memcpy(plasma_ptr, &var9, sizeof(type9)); plasma_ptr += sizeof(type9); \
413 memcpy(plasma_ptr, &var10, sizeof(type10)); plasma_ptr += sizeof(type10); \
417 #define plasma_pack_args_11( \
430 type1 var1 = (arg1); \
431 type2 var2 = (arg2); \
432 type3 var3 = (arg3); \
433 type4 var4 = (arg4); \
434 type5 var5 = (arg5); \
435 type6 var6 = (arg6); \
436 type7 var7 = (arg7); \
437 type8 var8 = (arg8); \
438 type9 var9 = (arg9); \
439 type10 var10 = (arg10); \
440 type11 var11 = (arg11); \
441 unsigned char *plasma_ptr = plasma->args_buff; \
442 if (sizeof(type1) + \
452 sizeof(type11) > ARGS_BUFF_SIZE) \
453 plasma_fatal_error("plasma_pack_args_11", "arguments buffer too small"); \
454 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
455 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
456 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
457 memcpy(plasma_ptr, &var4, sizeof(type4)); plasma_ptr += sizeof(type4); \
458 memcpy(plasma_ptr, &var5, sizeof(type5)); plasma_ptr += sizeof(type5); \
459 memcpy(plasma_ptr, &var6, sizeof(type6)); plasma_ptr += sizeof(type6); \
460 memcpy(plasma_ptr, &var7, sizeof(type7)); plasma_ptr += sizeof(type7); \
461 memcpy(plasma_ptr, &var8, sizeof(type8)); plasma_ptr += sizeof(type8); \
462 memcpy(plasma_ptr, &var9, sizeof(type9)); plasma_ptr += sizeof(type9); \
463 memcpy(plasma_ptr, &var10, sizeof(type10)); plasma_ptr += sizeof(type10); \
464 memcpy(plasma_ptr, &var11, sizeof(type11)); plasma_ptr += sizeof(type11); \
467 #define plasma_pack_args_12( \
481 type1 var1 = (arg1); \
482 type2 var2 = (arg2); \
483 type3 var3 = (arg3); \
484 type4 var4 = (arg4); \
485 type5 var5 = (arg5); \
486 type6 var6 = (arg6); \
487 type7 var7 = (arg7); \
488 type8 var8 = (arg8); \
489 type9 var9 = (arg9); \
490 type10 var10 = (arg10); \
491 type11 var11 = (arg11); \
492 type12 var12 = (arg12); \
493 unsigned char *plasma_ptr = plasma->args_buff; \
494 if (sizeof(type1) + \
505 sizeof(type12) > ARGS_BUFF_SIZE) \
506 plasma_fatal_error("plasma_pack_args_12", "arguments buffer too small"); \
507 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
508 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
509 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
510 memcpy(plasma_ptr, &var4, sizeof(type4)); plasma_ptr += sizeof(type4); \
511 memcpy(plasma_ptr, &var5, sizeof(type5)); plasma_ptr += sizeof(type5); \
512 memcpy(plasma_ptr, &var6, sizeof(type6)); plasma_ptr += sizeof(type6); \
513 memcpy(plasma_ptr, &var7, sizeof(type7)); plasma_ptr += sizeof(type7); \
514 memcpy(plasma_ptr, &var8, sizeof(type8)); plasma_ptr += sizeof(type8); \
515 memcpy(plasma_ptr, &var9, sizeof(type9)); plasma_ptr += sizeof(type9); \
516 memcpy(plasma_ptr, &var10, sizeof(type10)); plasma_ptr += sizeof(type10); \
517 memcpy(plasma_ptr, &var11, sizeof(type11)); plasma_ptr += sizeof(type11); \
518 memcpy(plasma_ptr, &var12, sizeof(type12)); plasma_ptr += sizeof(type12); \
522 #define plasma_pack_args_13( \
537 type1 var1 = (arg1); \
538 type2 var2 = (arg2); \
539 type3 var3 = (arg3); \
540 type4 var4 = (arg4); \
541 type5 var5 = (arg5); \
542 type6 var6 = (arg6); \
543 type7 var7 = (arg7); \
544 type8 var8 = (arg8); \
545 type9 var9 = (arg9); \
546 type10 var10 = (arg10); \
547 type11 var11 = (arg11); \
548 type12 var12 = (arg12); \
549 type13 var13 = (arg13); \
550 unsigned char *plasma_ptr = plasma->args_buff; \
551 if (sizeof(type1) + \
563 sizeof(type13) > ARGS_BUFF_SIZE) \
564 plasma_fatal_error("plasma_pack_args_13", "arguments buffer too small"); \
565 memcpy(plasma_ptr, &var1, sizeof(type1)); plasma_ptr += sizeof(type1); \
566 memcpy(plasma_ptr, &var2, sizeof(type2)); plasma_ptr += sizeof(type2); \
567 memcpy(plasma_ptr, &var3, sizeof(type3)); plasma_ptr += sizeof(type3); \
568 memcpy(plasma_ptr, &var4, sizeof(type4)); plasma_ptr += sizeof(type4); \
569 memcpy(plasma_ptr, &var5, sizeof(type5)); plasma_ptr += sizeof(type5); \
570 memcpy(plasma_ptr, &var6, sizeof(type6)); plasma_ptr += sizeof(type6); \
571 memcpy(plasma_ptr, &var7, sizeof(type7)); plasma_ptr += sizeof(type7); \
572 memcpy(plasma_ptr, &var8, sizeof(type8)); plasma_ptr += sizeof(type8); \
573 memcpy(plasma_ptr, &var9, sizeof(type9)); plasma_ptr += sizeof(type9); \
574 memcpy(plasma_ptr, &var10, sizeof(type10)); plasma_ptr += sizeof(type10); \
575 memcpy(plasma_ptr, &var11, sizeof(type11)); plasma_ptr += sizeof(type11); \
576 memcpy(plasma_ptr, &var12, sizeof(type12)); plasma_ptr += sizeof(type12); \
577 memcpy(plasma_ptr, &var13, sizeof(type13)); plasma_ptr += sizeof(type13); \
583 #define plasma_dynamic_sync() \
585 if (plasma->dynamic_section) { \
586 QUARK_Waitall(plasma->quark); \
587 plasma_barrier(plasma); \
588 plasma->dynamic_section = PLASMA_FALSE; \
595 #define plasma_static_call(parallel_function) \
597 if (plasma->dynamic_section) \
598 plasma_dynamic_sync(); \
599 pthread_mutex_lock(&plasma->action_mutex); \
600 plasma->action = PLASMA_ACT_PARALLEL; \
601 plasma->parallel_func_ptr = ¶llel_function; \
602 pthread_mutex_unlock(&plasma->action_mutex); \
603 pthread_cond_broadcast(&plasma->action_condt); \
604 plasma_barrier(plasma); \
605 plasma->action = PLASMA_ACT_STAND_BY; \
606 parallel_function(plasma); \
607 plasma_barrier(plasma); \
613 #define plasma_dynamic_spawn() \
615 if (!plasma->dynamic_section) { \
616 plasma->dynamic_section = PLASMA_TRUE; \
617 pthread_mutex_lock(&plasma->action_mutex); \
618 plasma->action = PLASMA_ACT_DYNAMIC; \
619 pthread_mutex_unlock(&plasma->action_mutex); \
620 pthread_cond_broadcast(&plasma->action_condt); \
621 plasma_barrier(plasma); \
622 plasma->action = PLASMA_ACT_STAND_BY; \
629 #define plasma_static_call_1( \
632 plasma_pack_args_1( \
634 plasma_static_call(parallel_function) \
636 #define plasma_static_call_2( \
640 plasma_pack_args_2( \
643 plasma_static_call(parallel_function) \
645 #define plasma_static_call_3( \
650 plasma_pack_args_3( \
654 plasma_static_call(parallel_function) \
656 #define plasma_static_call_4( \
662 plasma_pack_args_4( \
667 plasma_static_call(parallel_function) \
669 #define plasma_static_call_5( \
676 plasma_pack_args_5( \
682 plasma_static_call(parallel_function) \
684 #define plasma_static_call_6( \
692 plasma_pack_args_6( \
699 plasma_static_call(parallel_function) \
701 #define plasma_static_call_7( \
710 plasma_pack_args_7( \
718 plasma_static_call(parallel_function) \
720 #define plasma_static_call_8( \
730 plasma_pack_args_8( \
739 plasma_static_call(parallel_function) \
741 #define plasma_static_call_9( \
752 plasma_pack_args_9( \
762 plasma_static_call(parallel_function) \
764 #define plasma_static_call_10( \
776 plasma_pack_args_10( \
787 plasma_static_call(parallel_function) \
789 #define plasma_static_call_11( \
802 plasma_pack_args_11( \
814 plasma_static_call(parallel_function) \
817 #define plasma_static_call_12( \
831 plasma_pack_args_12( \
844 plasma_static_call(parallel_function) \
846 #define plasma_static_call_13( \
861 plasma_pack_args_13( \
875 plasma_static_call(parallel_function) \
880 #define plasma_parallel_call_1( \
883 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
884 plasma_pack_args_1( \
886 plasma_static_call(parallel_function) \
888 plasma_dynamic_spawn(); \
889 parallel_function##_quark( \
893 #define plasma_parallel_call_2( \
897 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
898 plasma_pack_args_2( \
901 plasma_static_call(parallel_function) \
903 plasma_dynamic_spawn(); \
904 parallel_function##_quark( \
909 #define plasma_parallel_call_3( \
914 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
915 plasma_pack_args_3( \
919 plasma_static_call(parallel_function) \
921 plasma_dynamic_spawn(); \
922 parallel_function##_quark( \
928 #define plasma_parallel_call_4( \
934 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
935 plasma_pack_args_4( \
940 plasma_static_call(parallel_function) \
942 plasma_dynamic_spawn(); \
943 parallel_function##_quark( \
950 #define plasma_parallel_call_5( \
957 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
958 plasma_pack_args_5( \
964 plasma_static_call(parallel_function) \
966 plasma_dynamic_spawn(); \
967 parallel_function##_quark( \
975 #define plasma_parallel_call_6( \
983 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
984 plasma_pack_args_6( \
991 plasma_static_call(parallel_function) \
993 plasma_dynamic_spawn(); \
994 parallel_function##_quark( \
1003 #define plasma_parallel_call_7( \
1004 parallel_function, \
1012 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
1013 plasma_pack_args_7( \
1021 plasma_static_call(parallel_function) \
1023 plasma_dynamic_spawn(); \
1024 parallel_function##_quark( \
1034 #define plasma_parallel_call_8( \
1035 parallel_function, \
1044 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
1045 plasma_pack_args_8( \
1054 plasma_static_call(parallel_function) \
1056 plasma_dynamic_spawn(); \
1057 parallel_function##_quark( \
1068 #define plasma_parallel_call_9( \
1069 parallel_function, \
1079 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
1080 plasma_pack_args_9( \
1090 plasma_static_call(parallel_function) \
1092 plasma_dynamic_spawn(); \
1093 parallel_function##_quark( \
1105 #define plasma_parallel_call_10( \
1106 parallel_function, \
1117 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
1118 plasma_pack_args_10( \
1129 plasma_static_call(parallel_function) \
1131 plasma_dynamic_spawn(); \
1132 parallel_function##_quark( \
1145 #define plasma_parallel_call_11( \
1146 parallel_function, \
1158 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
1159 plasma_pack_args_11( \
1171 plasma_static_call(parallel_function) \
1173 plasma_dynamic_spawn(); \
1174 parallel_function##_quark( \
1190 #define plasma_parallel_call_12( \
1191 parallel_function, \
1204 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
1205 plasma_pack_args_12( \
1218 plasma_static_call(parallel_function) \
1220 plasma_dynamic_spawn(); \
1221 parallel_function##_quark( \
1237 #define plasma_parallel_call_13( \
1238 parallel_function, \
1252 if (PLASMA_SCHEDULING == PLASMA_STATIC_SCHEDULING) { \
1253 plasma_pack_args_13( \
1267 plasma_static_call(parallel_function) \
1269 plasma_dynamic_spawn(); \
1270 parallel_function##_quark( \
1289 #define plasma_dynamic_call_1( \
1290 parallel_function, \
1292 plasma_dynamic_spawn(); \
1293 parallel_function##_quark( \
1296 #define plasma_dynamic_call_2( \
1297 parallel_function, \
1300 plasma_dynamic_spawn(); \
1301 parallel_function##_quark( \
1305 #define plasma_dynamic_call_3( \
1306 parallel_function, \
1310 plasma_dynamic_spawn(); \
1311 parallel_function##_quark( \
1316 #define plasma_dynamic_call_4( \
1317 parallel_function, \
1322 plasma_dynamic_spawn(); \
1323 parallel_function##_quark( \
1329 #define plasma_dynamic_call_5( \
1330 parallel_function, \
1336 plasma_dynamic_spawn(); \
1337 parallel_function##_quark( \
1344 #define plasma_dynamic_call_6( \
1345 parallel_function, \
1352 plasma_dynamic_spawn(); \
1353 parallel_function##_quark( \
1361 #define plasma_dynamic_call_7( \
1362 parallel_function, \
1370 plasma_dynamic_spawn(); \
1371 parallel_function##_quark( \
1380 #define plasma_dynamic_call_8( \
1381 parallel_function, \
1390 plasma_dynamic_spawn(); \
1391 parallel_function##_quark( \
1401 #define plasma_dynamic_call_9( \
1402 parallel_function, \
1412 plasma_dynamic_spawn(); \
1413 parallel_function##_quark( \
1424 #define plasma_dynamic_call_10( \
1425 parallel_function, \
1436 plasma_dynamic_spawn(); \
1437 parallel_function##_quark( \
1450 #define plasma_dynamic_call_11( \
1451 parallel_function, \
1463 plasma_dynamic_spawn(); \
1464 parallel_function##_quark( \
1478 #define plasma_dynamic_call_12( \
1479 parallel_function, \
1492 plasma_dynamic_spawn(); \
1493 parallel_function##_quark( \
1507 #define plasma_dynamic_call_13( \
1508 parallel_function, \
1522 plasma_dynamic_spawn(); \
1523 parallel_function##_quark( \
1541 #define plasma_unpack_args_1( \
1544 unsigned char *plasma_ptr = plasma->args_buff; \
1545 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1548 #define plasma_unpack_args_2( \
1552 unsigned char *plasma_ptr = plasma->args_buff; \
1553 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1554 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1557 #define plasma_unpack_args_3( \
1562 unsigned char *plasma_ptr = plasma->args_buff; \
1563 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1564 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1565 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1568 #define plasma_unpack_args_4( \
1574 unsigned char *plasma_ptr = plasma->args_buff; \
1575 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1576 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1577 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1578 memcpy(&arg4, plasma_ptr, sizeof(arg4)); plasma_ptr += sizeof(arg4); \
1581 #define plasma_unpack_args_5( \
1588 unsigned char *plasma_ptr = plasma->args_buff; \
1589 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1590 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1591 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1592 memcpy(&arg4, plasma_ptr, sizeof(arg4)); plasma_ptr += sizeof(arg4); \
1593 memcpy(&arg5, plasma_ptr, sizeof(arg5)); plasma_ptr += sizeof(arg5); \
1596 #define plasma_unpack_args_6( \
1604 unsigned char *plasma_ptr = plasma->args_buff; \
1605 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1606 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1607 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1608 memcpy(&arg4, plasma_ptr, sizeof(arg4)); plasma_ptr += sizeof(arg4); \
1609 memcpy(&arg5, plasma_ptr, sizeof(arg5)); plasma_ptr += sizeof(arg5); \
1610 memcpy(&arg6, plasma_ptr, sizeof(arg6)); plasma_ptr += sizeof(arg6); \
1613 #define plasma_unpack_args_7( \
1622 unsigned char *plasma_ptr = plasma->args_buff; \
1623 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1624 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1625 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1626 memcpy(&arg4, plasma_ptr, sizeof(arg4)); plasma_ptr += sizeof(arg4); \
1627 memcpy(&arg5, plasma_ptr, sizeof(arg5)); plasma_ptr += sizeof(arg5); \
1628 memcpy(&arg6, plasma_ptr, sizeof(arg6)); plasma_ptr += sizeof(arg6); \
1629 memcpy(&arg7, plasma_ptr, sizeof(arg7)); plasma_ptr += sizeof(arg7); \
1632 #define plasma_unpack_args_8( \
1642 unsigned char *plasma_ptr = plasma->args_buff; \
1643 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1644 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1645 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1646 memcpy(&arg4, plasma_ptr, sizeof(arg4)); plasma_ptr += sizeof(arg4); \
1647 memcpy(&arg5, plasma_ptr, sizeof(arg5)); plasma_ptr += sizeof(arg5); \
1648 memcpy(&arg6, plasma_ptr, sizeof(arg6)); plasma_ptr += sizeof(arg6); \
1649 memcpy(&arg7, plasma_ptr, sizeof(arg7)); plasma_ptr += sizeof(arg7); \
1650 memcpy(&arg8, plasma_ptr, sizeof(arg8)); plasma_ptr += sizeof(arg8); \
1653 #define plasma_unpack_args_9( \
1664 unsigned char *plasma_ptr = plasma->args_buff; \
1665 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1666 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1667 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1668 memcpy(&arg4, plasma_ptr, sizeof(arg4)); plasma_ptr += sizeof(arg4); \
1669 memcpy(&arg5, plasma_ptr, sizeof(arg5)); plasma_ptr += sizeof(arg5); \
1670 memcpy(&arg6, plasma_ptr, sizeof(arg6)); plasma_ptr += sizeof(arg6); \
1671 memcpy(&arg7, plasma_ptr, sizeof(arg7)); plasma_ptr += sizeof(arg7); \
1672 memcpy(&arg8, plasma_ptr, sizeof(arg8)); plasma_ptr += sizeof(arg8); \
1673 memcpy(&arg9, plasma_ptr, sizeof(arg9)); plasma_ptr += sizeof(arg9); \
1676 #define plasma_unpack_args_10( \
1688 unsigned char *plasma_ptr = plasma->args_buff; \
1689 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1690 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1691 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1692 memcpy(&arg4, plasma_ptr, sizeof(arg4)); plasma_ptr += sizeof(arg4); \
1693 memcpy(&arg5, plasma_ptr, sizeof(arg5)); plasma_ptr += sizeof(arg5); \
1694 memcpy(&arg6, plasma_ptr, sizeof(arg6)); plasma_ptr += sizeof(arg6); \
1695 memcpy(&arg7, plasma_ptr, sizeof(arg7)); plasma_ptr += sizeof(arg7); \
1696 memcpy(&arg8, plasma_ptr, sizeof(arg8)); plasma_ptr += sizeof(arg8); \
1697 memcpy(&arg9, plasma_ptr, sizeof(arg9)); plasma_ptr += sizeof(arg9); \
1698 memcpy(&arg10, plasma_ptr, sizeof(arg10)); plasma_ptr += sizeof(arg10); \
1701 #define plasma_unpack_args_11( \
1714 unsigned char *plasma_ptr = plasma->args_buff; \
1715 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1716 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1717 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1718 memcpy(&arg4, plasma_ptr, sizeof(arg4)); plasma_ptr += sizeof(arg4); \
1719 memcpy(&arg5, plasma_ptr, sizeof(arg5)); plasma_ptr += sizeof(arg5); \
1720 memcpy(&arg6, plasma_ptr, sizeof(arg6)); plasma_ptr += sizeof(arg6); \
1721 memcpy(&arg7, plasma_ptr, sizeof(arg7)); plasma_ptr += sizeof(arg7); \
1722 memcpy(&arg8, plasma_ptr, sizeof(arg8)); plasma_ptr += sizeof(arg8); \
1723 memcpy(&arg9, plasma_ptr, sizeof(arg9)); plasma_ptr += sizeof(arg9); \
1724 memcpy(&arg10, plasma_ptr, sizeof(arg10)); plasma_ptr += sizeof(arg10); \
1725 memcpy(&arg11, plasma_ptr, sizeof(arg11)); plasma_ptr += sizeof(arg11); \
1729 #define plasma_unpack_args_12( \
1743 unsigned char *plasma_ptr = plasma->args_buff; \
1744 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1745 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1746 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1747 memcpy(&arg4, plasma_ptr, sizeof(arg4)); plasma_ptr += sizeof(arg4); \
1748 memcpy(&arg5, plasma_ptr, sizeof(arg5)); plasma_ptr += sizeof(arg5); \
1749 memcpy(&arg6, plasma_ptr, sizeof(arg6)); plasma_ptr += sizeof(arg6); \
1750 memcpy(&arg7, plasma_ptr, sizeof(arg7)); plasma_ptr += sizeof(arg7); \
1751 memcpy(&arg8, plasma_ptr, sizeof(arg8)); plasma_ptr += sizeof(arg8); \
1752 memcpy(&arg9, plasma_ptr, sizeof(arg9)); plasma_ptr += sizeof(arg9); \
1753 memcpy(&arg10, plasma_ptr, sizeof(arg10)); plasma_ptr += sizeof(arg10); \
1754 memcpy(&arg11, plasma_ptr, sizeof(arg11)); plasma_ptr += sizeof(arg11); \
1755 memcpy(&arg12, plasma_ptr, sizeof(arg12)); plasma_ptr += sizeof(arg12); \
1758 #define plasma_unpack_args_13( \
1773 unsigned char *plasma_ptr = plasma->args_buff; \
1774 memcpy(&arg1, plasma_ptr, sizeof(arg1)); plasma_ptr += sizeof(arg1); \
1775 memcpy(&arg2, plasma_ptr, sizeof(arg2)); plasma_ptr += sizeof(arg2); \
1776 memcpy(&arg3, plasma_ptr, sizeof(arg3)); plasma_ptr += sizeof(arg3); \
1777 memcpy(&arg4, plasma_ptr, sizeof(arg4)); plasma_ptr += sizeof(arg4); \
1778 memcpy(&arg5, plasma_ptr, sizeof(arg5)); plasma_ptr += sizeof(arg5); \
1779 memcpy(&arg6, plasma_ptr, sizeof(arg6)); plasma_ptr += sizeof(arg6); \
1780 memcpy(&arg7, plasma_ptr, sizeof(arg7)); plasma_ptr += sizeof(arg7); \
1781 memcpy(&arg8, plasma_ptr, sizeof(arg8)); plasma_ptr += sizeof(arg8); \
1782 memcpy(&arg9, plasma_ptr, sizeof(arg9)); plasma_ptr += sizeof(arg9); \
1783 memcpy(&arg10, plasma_ptr, sizeof(arg10)); plasma_ptr += sizeof(arg10); \
1784 memcpy(&arg11, plasma_ptr, sizeof(arg11)); plasma_ptr += sizeof(arg11); \
1785 memcpy(&arg12, plasma_ptr, sizeof(arg12)); plasma_ptr += sizeof(arg12); \
1786 memcpy(&arg13, plasma_ptr, sizeof(arg13)); plasma_ptr += sizeof(arg13); \