Gamaru / clutil

Automatically exported from code.google.com/p/clutil
0 stars 0 forks source link

Add support for host pointer #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
We want to optionally be able to have alloc just map to an existing host 
pointer via CL_MEM_USE_HOST_PTR. This will be an optimization for OpenCL 
kernels running on the CPU or a shared memory architecture like AMD Fusion.

Basically, we should change

static cl_int alloc(size_t bytes, cl_mem* gpuBuffer);

to

static cl_int alloc(size_t bytes, cl_mem* gpuBuffer, void* hostPointer = NULL);

and add logic to set CL_MEM_USE_HOST_PTR when hostPointer is not NULL.

Original issue reported on code.google.com by rick.web...@gmail.com on 20 Dec 2010 at 9:39