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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2209 - (download) (annotate)
Tue Feb 26 02:56:54 2013 UTC (7 years, 5 months ago) by glk
File size: 2051 byte(s)
new challenges with sequences
/*
** BUG: not sure what is wrong; something about constructing a tensor (vector)
** from elements of a sequence.  The code
** ..................
** in here
** ##################
** is what exposes compiler bugs.  The code
** ##################
** in here
** ``````````````````
** is a way to do the equivalent without making a vector.
** Either BUG-A or BUG-B lines below have problems:
**
** BUG-A:
uncaught exception Fail [Fail: element of tensor construction not tensor]
  raised at common/phase-timer.sml:76.50-76.52
  raised at common/phase-timer.sml:76.50-76.52
  raised at simplify/simple.sml:107.21-107.69


** BUG-B: compiles ok but the generated C code is broken
low-il DFA: cpu = 0.000 seconds, gc = 0.000 seconds, 10 nodes, 9 visits, 1 iterations
bug016.c:277:13: error: too many arguments to function call, expected 4, have 5
            *((Diderot_real_t *)Diderot_DynSeqAddr(sizeof(Diderot_real_t), glob->xyInit, l__t_5)));
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bug016.c:75:1: note: 'LIC_InitState' declared here
static void LIC_InitState (Diderot_Globals_t *glob, Strand_LIC_t *self, Diderot_int_t p_ii_0, ...
^
1 error generated.
uncaught exception Fail [Fail: error compiling/linking]

**
*/
real {} xyInit = load("data/real.nrrd");
int xyNum = length(xyInit)/2;

/* .................. */

strand LIC (int ii, vec2 pos0) {
    real xx = pos0[0];
    real yy = pos0[1];

/* ################## */
/*
strand LIC (int ii, real xx, real yy) {
*/
/* `````````````````` */
    output vec2 pos = [0,0];
    int step = 0;

    update {
        pos = [xx,yy];
        print(ii, ": ", xx, " ",  yy, "\n");
        stabilize;
    }
}
/* .................. */

initially [ LIC(ii, [xyInit{0 + 2*ii}, xyInit{1 + 2*ii}])    // BUG-A
//initially [ LIC(ii, xyInit{0 + 2*ii}, xyInit{1 + 2*ii})      // BUG-B
            | ii in 0..xyNum-1 ];

/* ################## */
/*
initially [ LIC(ii, xyInit{0 + 2*ii}, xyInit{1 + 2*ii})
            | ii in 0..xyNum-1 ];
*/
/* `````````````````` */

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