Results 1 to 7 of 7

Thread: max local array size?

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    14

    max local array size?

    Hi, I'm just wondering how to check for the max local array size ?

  2. #2
    Senior Member
    Join Date
    Nov 2009
    Posts
    118

    Re: max local array size?

    You want to know local memory size (CL_DEVICE_LOCAL_MEM_SIZE from clDevice)?

  3. #3
    Senior Member
    Join Date
    Sep 2002
    Location
    Santa Clara
    Posts
    105

    Re: max local array size?

    CL_DEVICE_LOCAL_MEM_SIZE for device is a good way to determine max. local memory size supported by the device. The amount of local memory that you can use can vary per kernel. To query the amount of local memory that is currently being used by a kernel you can use clGetKernelWorkGroupInfo(kernel, CL_KERNEL_LOCAL_MEM_SIZE, ...). The total amount of local memory that can be used cannot exceed CL_DEVICE_LOCAL_MEM_SIZE.

  4. #4
    Senior Member
    Join Date
    Nov 2009
    Posts
    118

    Re: max local array size?

    "being used by a kernel" and that will be used by this kernel at execution.

  5. #5
    Junior Member
    Join Date
    Jun 2010
    Posts
    9

    Re: max local array size?

    u can check it by CL_DEVICE_LOCAL_MEM_SIZE argument

  6. #6
    Junior Member
    Join Date
    Jul 2011
    Posts
    5

    Re: max local array size?

    Hello,
    I think I have a similar wish but Im not sure how to describe my problem.

    My situation:
    I have for example 10000 Items to be handled and I want to make use of __local memory to speed up. Therefore I create local buffer f.e. like this
    __kernel void test(__global MyStruct in_MyStruct)
    {
    __local MyStruct l_SharedMemory[FIXED_SIZE]
    // make calculations
    ..
    }

    FIXED_SIZE depends on the hardware Im running. Therefore I thought get CL_KERNEL_WORK_GROUP_SIZE with clGetKernelWorkGroupInfo and use the result to find the optimal value for FIXED. Afterwards passing FIXED as a compiler option when calling clCreateKernel. Theoretically a good idea - the problem is that for clGetKernelWorkGroupInfo I need a kernel which isnt created at that time. Any ideas how to find a correct value for fixed size?!?!?!

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

    Re: max local array size?

    Why not use CL_DEVICE_LOCAL_MEM_SIZE, which doesn't require building a kernel?

    Alternatively, you can pass the local variable as a kernel argument instead of declaring it as a variable at function scope.
    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. OpenCL Ndrange Global Size/Local Size
    By BiS in forum OpenCL
    Replies: 4
    Last Post: 01-04-2013, 07:52 AM
  2. Image2d max size
    By chritolb29 in forum OpenCL
    Replies: 3
    Last Post: 04-12-2012, 05:19 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
  •