Results 1 to 4 of 4

Thread: Which memory is user for buffer object allocation ?

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    2

    Which memory is user for buffer object allocation ?

    hello every one,

    I'm new to the OpenCL , and my question is about the memory that is used by default for the allocation of buffer object. The 1.1 Specification is not very clear on this point.

    Thanks in advance.

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

    Re: Which memory is user for buffer object allocation ?

    Buffer objects live in global memory. That means that both the host (CPU) and the device (GPU, etc) can read and write from buffer objects.

    I'm not sure if that answers your question. Can you rephrase it?
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Oct 2010
    Posts
    2

    Re: Which memory is user for buffer object allocation ?

    Thanks for the replay!
    My question is about the memory (Global, Local or Private) that is used for the buffer allocation. The spec are not very clear at this point
    OpenCL 1.1 spec page 58 :

    CL_MEM_ALLOC_HOST_PTR
    This flag specifies that the application wants the OpenCL
    implementation to allocate memory from host accessible
    memory.
    does this mean that other flags allocate buffer in memory that is not accessible to the host ?
    In my thinking if buffers are systematically allocated in the host memory this could lead to a serious performances issue for kernel accessing it (unless global memory is cached?)

    thanks!

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

    Re: Which memory is user for buffer object allocation ?

    does this mean that other flags allocate buffer in memory that is not accessible to the host ?
    Yes. If you use the CL_MEM_ALLOC_HOST_PTR flag then clEnqueueMapBuffer() is guaranteed to work. If you don't pass that flag then clEnqueueMapBuffer() can fail and return CL_MAP_FAILURE.

    In my thinking if buffers are systematically allocated in the host memory this could lead to a serious performances issue for kernel accessing it (unless global memory is cached?)
    Yes, you got it right
    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 object allocation
    By zhugh in forum OpenCL
    Replies: 1
    Last Post: 12-18-2010, 03:42 PM
  2. Replies: 7
    Last Post: 11-24-2010, 11:26 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
  •