thesquiff

Problem with Reduction

Discussion created by thesquiff on Jan 23, 2009
Latest reply on Feb 3, 2009 by gaurav.garg

I've got a very simple reduction kernel which sums up all the elements in a stream.

The kernel will run once, but then crashes the next time with an access violation.

With the truncated code below, the kernel should always return 0.

Any ideas?

 

reduce void getMatchLength(float matchesIn<>, reduce float length) {
    length += matchesIn;
}

int gpuprocess()
{
 
    float matches<256>;
    float matchPattern[256];

    while (index < 32000) {
   
        matchLength = 0.0;
        printf("calling getMatchLength\n");

 

        streamRead(matches, matchPattern);

        getMatchLength(matches, matchLength);


        printf("Match length = %f\n", matchLength);
        index++;
        printf("Looping... index=%d\n", index);
       
    }

}

Outcomes