summaryrefslogtreecommitdiff
path: root/include/CL
diff options
context:
space:
mode:
authorSimon Richter <Simon.Richter@hogyros.de>2013-04-22 11:26:27 +0200
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-04-22 18:04:32 +0800
commit003fac5485d480e107e6698581dbd94b531495b5 (patch)
tree24fc9947ff329b75a582798b6cab6234c5b8315c /include/CL
parentb98a213e7bcb750c25139d43e9f85c3ef4ed65b5 (diff)
downloadbeignet-003fac5485d480e107e6698581dbd94b531495b5.tar.gz
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 <Simon.Richter@hogyros.de> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'include/CL')
-rw-r--r--include/CL/cl_intel.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/CL/cl_intel.h b/include/CL/cl_intel.h
index bee21e29..135e3403 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