4 Replies Latest reply on Dec 18, 2008 3:06 AM by rick.weber

    How to make arrays of streams in Brook+

    rick.weber

      Okay, so after messing around with a number of ways of doing this, I found a way of making arrays of streams in Brook+ work. If you can figure out a way to statically make such an array, please reply, as it would allow syntax to be much cleaner. I couldn't figure this out since you can't call anything except the default constructor when statically creating arrays unless you overload the new operator and preallocate space for your objects (a pretty esoteric part of C++). 

      const int kNumStreams = 10;
      Stream* myStreamArray[kNumStreams];
      unsigned int streamDim = 8192; 

      for(int i = 0; i < kNumStreams; i++)
      {
      myStreamArray = new Stream(1,&streamDim); 
      }

       

      I needed to do this because I'm more or less computing the outer product of a 640 vector and a ~250k vector creating a 250,000x640 matrix and the resulting matrix has more than the maximum 8192^2 elements allowed by Brook+ and the CAL subsystem (I think this limit is actually architecturally imposed).