Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/vis12/test/hlic/hlic-BUG8.diderot
ViewVC logotype

Annotation of /branches/vis12/test/hlic/hlic-BUG8.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1768 - (view) (download)

1 : jhr 1768 // FIXED [JHR; 23-03-2012]
2 : jhr 1762
3 :     // BUG:
4 :     // this program does not terminate. The issue is that the body of the
5 :     // "if (dir > 0.0)" is empty in the generated C code.
6 : jhr 1768 // The problem is that the SSA form constructed for the successor of the block
7 :     // is missing the PHI node, which makes the assignments in the block unused.
8 :     // It appears related to the fact that one arm of the if is a stabilize, which
9 :     // so there is a single-predecessor join node.
10 : jhr 1762 //
11 :    
12 :     int imgSize = 200;
13 :     real h = 0.25; // step size of integration
14 :     int stepNum = 5; // take this many steps both upstream and downstream
15 :    
16 :     field#1(2)[2] V = load("tor2slice-vec0.nrrd") ⊛ ctmr;
17 :     field#0(2)[] R = load("tor2slice-rand.nrrd") ⊛ tent;
18 :    
19 :     strand LIC (int xi, int yi) {
20 :     real xx = lerp(0.0, 79.0, -0.5, real(xi), real(imgSize)-0.5);
21 :     real yy = lerp(0.0, 79.0, -0.5, real(yi), real(imgSize)-0.5);
22 :     vec2 pos0 = [xx,yy];
23 :     vec2 pos0backup = [xx,yy];
24 :     vec2 pos = pos0;
25 :     vec2 step = [0.0,0.0];
26 :     output vec3 out = [0.0,0.0,0.0];
27 :     real sum = 0.0;
28 :     int num = 0;
29 :     real dir = 1.0;
30 :    
31 :     update {
32 :     step = h*dir*V(pos);
33 :     if (inside(pos + step, V) && inside(pos + step, R)) {
34 :     pos += step;
35 :     }
36 :     if (num == stepNum) {
37 :     if (dir > 0.0) {
38 :     num = 0;
39 :     pos = pos0backup;
40 :     dir = -1.0;
41 :     }
42 :     else
43 :     stabilize;
44 :     }
45 :     sum += R(pos);
46 :     num += 1;
47 :     }
48 :    
49 :     stabilize {
50 :     out = [pos[0], pos[1], sum];
51 :     }
52 :     }
53 :    
54 :     initially [ LIC(xi, yi) | yi in 0..(imgSize-1), xi in 0..(imgSize-1) ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0