| line |
true |
false |
branch |
|
95
|
0 |
71822 |
PDLDEBUG_f(printf("pdl__ensure_trans %p what=", trans); pdl_dump_flags_fixspace(what, 0, PDL_FLAGS_PDL)); |
|
96
|
0 |
71822 |
PDL_TR_CHKMAGIC(trans); |
|
|
0 |
0 |
PDL_TR_CHKMAGIC(trans); |
|
98
|
3549 |
68273 |
if (trans->flags & PDL_ITRANS_ISAFFINE) { |
|
99
|
3549 |
0 |
if (!(vtable->nparents == 1 && vtable->npdls == 2)) |
|
|
0 |
3549 |
if (!(vtable->nparents == 1 && vtable->npdls == 2)) |
|
103
|
33661 |
34612 |
PDL_Indx j, flag=what, par_pvaf=0, j_end = inputs_only ? vtable->nparents : vtable->npdls; |
|
104
|
113384 |
68273 |
for (j=0; j
|
|
105
|
43237 |
70147 |
if (vtable->par_flags[j] & PDL_PARAM_ISPHYS) |
|
106
|
0 |
43237 |
PDL_RETERROR(PDL_err, pdl__make_physical_recprotect(trans->pdls[j], recurse_count+1)); |
|
108
|
0 |
70147 |
PDL_RETERROR(PDL_err, pdl__make_physvaffine_recprotect(trans->pdls[j], recurse_count+1)); |
|
109
|
14280 |
55867 |
if (PDL_VAFFOK(trans->pdls[j])) par_pvaf++; |
|
112
|
69500 |
68273 |
for (j=vtable->nparents; jnpdls; j++) |
|
114
|
0 |
68273 |
PDLDEBUG_f(printf("pdl__ensure_trans after accum, par_pvaf=%"IND_FLAG" flag=", par_pvaf); pdl_dump_flags_fixspace(flag, 0, PDL_FLAGS_PDL)); |
|
115
|
55159 |
13114 |
if (par_pvaf || flag & PDL_PARENTDIMSCHANGED) |
|
|
25348 |
29811 |
if (par_pvaf || flag & PDL_PARENTDIMSCHANGED) |
|
116
|
12225 |
26237 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
6630 |
12582 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
6571 |
59 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
6558 |
13 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
19212 |
12225 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
0 |
12225 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
6336 |
32126 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
0 |
6336 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
0 |
0 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
0 |
0 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
0 |
6336 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
12225 |
26237 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
32 |
38430 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
1 |
19452 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
1 |
0 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
19453 |
38430 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
1 |
38429 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
1 |
0 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
0 |
39646 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
|
39646 |
38429 |
REDODIMS(PDL_RETERROR, trans); /* CORE21 change to make_physdims_recetc */ |
|
117
|
59863 |
8377 |
if (flag & PDL_ANYCHANGED) |
|
118
|
0 |
59863 |
READDATA(trans); |
|
|
55104 |
5976 |
READDATA(trans); |
|
|
47193 |
7911 |
READDATA(trans); |
|
|
0 |
47193 |
READDATA(trans); |
|
|
61080 |
59863 |
READDATA(trans); |
|
|
59863 |
59863 |
READDATA(trans); |
|
|
61080 |
0 |
READDATA(trans); |
|
|
4655 |
56425 |
READDATA(trans); |
|
|
61080 |
59863 |
READDATA(trans); |
|
|
0 |
59863 |
READDATA(trans); |
|
|
0 |
0 |
READDATA(trans); |
|
|
59863 |
0 |
READDATA(trans); |
|
|
9 |
59854 |
READDATA(trans); |
|
|
0 |
61080 |
READDATA(trans); |
|
|
61080 |
0 |
READDATA(trans); |
|
|
236 |
60844 |
READDATA(trans); |
|
|
61080 |
59863 |
READDATA(trans); |
|
123
|
0 |
0 |
PDLDEBUG_f(printf("pdl_null\n")); |
|
128
|
0 |
8584 |
PDLDEBUG_f(printf("pdl_scalar type=%d val=", anyval.type); pdl_dump_anyval(anyval); printf("\n");); |
|
130
|
0 |
8584 |
if (!it) return it; |
|
135
|
0 |
8584 |
if (PDL_err.error) { pdl_destroy(it); return NULL; } |
|
144
|
0 |
13975 |
PDL_RECURSE_CHECK(recurse_count); |
|
145
|
0 |
13975 |
PDLDEBUG_f(printf("pdl_get_convertedpdl switch_sense=%d\n", (int)switch_sense)); |
|
146
|
0 |
13975 |
if (old->datatype == type) { *retval = old; return PDL_err; } |
|
149
|
0 |
13975 |
if (!it) return pdl_make_error_simple(PDL_EFATAL, "Out of Memory\n"); |
|
150
|
22 |
13953 |
if (switch_sense) { |
|
152
|
0 |
22 |
if (PDL_err.error) { pdl_destroy(it); return PDL_err; } |
|
154
|
22 |
0 |
if (!PDL_err.error && switch_sense > 1 && old->data) { /* NULL data = unallocated "zeroes" */ |
|
|
12 |
10 |
if (!PDL_err.error && switch_sense > 1 && old->data) { /* NULL data = unallocated "zeroes" */ |
|
|
12 |
0 |
if (!PDL_err.error && switch_sense > 1 && old->data) { /* NULL data = unallocated "zeroes" */ |
|
155
|
0 |
12 |
PDLDEBUG_f(printf("pdl_get_convertedpdl back-pump because inplace\n")); |
|
157
|
12 |
0 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
0 |
12 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
12 |
12 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
12 |
0 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
0 |
12 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
12 |
12 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
0 |
12 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
0 |
0 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
12 |
0 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
0 |
12 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
0 |
12 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
12 |
0 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
0 |
12 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
|
12 |
12 |
if (!PDL_err.error) WRITEDATA(old->trans_parent); |
|
161
|
0 |
13975 |
if (PDL_err.error) { pdl_destroy(it); return PDL_err; } |
|
162
|
5 |
13970 |
if (was_flowing) |
|
170
|
343 |
0 |
return PDL_err.error ? NULL : retval; |
|
175
|
0 |
93393 |
PDLDEBUG_f(printf("pdl_allocdata %p, %"IND_FLAG", %d\n",it, it->nvals, |
|
177
|
0 |
93393 |
if (it->nvals < 0) |
|
181
|
14982 |
78411 |
if (ncurr == nbytes) |
|
183
|
1 |
78410 |
if (it->state & PDL_DONTTOUCHDATA) |
|
187
|
78405 |
5 |
if (!was_useheap && !will_useheap) { |
|
|
65458 |
12947 |
if (!was_useheap && !will_useheap) { |
|
189
|
4 |
12948 |
} else if (!will_useheap) { |
|
197
|
12947 |
1 |
if (it->datasv == NULL) |
|
199
|
12948 |
0 |
(void)SvGROW((SV*)it->datasv, nbytes); |
|
|
12948 |
0 |
(void)SvGROW((SV*)it->datasv, nbytes); |
|
201
|
30 |
12918 |
if (it->data && !was_useheap) |
|
|
29 |
1 |
if (it->data && !was_useheap) |
|
205
|
78385 |
25 |
if (nbytes > ncurr) memset(it->data + ncurr, 0, nbytes - ncurr); |
|
208
|
0 |
78410 |
PDLDEBUG_f(pdl_dump(it)); |
|
214
|
0 |
96930 |
if (!it) return it; |
|
235
|
0 |
96930 |
PDLDEBUG_f(printf("pdl_pdlnew %p (size=%zu)\n",it,sizeof(pdl))); |
|
241
|
21085 |
13 |
if (it->vafftrans && it->vafftrans->incs) |
|
|
21085 |
0 |
if (it->vafftrans && it->vafftrans->incs) |
|
243
|
21085 |
13 |
if (it->vafftrans) |
|
252
|
21085 |
2 |
if (!it->vafftrans) { |
|
254
|
0 |
21085 |
if (!it->vafftrans) return pdl_make_error_simple(PDL_EFATAL, "Out of Memory\n"); |
|
258
|
2 |
21085 |
if (!it->vafftrans->incs || it->vafftrans->ndims < it->ndims ) { |
|
|
2 |
0 |
if (!it->vafftrans->incs || it->vafftrans->ndims < it->ndims ) { |
|
259
|
2 |
21085 |
if (it->vafftrans->incs) free(it->vafftrans->incs); |
|
262
|
0 |
21087 |
if (!it->vafftrans->incs) return pdl_make_error_simple(PDL_EFATAL, "Out of Memory\n"); |
|
271
|
0 |
26965 |
PDLDEBUG_f(printf("pdl_vafftrans_remove: %p, this_one=%d\n", it, (int)this_one)); |
|
273
|
161790 |
26965 |
for (i = 0; i < it->ntrans_children_allocated; i++) { |
|
275
|
2394 |
159396 |
if (!t || !(t->flags & PDL_ITRANS_ISAFFINE)) continue; |
|
|
2368 |
26 |
if (!t || !(t->flags & PDL_ITRANS_ISAFFINE)) continue; |
|
276
|
26 |
26 |
for (j=t->vtable->nparents; jvtable->npdls; j++) |
|
279
|
21098 |
5867 |
if (this_one) pdl_vafftrans_free(it); |
|
286
|
0 |
96868 |
PDLDEBUG_f(printf("pdl__free %p\n",it)); |
|
287
|
0 |
96868 |
PDL_CHKMAGIC(it); |
|
|
0 |
0 |
PDL_CHKMAGIC(it); |
|
289
|
65 |
96803 |
if (pdl__ismagic(it)) |
|
290
|
0 |
65 |
PDLDEBUG_f(printf("%p is still magic\n",it);pdl__print_magic(it)); |
|
292
|
5 |
96863 |
if (it->dims != it->def_dims) free(it->dims); |
|
293
|
5 |
96863 |
if (it->dimincs != it->def_dimincs) free(it->dimincs); |
|
294
|
0 |
96868 |
if (it->broadcastids != it->def_broadcastids) free(it->broadcastids); |
|
295
|
49 |
96819 |
if (it->trans_children != it->def_trans_children) free(it->trans_children); |
|
296
|
0 |
96868 |
if (it->vafftrans) { |
|
300
|
65 |
96803 |
if (PDL_ISMAGIC(it)) { |
|
304
|
15043 |
81825 |
if (it->datasv) { |
|
305
|
0 |
15043 |
PDLDEBUG_f(printf("SvREFCNT_dec datasv=%p\n",it->datasv)); |
|
309
|
3745 |
93123 |
if (it->hdrsv) { |
|
310
|
0 |
3745 |
PDLDEBUG_f(printf("SvREFCNT_dec hdrsv=%p\n",it->hdrsv)); |
|
314
|
0 |
96868 |
PDLDEBUG_f(printf("pdl__free end %p\n",it)); |
|
324
|
0 |
91656 |
PDLDEBUG_f(printf("pdl__remove_pdl_as_trans_input(%s=%p, pdl=%p, param_ind=%td): \n", |
|
327
|
0 |
91656 |
if (it->trans_children[trans_children_index] != trans) { |
|
335
|
6423 |
85233 |
if (trans_children_index < it->first_trans_child_available) |
|
343
|
0 |
83885 |
PDLDEBUG_f(printf("pdl__remove_pdl_as_trans_output from %p (%s=%p): %"IND_FLAG"\n", |
|
346
|
5980 |
77905 |
if (it->trans_parent != trans) return; /* only do rest if trans is parent */ |
|
348
|
0 |
77905 |
PDLDEBUG_f(printf("pdl__remove_pdl_as_trans_output turning off MYDIMS_TRANS and ANYCHANGED, was: "); pdl_dump_flags_fixspace(it->state, 0, PDL_FLAGS_PDL)); |
|
355
|
0 |
82663 |
PDLDEBUG_f(printf("pdl_trans_finaldestroy %p\n", trans)); |
|
356
|
23095 |
59568 |
FREETRANS(trans, 1); |
|
|
0 |
23095 |
FREETRANS(trans, 1); |
|
|
0 |
23095 |
FREETRANS(trans, 1); |
|
357
|
33707 |
48956 |
if (trans->vtable->flags & PDL_TRANS_DO_BROADCAST) |
|
360
|
0 |
82663 |
PDLDEBUG_f(printf("call free\n")); |
|
361
|
51032 |
31631 |
if (trans->params) free(trans->params); |
|
372
|
0 |
82658 |
PDL_TR_CHKMAGIC(trans); |
|
|
0 |
0 |
PDL_TR_CHKMAGIC(trans); |
|
375
|
0 |
82658 |
if (!vtable) |
|
378
|
0 |
82658 |
PDLDEBUG_f(printf("pdl_destroytransform %s=%p (ensure=%d ismutual=%d)\n", |
|
380
|
11926 |
70732 |
if (ensure) |
|
381
|
11926 |
0 |
PDL_ACCUMERROR(PDL_err, pdl__ensure_trans(trans, ismutual ? 0 : PDL_PARENTDIMSCHANGED, 0, recurse_count+1)); |
|
|
0 |
11926 |
PDL_ACCUMERROR(PDL_err, pdl__ensure_trans(trans, ismutual ? 0 : PDL_PARENTDIMSCHANGED, 0, recurse_count+1)); |
|
384
|
91656 |
82658 |
for (j=0; jnparents; j++) { |
|
386
|
0 |
91656 |
if (!parent) continue; |
|
387
|
0 |
91656 |
PDL_CHKMAGIC(parent); |
|
|
0 |
0 |
PDL_CHKMAGIC(parent); |
|
389
|
85631 |
6025 |
if (!(parent->state & PDL_DESTROYING) && !parent->sv) { |
|
|
35363 |
50268 |
if (!(parent->state & PDL_DESTROYING) && !parent->sv) { |
|
394
|
83885 |
82658 |
for (j=vtable->nparents; jnpdls; j++) { |
|
396
|
0 |
83885 |
PDL_CHKMAGIC(child); |
|
|
0 |
0 |
PDL_CHKMAGIC(child); |
|
398
|
56423 |
27462 |
if (ismutual && child->vafftrans) pdl_vafftrans_remove(child, 1); |
|
|
21072 |
35351 |
if (ismutual && child->vafftrans) pdl_vafftrans_remove(child, 1); |
|
399
|
39381 |
44504 |
if ((!(child->state & PDL_DESTROYING) && !child->sv) || |
|
|
33369 |
6012 |
if ((!(child->state & PDL_DESTROYING) && !child->sv) || |
|
400
|
0 |
77873 |
(vtable->par_flags[j] & PDL_PARAM_ISTEMP)) { |
|
405
|
0 |
82658 |
PDL_ACCUMERROR(PDL_err, pdl_trans_finaldestroy(trans)); |
|
406
|
41375 |
82658 |
for (j=0; j
|
|
408
|
0 |
41375 |
PDL_ACCUMERROR(PDL_err, pdl__destroy_recprotect(destbuffer[j], recurse_count+1)); |
|
410
|
0 |
82658 |
PDLDEBUG_f(printf("pdl_destroytransform leaving %p\n", trans)); |
|
431
|
0 |
116457 |
PDL_CHKMAGIC(it); |
|
|
0 |
0 |
PDL_CHKMAGIC(it); |
|
432
|
0 |
116457 |
PDLDEBUG_f(printf("pdl_destroy: ");pdl_dump(it)); |
|
433
|
0 |
116457 |
if (it->state & PDL_DESTROYING) { |
|
434
|
0 |
0 |
PDLDEBUG_f(printf(" already destroying, returning\n")); |
|
439
|
75035 |
41422 |
if (it->sv) { |
|
446
|
700076 |
116457 |
for (i = 0; i < it->ntrans_children_allocated; i++) { |
|
448
|
674385 |
25691 |
if (!curt) continue; |
|
449
|
0 |
25691 |
PDL_TR_CHKMAGIC(curt); |
|
|
0 |
0 |
PDL_TR_CHKMAGIC(curt); |
|
450
|
25691 |
0 |
if (curt->flags & PDL_ITRANS_DO_DATAFLOW_F) { |
|
453
|
12563 |
13128 |
if (curt->vtable->nparents > 1) nforw2++; |
|
455
|
25661 |
30 |
if (curt->flags & PDL_ITRANS_DO_DATAFLOW_B) { |
|
458
|
12533 |
13128 |
if (curt->vtable->npdls > 2) nback2++; |
|
460
|
7208 |
18483 |
if ((curt->flags & PDL_ITRANS_ISAFFINE) && !(curt->pdls[1]->state & PDL_ALLOCATED)) |
|
|
6992 |
216 |
if ((curt->flags & PDL_ITRANS_ISAFFINE) && !(curt->pdls[1]->state & PDL_ALLOCATED)) |
|
464
|
0 |
116457 |
PDLDEBUG_f(printf(" nba(%d, %d), nforw(%d, %d), tra(%p=%s), nafn(%d)\n", |
|
|
0 |
0 |
PDLDEBUG_f(printf(" nba(%d, %d), nforw(%d, %d), tra(%p=%s), nafn(%d)\n", |
|
466
|
12509 |
103948 |
if (nback2 > 0) { PDLDEBUG_f(printf(" soft_destroy: nback2=%d\n", nback2)); soft_destroy = 1; } |
|
|
0 |
12509 |
if (nback2 > 0) { PDLDEBUG_f(printf(" soft_destroy: nback2=%d\n", nback2)); soft_destroy = 1; } |
|
467
|
56 |
116401 |
if (nback > 1) { PDLDEBUG_f(printf(" soft_destroy: nback=%d\n", nback)); soft_destroy = 1; } |
|
|
0 |
56 |
if (nback > 1) { PDLDEBUG_f(printf(" soft_destroy: nback=%d\n", nback)); soft_destroy = 1; } |
|
468
|
57332 |
59125 |
if (it->trans_parent && nforw) { PDLDEBUG_f(printf(" soft_destroy: has parent and nforw=%d\n", nforw)); soft_destroy = 1; } |
|
|
12835 |
44497 |
if (it->trans_parent && nforw) { PDLDEBUG_f(printf(" soft_destroy: has parent and nforw=%d\n", nforw)); soft_destroy = 1; } |
|
|
0 |
12835 |
if (it->trans_parent && nforw) { PDLDEBUG_f(printf(" soft_destroy: has parent and nforw=%d\n", nforw)); soft_destroy = 1; } |
|
469
|
12539 |
103918 |
if (nforw2 > 0) { PDLDEBUG_f(printf(" soft_destroy: nforw2=%d\n", nforw2)); soft_destroy = 1; } |
|
|
0 |
12539 |
if (nforw2 > 0) { PDLDEBUG_f(printf(" soft_destroy: nforw2=%d\n", nforw2)); soft_destroy = 1; } |
|
475
|
6948 |
109509 |
if (nafn) { PDLDEBUG_f(printf(" soft_destroy: nafn=%d\n", nafn)); soft_destroy = 1; } |
|
|
0 |
6948 |
if (nafn) { PDLDEBUG_f(printf(" soft_destroy: nafn=%d\n", nafn)); soft_destroy = 1; } |
|
476
|
0 |
116457 |
if (pdl__magic_isundestroyable(it)) { |
|
477
|
0 |
0 |
PDLDEBUG_f(printf(" not destroying as magic %p\n", it)); |
|
480
|
19589 |
96868 |
if (soft_destroy) { |
|
484
|
582364 |
96868 |
for (i = 0; i < it->ntrans_children_allocated; i++) { |
|
486
|
576339 |
6025 |
if (!t) continue; |
|
487
|
0 |
6025 |
PDL_RETERROR(PDL_err, pdl_destroytransform(t, 1, recurse_count+1)); |
|
490
|
44497 |
52371 |
if (trans) |
|
492
|
0 |
44497 |
PDL_RETERROR(PDL_err, pdl_destroytransform(trans, |
|
495
|
0 |
96868 |
PDL_RETERROR(PDL_err, pdl__free(it)); |
|
496
|
0 |
96868 |
PDLDEBUG_f(printf("pdl_destroy end %p\n",it)); |
|
506
|
0 |
47 |
PDLDEBUG_f(printf("pdl_hard_copy (src=%p): ", src)); |
|
508
|
0 |
47 |
if (!it) return it; |
|
510
|
0 |
47 |
PDL_RETERROR2(PDL_err, pdl_affine_new(src, it, 0, src->dims, src->ndims, src->dimincs, src->ndims), pdl_destroy(it); return NULL;); |
|
511
|
0 |
47 |
PDLDEBUG_f(printf("pdl_hard_copy (src=%p): ", src);pdl_dump(it)); |
|
513
|
0 |
47 |
PDL_RETERROR2(PDL_err, pdl_sever(it), pdl_destroy(it); return NULL;); |
|
521
|
10586 |
82409 |
if (it->ndims < ndims) { /* Need to realloc for more */ |
|
522
|
0 |
10586 |
if (it->dims != it->def_dims) free(it->dims); |
|
523
|
0 |
10586 |
if (it->dimincs != it->def_dimincs) free(it->dimincs); |
|
524
|
5 |
10581 |
if (ndims>PDL_NDIMS) { /* Need to malloc */ |
|
525
|
0 |
5 |
if (!(it->dims = malloc(ndims*sizeof(*(it->dims))))) |
|
527
|
0 |
5 |
if (!(it->dimincs = malloc(ndims*sizeof(*(it->dimincs))))) { |
|
546
|
104826 |
56 |
if (n <= it->nbroadcastids) { |
|
552
|
0 |
56 |
if (n > PDL_NBROADCASTIDS) { |
|
554
|
0 |
0 |
if (!it->broadcastids) return pdl_make_error_simple(PDL_EFATAL, "Out of Memory\n"); |
|
559
|
0 |
56 |
if (it->broadcastids != olds) { |
|
560
|
0 |
0 |
for (i=0; i
|
|
|
0 |
0 |
for (i=0; i
|
|
563
|
0 |
56 |
if (olds != it->def_broadcastids) { free(olds); } |
|
564
|
57 |
56 |
for (i=nold; inbroadcastids; i++) { |
|
573
|
76774 |
101526 |
for (i=0; indims; i++) { |
|
576
|
94314 |
7212 |
if (it->nvals != inc) /* Need to realloc only if nvals changed */ |
|
584
|
0 |
17654 |
PDLDEBUG_f(printf("pdl_setdims %p: ", it);pdl_print_iarr(dims, ndims);printf("\n")); |
|
585
|
1 |
17653 |
if (it->trans_parent) |
|
591
|
11891 |
17653 |
for (i=0; i
|
|
592
|
561 |
17092 |
int what = (old_nvals == new_nvals) ? 0 : PDL_PARENTDATACHANGED; |
|
593
|
261 |
17392 |
if ((it->state & PDL_NOMYDIMS) || ndims != it->ndims) |
|
|
199 |
62 |
if ((it->state & PDL_NOMYDIMS) || ndims != it->ndims) |
|
596
|
88 |
47 |
for (i=0; i
|
|
597
|
15 |
73 |
if (dims[i] != it->dims[i]) { what |= PDL_PARENTDIMSCHANGED; break; } |
|
598
|
47 |
17606 |
if (!what) { PDLDEBUG_f(printf("pdl_setdims NOOP\n")); return PDL_err; } |
|
|
0 |
47 |
if (!what) { PDLDEBUG_f(printf("pdl_setdims NOOP\n")); return PDL_err; } |
|
599
|
0 |
17606 |
PDL_RETERROR(PDL_err, pdl_reallocdims(it,ndims)); |
|
600
|
11826 |
17606 |
for (i=0; idims[i] = dims[i]; |
|
602
|
0 |
17606 |
PDL_RETERROR(PDL_err, pdl_reallocbroadcastids(it,1)); |
|
605
|
0 |
17606 |
CHANGED(it,what,0); |
|
629
|
0 |
91663 |
PDLDEBUG_f(printf("pdl__add_pdl_as_trans_input add to %p trans=%s param_ind=%td\n", it, vtable->name, param_ind)); |
|
631
|
98188 |
7 |
for (trans_children_index = it->first_trans_child_available; trans_children_index < it->ntrans_children_allocated; trans_children_index++) |
|
632
|
91656 |
6532 |
if (!it->trans_children[trans_children_index]) break; |
|
633
|
7 |
91656 |
if (trans_children_index >= it->ntrans_children_allocated) { |
|
634
|
7 |
0 |
if (it->trans_children == it->def_trans_children) { |
|
638
|
0 |
7 |
if (!it->trans_children) return pdl_make_error_simple(PDL_EFATAL, "Out of Memory\n"); |
|
639
|
42 |
7 |
for (i = 0; i < PDL_NCHILDREN; i++) |
|
641
|
42 |
7 |
for (; i < it->ntrans_children_allocated; i++) |
|
647
|
0 |
0 |
if (!it->trans_children) return pdl_make_error_simple(PDL_EFATAL, "Out of Memory\n"); |
|
648
|
0 |
0 |
for (i = trans_children_index+1; i < it->ntrans_children_allocated; i++) |
|
652
|
6530 |
85133 |
if (trans_children_index > it->first_trans_child_available) |
|
663
|
45 |
0 |
if (howmany > oldval) { |
|
664
|
42 |
3 |
if (it->trans_children == it->def_trans_children) { |
|
668
|
0 |
42 |
if (!it->trans_children) return pdl_make_error_simple(PDL_EFATAL, "Out of Memory\n"); |
|
669
|
252 |
42 |
for (i = 0; i < PDL_NCHILDREN; i++) |
|
675
|
0 |
3 |
if (!it->trans_children) return pdl_make_error_simple(PDL_EFATAL, "Out of Memory\n"); |
|
677
|
1114 |
45 |
for (i = oldval; i < howmany; i++) |
|
685
|
0 |
194402 |
PDL_RECURSE_CHECK(recurse_count); |
|
686
|
0 |
194402 |
if (!it) return pdl_make_error_simple(PDL_EFATAL, "make_physdims called with NULL"); |
|
687
|
0 |
194402 |
PDLDEBUG_f(printf("make_physdims %p state=", it);pdl_dump_flags_fixspace(it->state, 0, PDL_FLAGS_PDL)); |
|
688
|
0 |
194402 |
PDL_CHKMAGIC(it); |
|
|
0 |
0 |
PDL_CHKMAGIC(it); |
|
689
|
145060 |
49342 |
if (!(it->state & PDL_PARENTDIMSCHANGED)) { |
|
690
|
0 |
145060 |
PDLDEBUG_f(printf("make_physdims exit (NOP) %p\n", it)); |
|
694
|
0 |
49342 |
PDLDEBUG_f(printf("make_physdims %p TRANS: ",it);pdl_dump_trans_fixspace(trans,3)); |
|
696
|
56790 |
49342 |
for (i=0; ivtable->nparents; i++) |
|
697
|
14154 |
42636 |
if (trans->pdls[i]->state & PDL_PARENTDIMSCHANGED) |
|
698
|
0 |
14154 |
PDL_RETERROR(PDL_err, pdl__make_physdims_recprotect(trans->pdls[i], recurse_count+1)); |
|
699
|
0 |
49342 |
PDLDEBUG_f(printf("make_physdims: calling redodims trans=%p on pdl=%p\n", trans, it)); |
|
700
|
42011 |
7331 |
REDODIMS(PDL_RETERROR, trans); |
|
|
42011 |
42086 |
REDODIMS(PDL_RETERROR, trans); |
|
|
42009 |
2 |
REDODIMS(PDL_RETERROR, trans); |
|
|
42009 |
0 |
REDODIMS(PDL_RETERROR, trans); |
|
|
84097 |
42011 |
REDODIMS(PDL_RETERROR, trans); |
|
|
0 |
42011 |
REDODIMS(PDL_RETERROR, trans); |
|
|
36 |
49306 |
REDODIMS(PDL_RETERROR, trans); |
|
|
34 |
2 |
REDODIMS(PDL_RETERROR, trans); |
|
|
0 |
34 |
REDODIMS(PDL_RETERROR, trans); |
|
|
0 |
34 |
REDODIMS(PDL_RETERROR, trans); |
|
|
0 |
36 |
REDODIMS(PDL_RETERROR, trans); |
|
|
42011 |
7331 |
REDODIMS(PDL_RETERROR, trans); |
|
|
57 |
49285 |
REDODIMS(PDL_RETERROR, trans); |
|
|
0 |
13319 |
REDODIMS(PDL_RETERROR, trans); |
|
|
0 |
0 |
REDODIMS(PDL_RETERROR, trans); |
|
|
13319 |
49285 |
REDODIMS(PDL_RETERROR, trans); |
|
|
0 |
49285 |
REDODIMS(PDL_RETERROR, trans); |
|
|
0 |
0 |
REDODIMS(PDL_RETERROR, trans); |
|
|
0 |
49285 |
REDODIMS(PDL_RETERROR, trans); |
|
|
49285 |
49285 |
REDODIMS(PDL_RETERROR, trans); |
|
701
|
0 |
49285 |
PDLDEBUG_f(printf("make_physdims exit pdl=%p\n", it)); |
|
710
|
44507 |
131054 |
return !!(tp && (tp->flags & PDL_ITRANS_DO_DATAFLOW_ANY) == PDL_ITRANS_DO_DATAFLOW_F); |
|
|
23 |
44484 |
return !!(tp && (tp->flags & PDL_ITRANS_DO_DATAFLOW_ANY) == PDL_ITRANS_DO_DATAFLOW_F); |
|
717
|
91669 |
82665 |
for (i=0; inparents; i++) { |
|
719
|
21 |
91648 |
if (_trans_forward_only(parent)) |
|
721
|
24 |
91645 |
if (parent->state & PDL_NOMYDIMS && !(vtable->par_flags[i] & PDL_PARAM_ALLOW_NULL)) |
|
|
2 |
22 |
if (parent->state & PDL_NOMYDIMS && !(vtable->par_flags[i] & PDL_PARAM_ALLOW_NULL)) |
|
727
|
83892 |
82662 |
for (; inpdls; i++) { |
|
729
|
2 |
83890 |
if (_trans_forward_only(child)) |
|
731
|
70224 |
13666 |
if (child->state & PDL_NOMYDIMS && !(vtable->par_flags[i] & PDL_PARAM_ISCREAT)) |
|
|
1 |
70223 |
if (child->state & PDL_NOMYDIMS && !(vtable->par_flags[i] & PDL_PARAM_ISCREAT)) |
|
750
|
0 |
82667 |
PDLDEBUG_f(printf("make_trans_mutual ");pdl_dump_trans_fixspace(trans,0)); |
|
754
|
0 |
82667 |
PDL_TR_CHKMAGIC(trans); |
|
|
0 |
0 |
PDL_TR_CHKMAGIC(trans); |
|
756
|
170334 |
77955 |
for (i=0; i
|
|
758
|
97311 |
73023 |
if ((vtable->par_flags[i] & (PDL_PARAM_ISOUT|PDL_PARAM_ISTEMP)) || |
|
759
|
92599 |
4712 |
!(pdl->state & PDL_BADVAL)) continue; |
|
763
|
4712 |
77955 |
if (trans->bvalflag && (vtable->flags & PDL_TRANS_BADIGNORE)) { |
|
|
0 |
4712 |
if (trans->bvalflag && (vtable->flags & PDL_TRANS_BADIGNORE)) { |
|
768
|
5 |
82662 |
if (PDL_err.error) { |
|
769
|
0 |
5 |
PDL_ACCUMERROR(PDL_err, pdl_trans_finaldestroy(trans)); |
|
772
|
91663 |
82662 |
for (i=0; i
|
|
774
|
0 |
91663 |
PDL_RETERROR(PDL_err, pdl__add_pdl_as_trans_input(parent,trans,i)); |
|
775
|
25 |
91638 |
if (parent->state & PDL_DATAFLOW_F) { |
|
781
|
0 |
82662 |
PDLDEBUG_f(printf("make_trans_mutual dataflow=%d disable_back=%d\n", (int)dataflow, (int)disable_back)); |
|
782
|
56427 |
26235 |
if (dataflow && disable_back) |
|
|
3 |
56424 |
if (dataflow && disable_back) |
|
785
|
82665 |
82662 |
PDL_BITFIELD_ZEROISE(wasnull, npdls); |
|
786
|
83889 |
82662 |
for (i=nparents; i
|
|
788
|
70223 |
13666 |
if (child->state & PDL_NOMYDIMS) PDL_BITFIELD_SET(wasnull, i); |
|
789
|
0 |
83889 |
PDLDEBUG_f(printf("make_trans_mutual child=%p wasnull[%"IND_FLAG"]=%d\n", child, i, PDL_BITFIELD_ISSET(wasnull, i))); |
|
790
|
56427 |
27462 |
if (dataflow) { |
|
794
|
0 |
56427 |
PDLDEBUG_f(printf("make_trans_mutual turning on allchanged, before="); pdl_dump_flags_fixspace(child->state, 0, PDL_FLAGS_PDL)); |
|
795
|
22988 |
33439 |
child->state |= PDL_PARENTDIMSCHANGED | ((trans->flags & PDL_ITRANS_ISAFFINE) ? 0 : PDL_PARENTDATACHANGED); |
|
796
|
0 |
56427 |
PDLDEBUG_f(printf("make_trans_mutual after change="); pdl_dump_flags_fixspace(child->state, 0, PDL_FLAGS_PDL)); |
|
798
|
5983 |
77906 |
if (!child->trans_parent || PDL_BITFIELD_ISSET(wasnull, i)) child->trans_parent = trans; |
|
|
0 |
5983 |
if (!child->trans_parent || PDL_BITFIELD_ISSET(wasnull, i)) child->trans_parent = trans; |
|
799
|
70223 |
13666 |
if (PDL_BITFIELD_ISSET(wasnull, i)) |
|
802
|
4712 |
77950 |
if (inputs_bad) |
|
803
|
4785 |
4712 |
for (i=nparents; i
|
|
805
|
26235 |
56427 |
if (!dataflow) { |
|
806
|
41 |
26194 |
PDL_ACCUMERROR(PDL_err, pdl__ensure_trans(trans, PDL_PARENTDIMSCHANGED, 0, 0)); |
|
807
|
41 |
26194 |
if (PDL_err.error) |
|
808
|
0 |
41 |
PDLDEBUG_f(printf("make_trans_mutual got error in ensure, not calling CHANGED on children\n")); |
|
810
|
27403 |
26194 |
for (i=vtable->nparents; inpdls; i++) { |
|
813
|
0 |
27403 |
PDLDEBUG_f(printf("make_trans_mutual isvaffine=%d wasnull=%d\n", (int)isvaffine, PDL_BITFIELD_ISSET(wasnull, i))); |
|
814
|
4946 |
22457 |
if (!isvaffine || PDL_BITFIELD_ISSET(wasnull, i)) |
|
|
0 |
4946 |
if (!isvaffine || PDL_BITFIELD_ISSET(wasnull, i)) |
|
815
|
13812 |
8645 |
CHANGED(child, PDL_BITFIELD_ISSET(wasnull, i) ? PDL_PARENTDIMSCHANGED : PDL_PARENTDATACHANGED, 0); |
|
|
0 |
22457 |
CHANGED(child, PDL_BITFIELD_ISSET(wasnull, i) ? PDL_PARENTDIMSCHANGED : PDL_PARENTDATACHANGED, 0); |
|
816
|
4946 |
22457 |
if (isvaffine) |
|
817
|
0 |
4946 |
CHANGED(child->vafftrans->from,PDL_PARENTDATACHANGED,0); |
|
819
|
0 |
26235 |
PDL_ACCUMERROR(PDL_err, pdl_destroytransform(trans,0,0)); |
|
821
|
0 |
82662 |
PDLDEBUG_f(printf("make_trans_mutual exit %p\n",trans)); |
|
827
|
0 |
40038 |
PDLDEBUG_f(printf("pdl_redodims_default ");pdl_dump_trans_fixspace(trans,0)); |
|
829
|
40034 |
4 |
if (vtable->flags & PDL_TRANS_DO_BROADCAST) { |
|
832
|
96635 |
40034 |
for (i=0; inpdls; i++) |
|
833
|
35176 |
61459 |
creating[i] = (vtable->par_flags[i] & PDL_PARAM_ISCREAT) && |
|
834
|
33531 |
1645 |
PDL_DIMS_FROM_TRANS(trans,pdls[i]); |
|
|
27625 |
5906 |
PDL_DIMS_FROM_TRANS(trans,pdls[i]); |
|
835
|
13 |
40021 |
PDL_RETERROR(PDL_err, pdl_initbroadcaststruct(2, pdls, |
|
839
|
17 |
40004 |
PDL_RETERROR(PDL_err, pdl_dim_checks(vtable, pdls, &trans->broadcast, trans->broadcast.nimpl, creating, trans->ind_sizes, 0)); |
|
840
|
96545 |
40004 |
for (i=0; inpdls; i++) { |
|
843
|
68924 |
27621 |
if (!creating[i]) continue; |
|
845
|
13687 |
27621 |
for (j=0; j
|
|
847
|
181 |
27440 |
if (flags & PDL_PARAM_ISTEMP) |
|
849
|
0 |
27621 |
PDL_RETERROR(PDL_err, pdl_broadcast_create_parameter( |
|
854
|
96545 |
40004 |
for (i=0; inpdls; i++) { |
|
856
|
47203 |
96545 |
for (j=0; jpar_realdims[i]; j++) |
|
858
|
35628 |
11575 |
(pdl->ndims <= j || pdl->dims[j] <= 1) ? 0 : |
|
|
22055 |
13573 |
(pdl->ndims <= j || pdl->dims[j] <= 1) ? 0 : |
|
859
|
7400 |
14655 |
PDL_REPRINC(pdl,j); |
|
869
|
0 |
196508 |
PDL_RECURSE_CHECK(recurse_count); |
|
870
|
0 |
196508 |
PDLDEBUG_f(printf("make_physical %p\n",it)); |
|
872
|
0 |
196508 |
PDL_CHKMAGIC(it); |
|
|
0 |
0 |
PDL_CHKMAGIC(it); |
|
874
|
162620 |
33888 |
!(it->state & PDL_ANYCHANGED) && /* unchanged and */ |
|
|
34959 |
127661 |
!(it->state & PDL_ANYCHANGED) && /* unchanged and */ |
|
875
|
20121 |
14838 |
!(trans && !(it->state & PDL_ALLOCATED) && (trans->flags & PDL_ITRANS_ISAFFINE)) /* not pure vaffine in waiting */ |
|
|
14408 |
5713 |
!(trans && !(it->state & PDL_ALLOCATED) && (trans->flags & PDL_ITRANS_ISAFFINE)) /* not pure vaffine in waiting */ |
|
877
|
24083 |
132824 |
PDL_ENSURE_ALLOCATED(it); |
|
|
1 |
24082 |
PDL_ENSURE_ALLOCATED(it); |
|
879
|
0 |
39601 |
if (!trans) |
|
881
|
5940 |
33661 |
if (trans->flags & PDL_ITRANS_ISAFFINE) { |
|
882
|
0 |
5940 |
PDLDEBUG_f(printf("make_physical: affine\n")); |
|
884
|
4 |
5936 |
PDL_RETERROR(PDL_err, pdl__make_physvaffine_recprotect(it, recurse_count+1)); |
|
886
|
1 |
33660 |
PDL_RETERROR(PDL_err, pdl__ensure_trans(trans,0,1,recurse_count+1)); |
|
888
|
0 |
196502 |
PDLDEBUG_f(printf("make_physical exiting: "); pdl_dump(it)); |
|
900
|
0 |
86680 |
PDLDEBUG_f( |
|
905
|
15818 |
70862 |
if (recursing) { |
|
906
|
0 |
15818 |
PDLDEBUG_f(printf("pdl_changed: adding what to state except pure vaff, currently="); pdl_dump_flags_fixspace(it->state,0,PDL_FLAGS_PDL)); |
|
907
|
6096 |
0 |
it->state |= !( /* neither */ |
|
909
|
318 |
5778 |
(trans && !(it->state & PDL_ALLOCATED) && (trans->flags & PDL_ITRANS_ISAFFINE)) /* pure vaffine in waiting */ |
|
|
250 |
68 |
(trans && !(it->state & PDL_ALLOCATED) && (trans->flags & PDL_ITRANS_ISAFFINE)) /* pure vaffine in waiting */ |
|
910
|
6096 |
9722 |
) ? what : what & ~PDL_PARENTDATACHANGED; |
|
911
|
1 |
15817 |
if (pdl__ismagic(it)) pdl__call_magic(it,PDL_MAGIC_MARKCHANGED); |
|
913
|
42978 |
43702 |
if (trans && !recursing && (trans->flags & PDL_ITRANS_DO_DATAFLOW_B) |
|
|
27160 |
15818 |
if (trans && !recursing && (trans->flags & PDL_ITRANS_DO_DATAFLOW_B) |
|
|
5732 |
21428 |
if (trans && !recursing && (trans->flags & PDL_ITRANS_DO_DATAFLOW_B) |
|
914
|
5732 |
0 |
&& (what & PDL_PARENTDATACHANGED)) { |
|
915
|
132 |
5600 |
if (it->vafftrans) { |
|
916
|
131 |
1 |
if (it->state & PDL_ALLOCATED) { |
|
917
|
0 |
131 |
PDLDEBUG_f(printf("pdl_changed: calling writebackdata_vaffine (pdl %p)\n",it)); |
|
918
|
0 |
131 |
PDL_ACCUMERROR(PDL_err, pdl_writebackdata_vaffine(it)); |
|
920
|
0 |
132 |
CHANGED(it->vafftrans->from,what,0); |
|
922
|
0 |
5600 |
PDLDEBUG_f(printf("pdl_changed: calling writebackdata from vtable, triggered by pdl %p, using trans %p\n",it,trans)); |
|
923
|
0 |
5600 |
WRITEDATA(trans); |
|
|
5600 |
5600 |
WRITEDATA(trans); |
|
|
10365 |
0 |
WRITEDATA(trans); |
|
|
14 |
10351 |
WRITEDATA(trans); |
|
|
10365 |
5600 |
WRITEDATA(trans); |
|
|
0 |
5600 |
WRITEDATA(trans); |
|
|
0 |
0 |
WRITEDATA(trans); |
|
|
5600 |
0 |
WRITEDATA(trans); |
|
|
0 |
5600 |
WRITEDATA(trans); |
|
|
0 |
10365 |
WRITEDATA(trans); |
|
|
10365 |
0 |
WRITEDATA(trans); |
|
|
0 |
10365 |
WRITEDATA(trans); |
|
|
10365 |
5600 |
WRITEDATA(trans); |
|
924
|
10365 |
5600 |
for (i=0; ivtable->nparents; i++) { |
|
926
|
3997 |
6368 |
CHANGED(PDL_VAFFOK(pdl) ? pdl->vafftrans->from : pdl, what, 0); |
|
|
0 |
10365 |
CHANGED(PDL_VAFFOK(pdl) ? pdl->vafftrans->from : pdl, what, 0); |
|
931
|
485929 |
80948 |
for (i = 0; i < it->ntrans_children_allocated; i++) { |
|
933
|
23040 |
462889 |
if (!trans || !(trans->flags & PDL_ITRANS_DO_DATAFLOW_F)) continue; |
|
|
2244 |
20796 |
if (!trans || !(trans->flags & PDL_ITRANS_DO_DATAFLOW_F)) continue; |
|
934
|
20796 |
20796 |
for (j=trans->vtable->nparents; jvtable->npdls; j++) |
|
935
|
20796 |
0 |
if (trans->pdls[j] != it && (trans->pdls[j]->state & what) != what) |
|
|
15818 |
4978 |
if (trans->pdls[j] != it && (trans->pdls[j]->state & what) != what) |
|
936
|
0 |
15818 |
CHANGED(trans->pdls[j],what,1); |
|
939
|
0 |
86680 |
PDLDEBUG_f(printf("pdl_changed: exiting for pdl %p\n", it)); |
|
956
|
0 |
128083 |
PDLDEBUG_f(printf("make_physvaffine %p calling ",it)); PDL_RETERROR(PDL_err, pdl__make_physdims_recprotect(it, recurse_count+1)); |
|
|
20 |
128063 |
PDLDEBUG_f(printf("make_physvaffine %p calling ",it)); PDL_RETERROR(PDL_err, pdl__make_physdims_recprotect(it, recurse_count+1)); |
|
957
|
71863 |
56200 |
if (!it->trans_parent || !(it->trans_parent->flags & PDL_ITRANS_ISAFFINE)) { |
|
|
45067 |
26796 |
if (!it->trans_parent || !(it->trans_parent->flags & PDL_ITRANS_ISAFFINE)) { |
|
958
|
0 |
101267 |
PDLDEBUG_f(printf("make_physvaffine handing off to make_physical %p\n",it)); |
|
961
|
5711 |
21085 |
if (!it->vafftrans || it->vafftrans->ndims < it->ndims) { |
|
|
2 |
5709 |
if (!it->vafftrans || it->vafftrans->ndims < it->ndims) { |
|
962
|
0 |
21087 |
PDL_RETERROR(PDL_err, pdl_vafftrans_alloc(it)); |
|
963
|
26168 |
21087 |
for (i=0; indims; i++) it->vafftrans->incs[i] = it->dimincs[i]; |
|
968
|
0 |
24293 |
if (!t->incs) |
|
973
|
32214 |
24293 |
for (i=0; indims; i++) { |
|
975
|
32211 |
3 |
PDL_Indx inc = it->vafftrans->incs[i], incsign = (inc >= 0 ? 1:-1), newinc = 0; |
|
978
|
51847 |
32132 |
for (j=current->ndims-1; j>=0 && current->dimincs[j] != 0; j--) { |
|
|
51765 |
82 |
for (j=current->ndims-1; j>=0 && current->dimincs[j] != 0; j--) { |
|
981
|
19699 |
32066 |
if (inc < current->dimincs[j]) continue; |
|
989
|
32214 |
24293 |
for (i=0; indims; i++) it->vafftrans->incs[i] = incsleft[i]; |
|
992
|
32486 |
24253 |
for (j=current->ndims-1; j>=0 && current->dimincs[j] != 0; j--) { |
|
|
32446 |
40 |
for (j=current->ndims-1; j>=0 && current->dimincs[j] != 0; j--) { |
|
999
|
9534 |
14759 |
} while (t && (t->flags & PDL_ITRANS_ISAFFINE) && !(current->state & PDL_ALLOCATED)); |
|
|
3276 |
6258 |
} while (t && (t->flags & PDL_ITRANS_ISAFFINE) && !(current->state & PDL_ALLOCATED)); |
|
|
3206 |
70 |
} while (t && (t->flags & PDL_ITRANS_ISAFFINE) && !(current->state & PDL_ALLOCATED)); |
|
1003
|
0 |
26796 |
PDLDEBUG_f(printf("make_physvaffine %p, physicalising final parent=%p\n", it, it->vafftrans->from)); |
|
1004
|
0 |
26796 |
PDL_RETERROR(PDL_err, pdl__make_physical_recprotect(it->vafftrans->from, recurse_count+1)); |
|
1005
|
6000 |
20796 |
if (it->state & PDL_PARENTDATACHANGED) { |
|
1007
|
5867 |
133 |
PDL_ENSURE_ALLOCATED(it); |
|
|
0 |
5867 |
PDL_ENSURE_ALLOCATED(it); |
|
1008
|
0 |
6000 |
PDL_RETERROR(PDL_err, pdl_readdata_vaffine(it)); |
|
1009
|
0 |
6000 |
PDLDEBUG_f(printf("make_physvaffine pdl=%p turning off datachanged and OPT_VAFFTRANSOK, before=", it); pdl_dump_flags_fixspace(it->state, 0, PDL_FLAGS_PDL)); |
|
1011
|
5867 |
133 |
if (!already_allocated) pdl_vafftrans_remove(it, 0); |
|
1013
|
0 |
26796 |
PDLDEBUG_f(printf("make_physvaffine exit %p\n", it)); |
|
1026
|
52075 |
8679 |
for (i = 0; i < a->ntrans_children_allocated; i++) { |
|
1027
|
1 |
52074 |
if (a->trans_children[i]) |
|
1030
|
1 |
8678 |
if (a->trans_parent) |
|
1031
|
0 |
1 |
PDL_RETERROR(PDL_err, pdl_destroytransform(a->trans_parent,1,0)); |
|
1032
|
8594 |
85 |
if (a->state & PDL_NOMYDIMS) |
|
1035
|
0 |
85 |
PDL_RETERROR(PDL_err, pdl_converttype( a, datatype )); |
|
1042
|
137 |
5900 |
if (!src->trans_parent) return PDL_err; |
|
1043
|
0 |
5900 |
PDL_RETERROR(PDL_err, pdl_make_physvaffine(src)); |
|
1044
|
0 |
5900 |
PDL_RETERROR(PDL_err, pdl_destroytransform(src->trans_parent,1,0)); |
|
1061
|
0 |
5612 |
PDL_RECURSE_CHECK(recurse_count); |
|
1062
|
0 |
5612 |
PDLDEBUG_f(printf("pdl_propagate_badflag_dir pdl=%p newval=%d is_fwd=%d already=%d\n", it, newval, (int)is_fwd, !!(it->state & PDL_BADVAL))); |
|
1064
|
5186 |
426 |
if (newval) |
|
1069
|
7 |
5605 |
if (!is_fwd) { |
|
1070
|
2 |
5 |
if (tp) |
|
1071
|
2 |
0 |
PDL_MAYBE_PROPAGATE_BADFLAG(tp, newval, 0); |
|
|
2 |
2 |
PDL_MAYBE_PROPAGATE_BADFLAG(tp, newval, 0); |
|
1073
|
0 |
5605 |
PDLDEBUG_f(printf("pdl_propagate_badflag_dir forward pdl state="); pdl_dump_flags_fixspace(it->state, 0, PDL_FLAGS_PDL)); |
|
1076
|
5604 |
1 |
(it->state & (PDL_OPT_VAFFTRANSOK|PDL_ALLOCATED)) == PDL_OPT_VAFFTRANSOK || /* pure vaff */ |
|
|
5029 |
575 |
(it->state & (PDL_OPT_VAFFTRANSOK|PDL_ALLOCATED)) == PDL_OPT_VAFFTRANSOK || /* pure vaff */ |
|
1077
|
4717 |
312 |
(tp && !(it->state & PDL_ALLOCATED) && (tp->flags & PDL_ITRANS_ISAFFINE)) /* pure vaffine in waiting */ |
|
|
191 |
4526 |
(tp && !(it->state & PDL_ALLOCATED) && (tp->flags & PDL_ITRANS_ISAFFINE)) /* pure vaffine in waiting */ |
|
1078
|
190 |
2 |
) && newval) /* expansive - if slice gets badflag, whole does */ |
|
1079
|
4 |
186 |
PDL_MAYBE_PROPAGATE_BADFLAG(tp, newval, 0); |
|
|
190 |
190 |
PDL_MAYBE_PROPAGATE_BADFLAG(tp, newval, 0); |
|
1080
|
33638 |
5605 |
for (j = 0; j < it->ntrans_children_allocated; j++) { |
|
1082
|
33410 |
228 |
if (!trans) continue; |
|
1083
|
8 |
220 |
PDL_MAYBE_PROPAGATE_BADFLAG(trans, newval, 1); |
|
|
228 |
228 |
PDL_MAYBE_PROPAGATE_BADFLAG(trans, newval, 1); |
|
1095
|
264 |
44 |
for (j = 0; j < it->ntrans_children_allocated; j++) { |
|
1097
|
262 |
2 |
if (!trans) continue; |
|
1099
|
2 |
2 |
for ( i = trans->vtable->nparents; i < trans->vtable->npdls; i++ ) { |
|
1103
|
0 |
2 |
if (typedval.type < 0) { |
|
1127
|
0 |
0 |
if (it->has_badvalue && it->badvalue.type != it->datatype) |
|
|
0 |
0 |
if (it->has_badvalue && it->badvalue.type != it->datatype) |
|
1129
|
0 |
0 |
return it->has_badvalue ? it->badvalue : pdl_get_badvalue( it->datatype ); |
|
1135
|
0 |
82677 |
if (!it) return it; |
|
1138
|
51035 |
31642 |
if (vtable->structsize) { |
|
1140
|
0 |
51035 |
if (!it->params) return NULL; |
|
1154
|
0 |
82677 |
if (!it->ind_sizes) return NULL; |
|
1155
|
112319 |
82677 |
int i; for (i=0; ininds + vtable->nparents; i++) it->ind_sizes[i] = -1; |
|
1157
|
0 |
82677 |
if (!it->inc_sizes) return NULL; |
|
1158
|
29202 |
82677 |
for (i=0; inind_ids; i++) it->inc_sizes[i] = -1; |
|
1185
|
147630 |
68693 |
for (i=0; inpdls; i++) { |
|
1187
|
69924 |
77706 |
if (i >= nparents && pdl->state & PDL_READONLY) |
|
|
2 |
69922 |
if (i >= nparents && pdl->state & PDL_READONLY) |
|
1191
|
56277 |
91351 |
if (pdl->state & PDL_NOMYDIMS) |
|
1195
|
4 |
91347 |
if (flags & PDL_PARAM_ISNOTREAL && dtype < PDL_CF) |
|
|
1 |
3 |
if (flags & PDL_PARAM_ISNOTREAL && dtype < PDL_CF) |
|
1198
|
1 |
0 |
vtable->name, vtable->par_names[i], PDL_TYPENAME(dtype)); |
|
|
1 |
0 |
vtable->name, vtable->par_names[i], PDL_TYPENAME(dtype)); |
|
|
1 |
0 |
vtable->name, vtable->par_names[i], PDL_TYPENAME(dtype)); |
|
1199
|
242 |
91108 |
if (flags & PDL_PARAM_ISNOTCOMPLEX && dtype >= PDL_CF) |
|
|
4 |
238 |
if (flags & PDL_PARAM_ISNOTCOMPLEX && dtype >= PDL_CF) |
|
1202
|
4 |
0 |
vtable->name, vtable->par_names[i], PDL_TYPENAME(dtype)); |
|
|
4 |
0 |
vtable->name, vtable->par_names[i], PDL_TYPENAME(dtype)); |
|
|
4 |
0 |
vtable->name, vtable->par_names[i], PDL_TYPENAME(dtype)); |
|
1205
|
137386 |
68693 |
PDL_BITFIELD_ZEROISE(type_avail, PDL_NTYPES); |
|
1207
|
993208 |
68693 |
for (i=0; vtable->gentypes[i] != PDL_INVALID; i++) |
|
1209
|
102 |
68591 |
if (vtable->gentypes[0] == last_dtype) { |
|
1214
|
138594 |
55065 |
for (i=vtable->npdls-1; i>= 0; i--) { |
|
1217
|
82496 |
56098 |
if (!(pdl->state & PDL_NOMYDIMS) && |
|
1218
|
74901 |
7595 |
!(flags & (PDL_PARAM_ISIGNORE|PDL_PARAM_ISTYPED|PDL_PARAM_ISCREATEALWAYS)) |
|
1220
|
0 |
74901 |
pdl_datatypes new_transtype = PDL_TYPE_ADJUST_FROM_SUPPLIED(pdl->datatype, flags); |
|
|
0 |
0 |
pdl_datatypes new_transtype = PDL_TYPE_ADJUST_FROM_SUPPLIED(pdl->datatype, flags); |
|
|
11 |
74890 |
pdl_datatypes new_transtype = PDL_TYPE_ADJUST_FROM_SUPPLIED(pdl->datatype, flags); |
|
|
11 |
0 |
pdl_datatypes new_transtype = PDL_TYPE_ADJUST_FROM_SUPPLIED(pdl->datatype, flags); |
|
1222
|
449 |
74452 |
if (!newtype_is_avail && new_transtype > last_dtype) |
|
|
118 |
331 |
if (!newtype_is_avail && new_transtype > last_dtype) |
|
1224
|
74901 |
0 |
if (new_transtype != PDL_INVALID && newtype_is_avail && *retval < new_transtype) |
|
|
74452 |
449 |
if (new_transtype != PDL_INVALID && newtype_is_avail && *retval < new_transtype) |
|
|
69693 |
4759 |
if (new_transtype != PDL_INVALID && newtype_is_avail && *retval < new_transtype) |
|
1227
|
68537 |
70057 |
if (i == nparents && *retval != PDL_INVALID) return PDL_err; |
|
|
13526 |
55011 |
if (i == nparents && *retval != PDL_INVALID) return PDL_err; |
|
1229
|
54989 |
76 |
if (use_last_dtype || *retval == PDL_INVALID || !PDL_BITFIELD_ISSET(type_avail, *retval)) |
|
|
54816 |
173 |
if (use_last_dtype || *retval == PDL_INVALID || !PDL_BITFIELD_ISSET(type_avail, *retval)) |
|
|
0 |
54816 |
if (use_last_dtype || *retval == PDL_INVALID || !PDL_BITFIELD_ISSET(type_avail, *retval)) |
|
1238
|
0 |
82668 |
PDL_RECURSE_CHECK(recurse_count); |
|
1243
|
19 |
61049 |
char p2child_has_badvalue = (vtable->npdls == 2 && pdls[0]->has_badvalue |
|
1244
|
61068 |
21600 |
&& (vtable->par_flags[1] & PDL_PARAM_ISCREATEALWAYS)); |
|
|
10 |
9 |
&& (vtable->par_flags[1] & PDL_PARAM_ISCREATEALWAYS)); |
|
1245
|
10 |
82658 |
PDL_Anyval parent_badvalue = p2child_has_badvalue ? pdls[0]->badvalue : (PDL_Anyval){PDL_INVALID, {0}}; |
|
1246
|
175568 |
82668 |
for (i=0; inpdls; i++) { |
|
1248
|
13975 |
161593 |
if (flags & PDL_PARAM_ISIGNORE) continue; |
|
1250
|
56299 |
105294 |
if (!(pdl->state & PDL_NOMYDIMS) || PDL_HAS_OTHER_PARENT(pdl, trans)) continue; |
|
|
0 |
56299 |
if (!(pdl->state & PDL_NOMYDIMS) || PDL_HAS_OTHER_PARENT(pdl, trans)) continue; |
|
|
0 |
0 |
if (!(pdl->state & PDL_NOMYDIMS) || PDL_HAS_OTHER_PARENT(pdl, trans)) continue; |
|
1253
|
5161 |
51138 |
pdl->datatype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
|
4212 |
949 |
pdl->datatype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
|
186 |
50952 |
pdl->datatype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
|
94 |
92 |
pdl->datatype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
|
98 |
50946 |
pdl->datatype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
|
88 |
10 |
pdl->datatype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
1260
|
0 |
68693 |
PDL_RECURSE_CHECK(recurse_count); |
|
1267
|
68632 |
68693 |
PDL_BITFIELD_ZEROISE(is_inout, nchildren); |
|
1268
|
69922 |
68693 |
for (i=0; i < nchildren; i++) { |
|
1269
|
6091 |
63831 |
if (!(vtable->par_flags[i + nparents] & PDL_PARAM_ISCREAT)) { |
|
1274
|
78199 |
61766 |
for (j=0; j < nparents; j++) { |
|
1276
|
76134 |
2065 |
if (parent != child) continue; |
|
1282
|
147616 |
68692 |
for (i=vtable->npdls-1; i>=0; i--) { |
|
1284
|
0 |
147616 |
if (flags & PDL_PARAM_ISIGNORE) continue; |
|
1286
|
56277 |
91339 |
if ((pdl->state & PDL_NOMYDIMS) && !PDL_HAS_OTHER_PARENT(pdl, trans)) continue; |
|
|
0 |
56277 |
if ((pdl->state & PDL_NOMYDIMS) && !PDL_HAS_OTHER_PARENT(pdl, trans)) continue; |
|
|
0 |
0 |
if ((pdl->state & PDL_NOMYDIMS) && !PDL_HAS_OTHER_PARENT(pdl, trans)) continue; |
|
1287
|
7624 |
83715 |
pdl_datatypes new_dtype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
|
7616 |
8 |
pdl_datatypes new_dtype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
|
236 |
83479 |
pdl_datatypes new_dtype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
|
2 |
234 |
pdl_datatypes new_dtype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
|
11 |
83702 |
pdl_datatypes new_dtype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
|
11 |
0 |
pdl_datatypes new_dtype = PDL_TYPE_ADJUST_FROM_TRANS(trans_dtype, flags, vtable->par_types[i]); |
|
1288
|
77706 |
13633 |
if (new_dtype == pdl->datatype) continue; |
|
1289
|
0 |
13633 |
PDLDEBUG_f(printf("pdl_type_coerce (%s) pdl=%"IND_FLAG" from %d to %d\n", vtable->name, i, pdl->datatype, new_dtype)); |
|
1290
|
23 |
13610 |
if (i >= nparents && PDL_HAS_OTHER_PARENT(pdl, trans)) |
|
|
1 |
22 |
if (i >= nparents && PDL_HAS_OTHER_PARENT(pdl, trans)) |
|
|
1 |
0 |
if (i >= nparents && PDL_HAS_OTHER_PARENT(pdl, trans)) |
|
1294
|
1 |
0 |
PDL_TYPENAME(pdl->datatype), PDL_TYPENAME(new_dtype)); |
|
|
1 |
0 |
PDL_TYPENAME(pdl->datatype), PDL_TYPENAME(new_dtype)); |
|
|
1 |
0 |
PDL_TYPENAME(pdl->datatype), PDL_TYPENAME(new_dtype)); |
|
|
1 |
0 |
PDL_TYPENAME(pdl->datatype), PDL_TYPENAME(new_dtype)); |
|
|
1 |
0 |
PDL_TYPENAME(pdl->datatype), PDL_TYPENAME(new_dtype)); |
|
|
1 |
0 |
PDL_TYPENAME(pdl->datatype), PDL_TYPENAME(new_dtype)); |
|
1295
|
22 |
13610 |
PDL_RETERROR(PDL_err, pdl__get_convertedpdl_recprotect( |
|
|
12 |
10 |
PDL_RETERROR(PDL_err, pdl__get_convertedpdl_recprotect( |
|
|
0 |
13632 |
PDL_RETERROR(PDL_err, pdl__get_convertedpdl_recprotect( |
|
1300
|
0 |
13632 |
if (pdl->datatype != new_dtype) |
|
1302
|
7 |
13625 |
if (i == inplace_output_ind) |
|
1312
|
0 |
68702 |
PDL_RECURSE_CHECK(recurse_count); |
|
1313
|
2 |
68700 |
PDL_RETERROR(PDL_err, pdl__trans_check_pdls_actual(trans)); |
|
1315
|
7 |
68693 |
PDL_RETERROR(PDL_err, pdl__transtype_select(trans, &trans_dtype)); |
|
1317
|
0 |
68693 |
PDL_RETERROR(PDL_err, pdl__set_output_type_badvalue(trans, recurse_count+1)); |
|
1318
|
1 |
68692 |
PDL_RETERROR(PDL_err, pdl__type_convert(trans, recurse_count+1)); |
|
1334
|
147646 |
68702 |
for (i=0; inpdls; i++) { |
|
1335
|
181 |
147465 |
if (vtable->par_flags[i] & PDL_PARAM_ISTEMP) |
|
1336
|
0 |
181 |
if (!(pdls[i] = pdl_pdlnew())) |
|
1338
|
0 |
147646 |
if (!pdls[i]) |
|
1341
|
11 |
68691 |
if (vtable->flags & PDL_TRANS_OUTPUT_OTHERPAR) |
|
1342
|
14 |
9 |
for (i = 0; i < vtable->npdls; i++) |
|
1343
|
9 |
5 |
if (!(trans->pdls[i]->state & PDL_NOMYDIMS) && trans->pdls[i]->ndims > vtable->par_realdims[i]) |
|
|
2 |
7 |
if (!(trans->pdls[i]->state & PDL_NOMYDIMS) && trans->pdls[i]->ndims > vtable->par_realdims[i]) |