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

SCM Repository

[diderot] Annotation of /branches/vis12/bugs/bug016.diderot
ViewVC logotype

Annotation of /branches/vis12/bugs/bug016.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2209 - (view) (download)

1 : glk 2209
2 :     /*
3 :     ** BUG: not sure what is wrong; something about constructing a tensor (vector)
4 :     ** from elements of a sequence. The code
5 :     ** ..................
6 :     ** in here
7 :     ** ##################
8 :     ** is what exposes compiler bugs. The code
9 :     ** ##################
10 :     ** in here
11 :     ** ``````````````````
12 :     ** is a way to do the equivalent without making a vector.
13 :     ** Either BUG-A or BUG-B lines below have problems:
14 :     **
15 :     ** BUG-A:
16 :     uncaught exception Fail [Fail: element of tensor construction not tensor]
17 :     raised at common/phase-timer.sml:76.50-76.52
18 :     raised at common/phase-timer.sml:76.50-76.52
19 :     raised at simplify/simple.sml:107.21-107.69
20 :    
21 :    
22 :     ** BUG-B: compiles ok but the generated C code is broken
23 :     low-il DFA: cpu = 0.000 seconds, gc = 0.000 seconds, 10 nodes, 9 visits, 1 iterations
24 :     bug016.c:277:13: error: too many arguments to function call, expected 4, have 5
25 :     *((Diderot_real_t *)Diderot_DynSeqAddr(sizeof(Diderot_real_t), glob->xyInit, l__t_5)));
26 :     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 :     bug016.c:75:1: note: 'LIC_InitState' declared here
28 :     static void LIC_InitState (Diderot_Globals_t *glob, Strand_LIC_t *self, Diderot_int_t p_ii_0, ...
29 :     ^
30 :     1 error generated.
31 :     uncaught exception Fail [Fail: error compiling/linking]
32 :    
33 :     **
34 :     */
35 :     real {} xyInit = load("data/real.nrrd");
36 :     int xyNum = length(xyInit)/2;
37 :    
38 :     /* .................. */
39 :    
40 :     strand LIC (int ii, vec2 pos0) {
41 :     real xx = pos0[0];
42 :     real yy = pos0[1];
43 :    
44 :     /* ################## */
45 :     /*
46 :     strand LIC (int ii, real xx, real yy) {
47 :     */
48 :     /* `````````````````` */
49 :     output vec2 pos = [0,0];
50 :     int step = 0;
51 :    
52 :     update {
53 :     pos = [xx,yy];
54 :     print(ii, ": ", xx, " ", yy, "\n");
55 :     stabilize;
56 :     }
57 :     }
58 :     /* .................. */
59 :    
60 :     initially [ LIC(ii, [xyInit{0 + 2*ii}, xyInit{1 + 2*ii}]) // BUG-A
61 :     //initially [ LIC(ii, xyInit{0 + 2*ii}, xyInit{1 + 2*ii}) // BUG-B
62 :     | ii in 0..xyNum-1 ];
63 :    
64 :     /* ################## */
65 :     /*
66 :     initially [ LIC(ii, xyInit{0 + 2*ii}, xyInit{1 + 2*ii})
67 :     | ii in 0..xyNum-1 ];
68 :     */
69 :     /* `````````````````` */

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