From: Simon Richter Date: Mon, 22 Apr 2013 09:26:27 +0000 (+0200) Subject: Add typedefs for extension functions X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=003fac5485d480e107e6698581dbd94b531495b5;p=contrib%2Fbeignet.git Add typedefs for extension functions This allows application programs to cast the pointer returned from clGetExtensionFunctionAddress to the appropriate function pointer type. Signed-off-by: Simon Richter Reviewed-by: Zhigang Gong --- diff --git a/include/CL/cl_intel.h b/include/CL/cl_intel.h index bee21e2..135e340 100644 --- a/include/CL/cl_intel.h +++ b/include/CL/cl_intel.h @@ -32,32 +32,49 @@ extern "C" { extern CL_API_ENTRY cl_int CL_API_CALL clReportUnfreedIntel(void); +typedef CL_API_ENTRY cl_int (CL_API_CALL *clReportUnfreedIntel_fn)(void); + /* 1 to 1 mapping of drm_intel_bo_map */ extern CL_API_ENTRY void* CL_API_CALL clMapBufferIntel(cl_mem, cl_int*); +typedef CL_API_ENTRY void* (CL_API_CALL *clMapBufferIntel_fn)(cl_mem, cl_int*); + /* 1 to 1 mapping of drm_intel_bo_unmap */ extern CL_API_ENTRY cl_int CL_API_CALL clUnmapBufferIntel(cl_mem); +typedef CL_API_ENTRY cl_int (CL_API_CALL *clUnmapBufferIntel_fn)(cl_mem); + /* 1 to 1 mapping of drm_intel_gem_bo_map_gtt */ extern CL_API_ENTRY void* CL_API_CALL clMapBufferGTTIntel(cl_mem, cl_int*); +typedef CL_API_ENTRY void* (CL_API_CALL *clMapBufferGTTIntel_fn)(cl_mem, cl_int*); + /* 1 to 1 mapping of drm_intel_gem_bo_unmap_gtt */ extern CL_API_ENTRY cl_int CL_API_CALL clUnmapBufferGTTIntel(cl_mem); +typedef CL_API_ENTRY cl_int (CL_API_CALL *clUnmapBufferGTTIntel_fn)(cl_mem); + /* Pin /Unpin the buffer in GPU memory (must be root) */ extern CL_API_ENTRY cl_int CL_API_CALL clPinBufferIntel(cl_mem); extern CL_API_ENTRY cl_int CL_API_CALL clUnpinBufferIntel(cl_mem); +typedef CL_API_ENTRY cl_int (CL_API_CALL *clPinBufferIntel_fn)(cl_mem); +typedef CL_API_ENTRY cl_int (CL_API_CALL *clUnpinBufferIntel_fn)(cl_mem); + /* Get the generation of the Gen device (used to load the proper binary) */ extern CL_API_ENTRY cl_int CL_API_CALL clGetGenVersionIntel(cl_device_id device, cl_int *ver); +typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGenVersionIntel_fn)( + cl_device_id device, + cl_int *ver); + /* Create a program from a LLVM source file */ extern CL_API_ENTRY cl_program CL_API_CALL clCreateProgramWithLLVMIntel(cl_context /* context */, @@ -66,6 +83,13 @@ clCreateProgramWithLLVMIntel(cl_context /* context */, const char * /* file */, cl_int * /* errcode_ret */); +typedef CL_API_ENTRY cl_program (CL_API_CALL *clCreateProgramWithLLVMIntel_fn)( + cl_context /* context */, + cl_uint /* num_devices */, + const cl_device_id * /* device_list */, + const char * /* file */, + cl_int * /* errcode_ret */); + #ifdef __cplusplus } #endif