tonald

Brook+ Unhandled exception?

Discussion created by tonald on Oct 28, 2008

why when I use brook+ 1.21 got a strange behavior, finally, I find it like below, when I try to use twice GPU:

 /////////////////////////////////////////////////////////////////////////
 // Brook code block
 /////////////////////////////////////////////////////////////////////////
    {
        float inputStream<Length>;
        float outputStream<Length>;
        float res<1>;

        streamRead(inputStream, input);
        hello_brook_check(inputStream, outputStream, (float)Length / 3.0f);
        hello_brook_sum(outputStream, res);
        streamWrite(res, &result);
    }

 /////////////////////////////////////////////////////////////////////////
 // Brook code block
 /////////////////////////////////////////////////////////////////////////
    {
        float inputStream1<Length>;
        float outputStream1<Length>;
        float res1<1>;

        streamRead(inputStream1, input);
        hello_brook_check(inputStream1, outputStream1, (float)Length / 3.0f);
        hello_brook_sum(outputStream1, res1);
        streamWrite(res1, &result);
    }

 

the programm will halt at "hello_brook_check(inputStream1, outputStream1, (float)Length / 3.0f);" and give error message " unhandled exception at .....".

but if I use it like:

/////////////////////////////////////////////////////////////////////////
 // Brook code block
 /////////////////////////////////////////////////////////////////////////

        float inputStream1<Length>;
        float outputStream1<Length>;
        float res1<1>;


    {
        float inputStream<Length>;
        float outputStream<Length>;
        float res<1>;

        streamRead(inputStream, input);
        hello_brook_check(inputStream, outputStream, (float)Length / 3.0f);
        hello_brook_sum(outputStream, res);
        streamWrite(res, &result);
    }

 /////////////////////////////////////////////////////////////////////////
 // Brook code block
 /////////////////////////////////////////////////////////////////////////
    {

        streamRead(inputStream1, input);
        hello_brook_check(inputStream1, outputStream1, (float)Length / 3.0f);
        hello_brook_sum(outputStream1, res1);
        streamWrite(res1, &result);
    }

 

There will  be no error, program will run correctly.

 

 

Is there anybody know what happen here?

Outcomes