libxmp/libxmpf in Omni Compiler
1.3.4
|
|
#define | _XMP_SM_GTOL_BLOCK(_i, _m, _w) (((_i) - (_m)) % (_w)) |
|
#define | _XMP_SM_GTOL_CYCLIC(_i, _m, _P) (((_i) - (_m)) / (_P)) |
|
#define | _XMP_SM_GTOL_BLOCK_CYCLIC(_b, _i, _m, _P) (((((_i) - (_m)) / (((_P) * (_b)))) * (_b)) + (((_i) - (_m)) % (_b))) |
|
#define | _XMP_SM_GTOL_GBLOCK(_i, _g) ((_i) - (_g)) |
|
#define | _XMP_SM_NORM_SCHED_PARAMS(ser_init, ser_cond, ser_step, reverse_iter) |
|
#define | _XMP_SM_FINALIZE_ITER(par_init, par_cond, par_step, reverse_iter) |
|
|
int | _XMP_sched_loop_template_width_1 (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, int template_lower, int template_upper, int template_stride) |
|
int | _XMP_sched_loop_template_width_N (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, int template_lower, int template_upper, int template_stride, int width, int template_ser_lower, int template_ser_upper) |
|
void | _XMP_sched_loop_template_DUPLICATION (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index) |
|
void | _XMP_sched_loop_template_BLOCK (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index) |
|
void | _XMP_sched_loop_template_CYCLIC (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index) |
|
void | _XMP_sched_loop_template_BLOCK_CYCLIC (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index) |
|
void | _XMP_sched_loop_template_GBLOCK (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index) |
|
void | xmpc_loop_sched (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *t_desc, int t_idx, int expand_type, int lwidth, int uwidth, int unbound_flag) |
|
void | _XMP_sched_loop_nodes (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_nodes_t *nodes, int nodes_index) |
|
◆ _XMP_SM_FINALIZE_ITER
#define _XMP_SM_FINALIZE_ITER |
( |
|
par_init, |
|
|
|
par_cond, |
|
|
|
par_step, |
|
|
|
reverse_iter |
|
) |
| |
Value:{ \
if (reverse_iter) { \
int temp = *par_init; \
*par_init = *par_cond; \
*par_cond = temp - 1; \
*par_step = -(*par_step); \
} else { \
(*par_cond)++; \
} \
}
◆ _XMP_SM_GTOL_BLOCK
#define _XMP_SM_GTOL_BLOCK |
( |
|
_i, |
|
|
|
_m, |
|
|
|
_w |
|
) |
| (((_i) - (_m)) % (_w)) |
◆ _XMP_SM_GTOL_BLOCK_CYCLIC
#define _XMP_SM_GTOL_BLOCK_CYCLIC |
( |
|
_b, |
|
|
|
_i, |
|
|
|
_m, |
|
|
|
_P |
|
) |
| (((((_i) - (_m)) / (((_P) * (_b)))) * (_b)) + (((_i) - (_m)) % (_b))) |
◆ _XMP_SM_GTOL_CYCLIC
#define _XMP_SM_GTOL_CYCLIC |
( |
|
_i, |
|
|
|
_m, |
|
|
|
_P |
|
) |
| (((_i) - (_m)) / (_P)) |
◆ _XMP_SM_GTOL_GBLOCK
#define _XMP_SM_GTOL_GBLOCK |
( |
|
_i, |
|
|
|
_g |
|
) |
| ((_i) - (_g)) |
◆ _XMP_SM_NORM_SCHED_PARAMS
#define _XMP_SM_NORM_SCHED_PARAMS |
( |
|
ser_init, |
|
|
|
ser_cond, |
|
|
|
ser_step, |
|
|
|
reverse_iter |
|
) |
| |
Value:{ \
if (ser_step == 0)
_XMP_fatal("loop step is 0"); \
if (ser_step == 1) ser_cond--; \
else { \
if (ser_step > 0){ \
ser_cond--; \
ser_cond -= ((ser_cond - ser_init) % ser_step); \
} \
else { \
\
ser_step = -ser_step; \
ser_cond++; \
ser_cond += ((ser_init - ser_cond) % ser_step); \
int swap_temp = ser_init; \
ser_init = ser_cond; \
ser_cond = swap_temp; \
} \
} \
}
◆ _XMP_sched_loop_nodes()
void _XMP_sched_loop_nodes |
( |
int |
ser_init, |
|
|
int |
ser_cond, |
|
|
int |
ser_step, |
|
|
int * |
par_init, |
|
|
int * |
par_cond, |
|
|
int * |
par_step, |
|
|
_XMP_nodes_t * |
nodes, |
|
|
int |
nodes_index |
|
) |
| |
545 int rank1O = ((nodes->
info[nodes_index].
rank) + 1);
546 if ((rank1O < ser_init) || (rank1O > ser_cond)) {
553 if (((rank1O - ser_init) % ser_step) == 0) {
555 *par_cond = rank1O + 1;
556 *par_step = ser_step;
◆ _XMP_sched_loop_template_BLOCK()
void _XMP_sched_loop_template_BLOCK |
( |
int |
ser_init, |
|
|
int |
ser_cond, |
|
|
int |
ser_step, |
|
|
int * |
par_init, |
|
|
int * |
par_cond, |
|
|
int * |
par_step, |
|
|
_XMP_template_t * |
template, |
|
|
int |
template_index |
|
) |
| |
209 int template_ser_lower = template_info->
ser_lower;
212 int template_lower = template_chunk->
par_lower;
213 int template_upper = template_chunk->
par_upper;
214 int template_stride = template_chunk->
par_stride;
222 template_lower, template_upper, template_stride)) {
225 *par_step = ser_step;
◆ _XMP_sched_loop_template_BLOCK_CYCLIC()
void _XMP_sched_loop_template_BLOCK_CYCLIC |
( |
int |
ser_init, |
|
|
int |
ser_cond, |
|
|
int |
ser_step, |
|
|
int * |
par_init, |
|
|
int * |
par_cond, |
|
|
int * |
par_step, |
|
|
_XMP_template_t * |
template, |
|
|
int |
template_index |
|
) |
| |
348 int template_ser_lower = template_info->
ser_lower;
349 int template_ser_upper = template_info->
ser_upper;
353 int template_lower = template_chunk->
par_lower;
354 int template_upper = template_chunk->
par_upper;
355 int template_stride = template_chunk->
par_stride;
363 template_lower, template_upper, template_stride,
364 width, template_ser_lower, template_ser_upper)) {
◆ _XMP_sched_loop_template_CYCLIC()
void _XMP_sched_loop_template_CYCLIC |
( |
int |
ser_init, |
|
|
int |
ser_cond, |
|
|
int |
ser_step, |
|
|
int * |
par_init, |
|
|
int * |
par_cond, |
|
|
int * |
par_step, |
|
|
_XMP_template_t * |
template, |
|
|
int |
template_index |
|
) |
| |
307 int template_ser_lower = template_info->
ser_lower;
311 int template_lower = template_chunk->
par_lower;
312 int template_upper = template_chunk->
par_upper;
313 int template_stride = template_chunk->
par_stride;
320 template_lower, template_upper, template_stride)) {
◆ _XMP_sched_loop_template_DUPLICATION()
void _XMP_sched_loop_template_DUPLICATION |
( |
int |
ser_init, |
|
|
int |
ser_cond, |
|
|
int |
ser_step, |
|
|
int * |
par_init, |
|
|
int * |
par_cond, |
|
|
int * |
par_step, |
|
|
_XMP_template_t * |
template, |
|
|
int |
template_index |
|
) |
| |
176 int template_lower = template_chunk->
par_lower;
177 int template_upper = template_chunk->
par_upper;
178 int template_stride = template_chunk->
par_stride;
185 template_lower, template_upper, template_stride)) {
◆ _XMP_sched_loop_template_GBLOCK()
void _XMP_sched_loop_template_GBLOCK |
( |
int |
ser_init, |
|
|
int |
ser_cond, |
|
|
int |
ser_step, |
|
|
int * |
par_init, |
|
|
int * |
par_cond, |
|
|
int * |
par_step, |
|
|
_XMP_template_t * |
template, |
|
|
int |
template_index |
|
) |
| |
394 int template_lower = template_chunk->
par_lower;
395 int template_upper = template_chunk->
par_upper;
396 int template_stride = template_chunk->
par_stride;
404 template_lower, template_upper, template_stride)) {
408 *par_step = ser_step;
◆ _XMP_sched_loop_template_width_1()
int _XMP_sched_loop_template_width_1 |
( |
int |
ser_init, |
|
|
int |
ser_cond, |
|
|
int |
ser_step, |
|
|
int * |
par_init, |
|
|
int * |
par_cond, |
|
|
int * |
par_step, |
|
|
int |
template_lower, |
|
|
int |
template_upper, |
|
|
int |
template_stride |
|
) |
| |
56 int x, x_max =
_XMP_floori((template_upper - template_lower), template_stride);
59 x =
_XMP_ceili((ser_init - template_lower), template_stride);
61 *par_init = template_lower;
62 }
else if (x > x_max) {
65 *par_init = (x * template_stride) + template_lower;
69 x =
_XMP_floori((ser_cond - template_lower), template_stride);
72 }
else if (x > x_max) {
73 *par_cond = template_upper;
75 *par_cond = (x * template_stride) + template_lower;
79 *par_step = template_stride;
81 if ((template_upper < ser_init) || (ser_cond < template_lower)) {
86 for (
int i = template_lower; i <= template_upper; i += template_stride) {
89 }
else if (((i - ser_init) % ser_step) == 0) {
98 for (
int i = template_upper; i >= template_lower; i -= template_stride) {
101 }
else if (((i - ser_init) % ser_step) == 0) {
110 *par_step =
_XMP_lcm(ser_step, template_stride);
◆ _XMP_sched_loop_template_width_N()
int _XMP_sched_loop_template_width_N |
( |
int |
ser_init, |
|
|
int |
ser_cond, |
|
|
int |
ser_step, |
|
|
int * |
par_init, |
|
|
int * |
par_cond, |
|
|
int * |
par_step, |
|
|
int |
template_lower, |
|
|
int |
template_upper, |
|
|
int |
template_stride, |
|
|
int |
width, |
|
|
int |
template_ser_lower, |
|
|
int |
template_ser_upper |
|
) |
| |
120 int si = ((ser_init - template_ser_lower) / width) + template_ser_lower;
121 int sc = ((ser_cond - template_ser_lower) / width) + template_ser_lower;
122 int tl = ((template_lower - template_ser_lower) / width) + template_ser_lower;
123 int tu = ((template_upper - template_ser_lower) / width) + template_ser_lower;
124 int ts = template_stride / width;
128 _XMP_fatal(
"loop step is not 1, -1: unsupported case");
133 int par_init_temp = ((*par_init - template_ser_lower) * width) + template_ser_lower;
134 if (par_init_temp < ser_init) {
135 *par_init = ser_init;
137 *par_init = par_init_temp;
141 int par_cond_temp = ((*par_cond - template_ser_lower) * width) + template_ser_lower + width - 1;
142 if (par_cond_temp > template_ser_upper) {
143 par_cond_temp = template_ser_upper;
146 if (par_cond_temp > ser_cond) {
147 *par_cond = ser_cond;
149 *par_cond = par_cond_temp;
◆ xmpc_loop_sched()
void xmpc_loop_sched |
( |
int |
ser_init, |
|
|
int |
ser_cond, |
|
|
int |
ser_step, |
|
|
int * |
par_init, |
|
|
int * |
par_cond, |
|
|
int * |
par_step, |
|
|
_XMP_template_t * |
t_desc, |
|
|
int |
t_idx, |
|
|
int |
expand_type, |
|
|
int |
lwidth, |
|
|
int |
uwidth, |
|
|
int |
unbound_flag |
|
) |
| |
434 par_init, par_cond, par_step,
440 par_init, par_cond, par_step,
446 par_init, par_cond, par_step,
452 par_init, par_cond, par_step,
458 par_init, par_cond, par_step,
463 _XMP_fatal(
"xmpc_loop_sched: unknown chunk dist_manner");
478 if ((*par_init) < (*par_cond)){
479 (*par_init) -= lwidth;
480 (*par_cond) += uwidth;
486 if ((*par_init) < (*par_cond)){
489 (*par_init) -= lwidth;
490 (*par_cond) = (*par_init) + lwidth;
492 else if (lwidth < 0){
493 (*par_cond) = (*par_init) - lwidth;
496 else if (uwidth > 0){
497 (*par_cond) += uwidth;
498 (*par_init) = (*par_cond) - uwidth;
500 else if (uwidth < 0){
501 (*par_init) = (*par_cond) + uwidth;
509 if (unbound_flag == 0){
512 _XMP_L2G(*par_init, &glb, t_desc, t_idx);
514 (*par_init) += lwidth;
518 _XMP_L2G(*par_cond, &gub, t_desc, t_idx);
520 (*par_cond) -= uwidth;
long long par_upper
Definition: xmp_data_struct.h:81
#define _XMP_SM_GTOL_BLOCK_CYCLIC(_b, _i, _m, _P)
Definition: xmp_loop.c:11
_XMP_nodes_info_t info[1]
Definition: xmp_data_struct.h:60
void _XMP_L2G(int local_idx, long long int *global_idx, _XMP_template_t *template, int template_index)
Definition: xmp_index.c:4
#define _XMP_N_DIST_BLOCK
Definition: xmp_constant.h:29
long long ser_lower
Definition: xmp_data_struct.h:72
int is_member
Definition: xmp_data_struct.h:46
#define _XMP_SM_FINALIZE_ITER(par_init, par_cond, par_step, reverse_iter)
Definition: xmp_loop.c:40
_XMP_template_chunk_t * chunk
Definition: xmp_data_struct.h:112
#define _XMP_SM_GTOL_GBLOCK(_i, _g)
Definition: xmp_loop.c:14
#define _XMP_SM_GTOL_CYCLIC(_i, _m, _P)
Definition: xmp_loop.c:8
void _XMP_sched_loop_template_BLOCK_CYCLIC(int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index)
Definition: xmp_loop.c:335
long long par_lower
Definition: xmp_data_struct.h:80
#define _XMP_SM_NORM_SCHED_PARAMS(ser_init, ser_cond, ser_step, reverse_iter)
Definition: xmp_loop.c:17
int _XMP_sched_loop_template_width_1(int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, int template_lower, int template_upper, int template_stride)
Definition: xmp_loop.c:53
_XMP_nodes_info_t * onto_nodes_info
Definition: xmp_data_struct.h:94
Definition: xmp_data_struct.h:70
#define _XMP_LOOP_EXPAND
Definition: xmp_constant.h:74
int _XMP_sched_loop_template_width_N(int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, int template_lower, int template_upper, int template_stride, int width, int template_ser_lower, int template_ser_upper)
Definition: xmp_loop.c:116
unsigned long long par_chunk_width
Definition: xmp_data_struct.h:86
#define _XMP_N_INT_FALSE
Definition: xmp_constant.h:5
#define _XMP_N_DIST_CYCLIC
Definition: xmp_constant.h:30
void _XMP_sched_loop_template_CYCLIC(int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index)
Definition: xmp_loop.c:294
Definition: xmp_data_struct.h:78
long long ser_upper
Definition: xmp_data_struct.h:73
#define _XMP_N_DIST_BLOCK_CYCLIC
Definition: xmp_constant.h:31
#define _XMP_N_DIST_GBLOCK
Definition: xmp_constant.h:32
#define _XMP_N_DIST_DUPLICATION
Definition: xmp_constant.h:28
#define _XMP_SM_GTOL_BLOCK(_i, _m, _w)
Definition: xmp_loop.c:5
int par_stride
Definition: xmp_data_struct.h:85
int rank
Definition: xmp_data_struct.h:35
int dist_manner
Definition: xmp_data_struct.h:87
#define _XMP_ASSERT(_flag)
Definition: xmp_internal.h:34
#define _XMP_LOOP_NONE
Definition: xmp_constant.h:77
void _XMP_sched_loop_template_GBLOCK(int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index)
Definition: xmp_loop.c:379
void _XMP_sched_loop_template_DUPLICATION(int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index)
Definition: xmp_loop.c:163
int _XMP_lcm(int a, int b)
Definition: xmp_math_function.c:66
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42
int _XMP_floori(int a, int b)
Definition: xmp_math_function.c:43
unsigned long long par_width
Definition: xmp_data_struct.h:82
_Bool is_distributed
Definition: xmp_data_struct.h:105
void _XMP_sched_loop_template_BLOCK(int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index)
Definition: xmp_loop.c:196
#define _XMP_N_INT_TRUE
Definition: xmp_constant.h:4
long long * mapping_array
Definition: xmp_data_struct.h:88
#define _XMP_LOOP_MARGIN
Definition: xmp_constant.h:75
_Bool is_owner
Definition: xmp_data_struct.h:106
int _XMP_ceili(int a, int b)
Definition: xmp_math_function.c:29