View Full Version : Do host allocated buffers need to be manually deallocated?
08-22-2012, 06:32 AM
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.
08-22-2012, 08:56 AM
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.