Results 1 to 2 of 2

Thread: Shared Memory questions

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    15

    Shared Memory questions

    Hi,

    I'm a bit confused about the shared memory in OpenCL.
    It has 16 KBytes and shares data between kernels in the same work group.
    So, are there several shared memories(for each work group) and every work group has 16 KBytes or is shared memory splitted?
    Furthermore I don't understand how it exists on the hardware: The number of work groups is variable, so how could that be managed?
    I think I didn't understand the main concept of this memory, but I hope someone someone can explain, what I am not understanding

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: Shared Memory questions

    Each work-group has a shared memory. That memory is only available to the work-items inside the work-group. It can not be saved across kernel invocations.

    The implementation details vary by hardware platform. For example, on Nvidia, there is a physical memory associated with each streaming multiprocessor (compute unit) on the card, and while a work-group is running on that compute unit all its work-items have access to that local memory. On CPU implementations the local memory is just emulated by malloc'ing a region of memory and pointing the correct work-items to it.

    This memory allows you a work-group to load data from global memory and (potentially) access it much faster. If you have a known set of data that you are going to reuse a lot, then you can get tremendous (10x) bandwidth improvements by using the local memory on some architectures. Remember that you need to have a enough reuse to amortize the cost of copying it to the local memory in the first place, and this is a software-managed memory so it's generally a pain to program.

Similar Threads

  1. shared memory question
    By jai in forum OpenCL
    Replies: 1
    Last Post: 11-01-2012, 07:39 AM
  2. can't re-use shared memory in ATI 5870?
    By deNorma in forum OpenCL
    Replies: 2
    Last Post: 02-04-2010, 02:55 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
  •