Results 1 to 2 of 2

Thread: Do I have coalsecing access?

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    13

    Do I have coalsecing access?

    Hi,

    I have a kernel and in this kernel I am accessing 3 arrays(a,b,T) stored in global memory:

    do I have coalescing access in array a, b, T?

    T[5], b[15], a[30], col =5, and I have 6 thread.

    thread 0,1 --> idx =0, so these thread will access:
    thread 0: b[0] to b[4] , T[0] to T[4] , a[0] to a[4]
    thread 1: b[0] to b[4] , T[0] to T[4] , a[5] to a[9]

    thread 2,3 --> idx =5, so these thread will access:
    thread 2: b[5] to b[9] , T[0] to T[4] , a[10] to a[14]
    thread 3: b[5] to b[9] , T[0] to T[4] , a[15] to a[19]

    thread 4,5 --> idx =10, so these thread will access:
    thread 4: b[10] to b[14] , T[0] to T[4] , a[20] to a[24]
    thread 5: b[10] to b[14] , T[0] to T[4] , a[25] to a[29]


    Hopefully this is clear, do I have coalescing access for all of these array? and is it possible to have coalescing access to some of them and not to others?




    Code :
    {
        const int i = get_global_id(0);
     
            float result = 1;
            for (int j = 0; j < col; ++j)
            {
                result *=  b[j + idx] * a[i*col + j]) + T[j];
            }      
    }

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Do I have coalsecing access?

    Coalesced memory accesses are simple to understand: if consecutive work-items access consecutive memory locations then that memory access is coalesced.

    This does not appear to be the case in the example you have provided.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. Memory Access
    By lcnepo in forum OpenCL
    Replies: 1
    Last Post: 12-09-2010, 04:22 PM

Posting Permissions

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