5 Replies Latest reply on Jan 27, 2009 5:35 AM by thesquiff

    Restrict domain of execution?



      Say I have a 1D stream of 256 elements.

      In Brook+ is there any way I can call a kernel to operate on just the last 128 of these elements?


        • Restrict domain of execution?
          Check the Stream Computing User Guide that comes with the SDK, try pages 2-18 to about 2-20.

          Also, you may want to take a look at the "Domain" and "ExecDomain" samples that come with the SDK.
            • Restrict domain of execution?

              Thanks for the reply. Turned out I had updated by SDK but not my programming guide...

              Now I had a kernel which creates a substream:

              //assume 2D 256x256 input stream
              kernel void substream(float inputStream<>, int startIndex, out float outputStream[]) {
                  int idx,idy;
                  int index;
                  idx = instance().x;
                  idy = instance().y;
                  index = idy*256 + idx;
                  outputStream[index-startIndex] = inputStream;


              and call the kernel as follows:

              substream(textstream, index, targetStream);

              where index is the index within the larger stream "textstream" where the substream should begin, and targetStream is the new substream of size 256.

              Everything compiles OK without errors or warnings, but the substream I get is all zeros.

              When I put the kernel code into KernelAnalyzer, all parameters are listed as N/A for the HD2400 (I have a 4870 on the way). Does the HD2400 not support scatter?


                • Restrict domain of execution?

                  Just a quick remark, isn't it what you're trying to achieve ???


                  kernel void substream(float inputStream[], int startIndex, out float outputStream<> {
                      int idx = instance().x;
                      outputStream = inputStream[index+startIndex];

                  • Restrict domain of execution?

                    Your domain size seems to be wrong. Both, domainOffset and domainSize are uint4 parameters. You have specified a domain size of (256, 0, 0, 0), that is wrong and it has to be (256, 1, 1, 1).

                    I think if you check error on your output stream, you should see an errorLog attached to it. Take a look at tutorials coming with SDK under \samples\CPP\tutorials\ExecDomain and \samples\CPP\tutorials\ScatterStreamKernel.

                    Yes, HD2400 doesn't support scatter.