Results 1 to 2 of 2

Thread: Memory object allocation

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    7

    Memory object allocation

    If you create a memory object with clCreateBuffer or clCreateImage2D/3D, is the memory immediately allocated on the device? Or is it allocated when you make the memory object a kernel argument and execute the kernel?

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

    Re: Memory object allocation

    If you create a memory object with clCreateBuffer or clCreateImage2D/3D, is the memory immediately allocated on the device? Or is it allocated when you make the memory object a kernel argument and execute the kernel?
    That is an excellent question. The OpenCL driver can choose one or the other, and unfortunately there is no way for the application to query which method is used.

    If the OpenCL implementation you are using delays the allocations until they are needed, you can find that calling clEnqueueNDRange() or clEnqueueTask() return CL_OUT_OF_RESOURCES if there's not enough memory in the device to allocate those buffers or images.
    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. Replies: 7
    Last Post: 11-24-2010, 11:26 AM
  2. Replies: 3
    Last Post: 10-13-2010, 09:47 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
  •