Results 1 to 2 of 2

Thread: Array reduction example

  1. #1

    Array reduction example

    Hello there, I'm having some trouble with the Array Reduction example in the specification.

    The kernel, in the final stages of its reduction starts to sum up the stored sums in local memory. At first it is checking if it is in the lower half of the pairs begin summed

    Code :
    #if (GROUP_SIZE >= 512)
    if (lid < 256)
    shared[lid] += shared[lid + 256];
    barrrier(CLK_LOCAL_MEM_FENCE);
    #endif

    That's fine by me. What twists my nugget is that you cease to check if you're in the lower half once your local ID is smaller than 32?

    Code :
    if (lid < 32)
    {
    #if (GROUP_SIZE >= 64)
    shared[lid] += shared[lid + 32];
    barrier(CLK_LOCAL_MEM_FENCE);
    #endif
    #if (GROUP_SIZE >= 32)
    shared[lid] += shared[lid + 16];
    barrier(CLK_LOCAL_MEM_FENCE);
    #endif
    .....
    }

    I found the Apple example code here, and their kernel still checks if they're in the lower half.

    Can some one please tell me if I've missed something?

  2. #2
    Junior Member
    Join Date
    Nov 2009
    Posts
    1

    Re: Array reduction example

    Hello All
    I am Mathew I have problem of Array,I am getting its properly work in program,Anyone can help me give me the some basic program Example of Array list..
    Example of Array Reduction Is Really very Nice..I like this method.
    Thanks..
    R4games

Similar Threads

  1. dot product of two vectors using reduction
    By shahsaurabh1990 in forum OpenCL
    Replies: 1
    Last Post: 02-01-2013, 09:15 AM
  2. Reduction within one work item
    By unknown in forum OpenCL
    Replies: 0
    Last Post: 01-06-2013, 04:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •