Results 1 to 2 of 2

Thread: Do host allocated buffers need to be manually deallocated?

  1. #1
    sean.settle
    Guest

    Do host allocated buffers need to be manually deallocated?

    If a buffer is created with CL_MEM_ALLOC_HOST_PTR, does that buffer have to be manually deallocated, or is that automatically done inside of clReleaseMemObject when its counter reaches zero? Similarly, if I use the C++ API wrapper, would a buffer object going out of scope automatically deallocate the host allocated memory? I appreciate the help clarifying this for me.

  2. #2
    affie
    Guest

    Re: Do host allocated buffers need to be manually deallocate

    The buffer does not have to be manually deallocated. All you need to is release the buffer using clReleaseMemObject. When the cl_mem object is released by the OpenCL implementation the allocated data storage will also be freed.

Similar Threads

  1. Dynamically allocated shared memory
    By DP007 in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 2
    Last Post: 11-30-2009, 02:17 AM
  2. mapping buffers vs using host pointers
    By acolubri in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 5
    Last Post: 08-08-2009, 03:28 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
  •