4 Replies Latest reply on Mar 4, 2011 10:15 AM by nou

    Brook+ and OpenCL

    erman_amd
      How to represent 2D array (matrix) to 1D stream?

      Hi,

      This is my first post here. I just started to use OpenCL on AMD platform and want to compare it with Brook+. Also just bought a 5870 GPU to start programming.

      I tried to a look at the opencl examples provided by the SDK to find out some differences between OCL and Brook+.

      I have a very very basic question.

      -In Brook+, there is a domain of execution? is it the same concept with NDRange in OCL)

      -Brook+ uses the term "stream". Most of cases it represents the input and output using "1D stream".  If I want to port an OCL apps to Brook+, how to represent 2D array (matrix) to 1D stream?

      thanks.

        • Brook+ and OpenCL
          nou

          do you used Brook before? if not then forget about it.

          to get 2D you have two options. regular buffer and image2d_t.

          with buffer you just flaten it from 2D into 1D. like array[y*width+x];

          with image2d_t you put x,y as int2 vector into write/read_image functions.

            • Brook+ and OpenCL
              erman_amd

              I learn StreamC before (used for programming Imagine stream processor). I think the concept is almost the same with Brook+.

              It represents inputs as 1D stream, process it on the kernel, and write to output stream. I'm not sure whether the concept can be applied directly to OpenCL data parallel programming because when it seems the example provided in OpenCL is excuted using 2D NDRange.

              btw, i will try the "array[y*width+x]". The x is get_global_id(0) and y is get_global_id(1), right?