18 Replies Latest reply on Aug 24, 2009 12:06 PM by riza.guntur

    Shared memory usage cause blue screen

    wellwill

      Hi, I have a question when I try to use the shared memory(LDS).

      The sample code is in attach, and it will cause blue screen issue(if I turn of the recover system, it will hang and I should shut down the system).

      If I change the group size from 256 to 64, it will run successfully.

      What is the problem in my sample code?

      Thanks!

      //lds.br Attribute[GroupSize(256, 1, 1)] kernel void ati_test(out int output[][]) { shared float4 lds[1024]; int2 index = instance().xy; int i; for(i = 0; i < 30; i++) { lds[4 * instanceInGroup().x + 0] = float4(0.0f, 0.0f, 0.0f, 0.0f); syncGroup(); } output[index.y][index.x] = 0; } // main.cpp #include "brookgenfiles/lds.h" int main() { for(int i = 0; i < 30; i++) { unsigned int streamSize[] = {256, 4}; brook::Stream<int> output(2, streamSize); int *o0 = new int[256 * 4]; ati_test(output); output.write(o0); delete []o0; } return 0; }