summaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2009-09-10 01:57:52 +0200
committerMichael Bien <[email protected]>2009-09-10 01:57:52 +0200
commit2019f0de6f0299a61189d9c82e895d374dfc4d9d (patch)
tree4356f42aac488a22472f77052528b0665255b43d /resources
parentec4e5277a8d93a232c60946075aab1da2bb6b0c8 (diff)
mapped pointers to longs for internal use as handles
Diffstat (limited to 'resources')
-rw-r--r--resources/OpenCL.cfg11
-rw-r--r--resources/cl.h358
2 files changed, 189 insertions, 180 deletions
diff --git a/resources/OpenCL.cfg b/resources/OpenCL.cfg
index f9aee405..03c89280 100644
--- a/resources/OpenCL.cfg
+++ b/resources/OpenCL.cfg
@@ -15,10 +15,19 @@ JavaClass CL
JavaOutputDir gensrc/java
NativeOutputDir gensrc/native
+#map pointers to long as internal representation
+Opaque long cl_context
Opaque long cl_device_type
+Opaque long cl_command_queue
+Opaque long cl_mem
+Opaque long cl_program
+Opaque long cl_kernel
+Opaque long cl_event
+Opaque long cl_sampler
+
Opaque int cl_platform_id
Opaque int cl_device_id
-Opaque long cl_context
#append to generated c files
CustomCCode #include <cl.h>
+#CustomCCode #include <CL/stdint.h>
diff --git a/resources/cl.h b/resources/cl.h
index 1c88a110..d353f9ad 100644
--- a/resources/cl.h
+++ b/resources/cl.h
@@ -574,14 +574,14 @@ clCreateProgramWithSource(cl_context /* context */,
const size_t * /* lengths */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
-//extern CL_API_ENTRY cl_program CL_API_CALL
-//clCreateProgramWithBinary(cl_context /* context */,
-// cl_uint /* num_devices */,
-// const cl_device_id * /* device_list */,
-// const size_t * /* lengths */,
-// const unsigned char ** /* binaries */,
-// cl_int * /* binary_status */,
-// cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
+extern CL_API_ENTRY cl_program CL_API_CALL
+clCreateProgramWithBinary(cl_context /* context */,
+ cl_uint /* num_devices */,
+ const cl_device_id * /* device_list */,
+ const size_t * /* lengths */,
+ const unsigned char ** /* binaries */,
+ cl_int * /* binary_status */,
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
@@ -621,11 +621,11 @@ clCreateKernel(cl_program /* program */,
const char * /* kernel_name */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clCreateKernelsInProgram(cl_program /* program */,
-// cl_uint /* num_kernels */,
-// cl_kernel * /* kernels */,
-// cl_uint * /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
+extern CL_API_ENTRY cl_int CL_API_CALL
+clCreateKernelsInProgram(cl_program /* program */,
+ cl_uint /* num_kernels */,
+ cl_kernel * /* kernels */,
+ cl_uint * /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
@@ -655,9 +655,9 @@ clGetKernelWorkGroupInfo(cl_kernel /* kernel */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
// Event Object APIs
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clWaitForEvents(cl_uint /* num_events */,
-// const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
+extern CL_API_ENTRY cl_int CL_API_CALL
+clWaitForEvents(cl_uint /* num_events */,
+ const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetEventInfo(cl_event /* event */,
@@ -688,170 +688,170 @@ extern CL_API_ENTRY cl_int CL_API_CALL
clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
// Enqueued Commands APIs
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueReadBuffer(cl_command_queue /* command_queue */,
-// cl_mem /* buffer */,
-// cl_bool /* blocking_read */,
-// size_t /* offset */,
-// size_t /* cb */,
-// void * /* ptr */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueWriteBuffer(cl_command_queue /* command_queue */,
-// cl_mem /* buffer */,
-// cl_bool /* blocking_write */,
-// size_t /* offset */,
-// size_t /* cb */,
-// const void * /* ptr */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueCopyBuffer(cl_command_queue /* command_queue */,
-// cl_mem /* src_buffer */,
-// cl_mem /* dst_buffer */,
-// size_t /* src_offset */,
-// size_t /* dst_offset */,
-// size_t /* cb */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueReadImage(cl_command_queue /* command_queue */,
-// cl_mem /* image */,
-// cl_bool /* blocking_read */,
-// const size_t * /* origin[3] */,
-// const size_t * /* region[3] */,
-// size_t /* row_pitch */,
-// size_t /* slice_pitch */,
-// void * /* ptr */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueWriteImage(cl_command_queue /* command_queue */,
-// cl_mem /* image */,
-// cl_bool /* blocking_write */,
-// const size_t * /* origin[3] */,
-// const size_t * /* region[3] */,
-// size_t /* input_row_pitch */,
-// size_t /* input_slice_pitch */,
-// const void * /* ptr */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueCopyImage(cl_command_queue /* command_queue */,
-// cl_mem /* src_image */,
-// cl_mem /* dst_image */,
-// const size_t * /* src_origin[3] */,
-// const size_t * /* dst_origin[3] */,
-// const size_t * /* region[3] */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */,
-// cl_mem /* src_image */,
-// cl_mem /* dst_buffer */,
-// const size_t * /* src_origin[3] */,
-// const size_t * /* region[3] */,
-// size_t /* dst_offset */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */,
-// cl_mem /* src_buffer */,
-// cl_mem /* dst_image */,
-// size_t /* src_offset */,
-// const size_t * /* dst_origin[3] */,
-// const size_t * /* region[3] */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY void * CL_API_CALL
-//clEnqueueMapBuffer(cl_command_queue /* command_queue */,
-// cl_mem /* buffer */,
-// cl_bool /* blocking_map */,
-// cl_map_flags /* map_flags */,
-// size_t /* offset */,
-// size_t /* cb */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */,
-// cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY void * CL_API_CALL
-//clEnqueueMapImage(cl_command_queue /* command_queue */,
-// cl_mem /* image */,
-// cl_bool /* blocking_map */,
-// cl_map_flags /* map_flags */,
-// const size_t * /* origin[3] */,
-// const size_t * /* region[3] */,
-// size_t * /* image_row_pitch */,
-// size_t * /* image_slice_pitch */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */,
-// cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
-// cl_mem /* memobj */,
-// void * /* mapped_ptr */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
-// cl_kernel /* kernel */,
-// cl_uint /* work_dim */,
-// const size_t * /* global_work_offset */,
-// const size_t * /* global_work_size */,
-// const size_t * /* local_work_size */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueTask(cl_command_queue /* command_queue */,
-// cl_kernel /* kernel */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueNativeKernel(cl_command_queue /* command_queue */,
-// void (*user_func)(void *),
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueReadBuffer(cl_command_queue /* command_queue */,
+ cl_mem /* buffer */,
+ cl_bool /* blocking_read */,
+ size_t /* offset */,
+ size_t /* cb */,
+ void * /* ptr */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueWriteBuffer(cl_command_queue /* command_queue */,
+ cl_mem /* buffer */,
+ cl_bool /* blocking_write */,
+ size_t /* offset */,
+ size_t /* cb */,
+ const void * /* ptr */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueCopyBuffer(cl_command_queue /* command_queue */,
+ cl_mem /* src_buffer */,
+ cl_mem /* dst_buffer */,
+ size_t /* src_offset */,
+ size_t /* dst_offset */,
+ size_t /* cb */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueReadImage(cl_command_queue /* command_queue */,
+ cl_mem /* image */,
+ cl_bool /* blocking_read */,
+ const size_t * /* origin[3] */,
+ const size_t * /* region[3] */,
+ size_t /* row_pitch */,
+ size_t /* slice_pitch */,
+ void * /* ptr */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueWriteImage(cl_command_queue /* command_queue */,
+ cl_mem /* image */,
+ cl_bool /* blocking_write */,
+ const size_t * /* origin[3] */,
+ const size_t * /* region[3] */,
+ size_t /* input_row_pitch */,
+ size_t /* input_slice_pitch */,
+ const void * /* ptr */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueCopyImage(cl_command_queue /* command_queue */,
+ cl_mem /* src_image */,
+ cl_mem /* dst_image */,
+ const size_t * /* src_origin[3] */,
+ const size_t * /* dst_origin[3] */,
+ const size_t * /* region[3] */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */,
+ cl_mem /* src_image */,
+ cl_mem /* dst_buffer */,
+ const size_t * /* src_origin[3] */,
+ const size_t * /* region[3] */,
+ size_t /* dst_offset */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */,
+ cl_mem /* src_buffer */,
+ cl_mem /* dst_image */,
+ size_t /* src_offset */,
+ const size_t * /* dst_origin[3] */,
+ const size_t * /* region[3] */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY void * CL_API_CALL
+clEnqueueMapBuffer(cl_command_queue /* command_queue */,
+ cl_mem /* buffer */,
+ cl_bool /* blocking_map */,
+ cl_map_flags /* map_flags */,
+ size_t /* offset */,
+ size_t /* cb */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */,
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY void * CL_API_CALL
+clEnqueueMapImage(cl_command_queue /* command_queue */,
+ cl_mem /* image */,
+ cl_bool /* blocking_map */,
+ cl_map_flags /* map_flags */,
+ const size_t * /* origin[3] */,
+ const size_t * /* region[3] */,
+ size_t * /* image_row_pitch */,
+ size_t * /* image_slice_pitch */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */,
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
+ cl_mem /* memobj */,
+ void * /* mapped_ptr */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
+ cl_kernel /* kernel */,
+ cl_uint /* work_dim */,
+ const size_t * /* global_work_offset */,
+ const size_t * /* global_work_size */,
+ const size_t * /* local_work_size */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueTask(cl_command_queue /* command_queue */,
+ cl_kernel /* kernel */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueNativeKernel(cl_command_queue /* command_queue */,
+// void (*user_func)(void *),
// void * /* args */,
-// size_t /* cb_args */,
-// cl_uint /* num_mem_objects */,
-// const cl_mem * /* mem_list */,
-// const void ** /* args_mem_loc */,
-// cl_uint /* num_events_in_wait_list */,
-// const cl_event * /* event_wait_list */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueMarker(cl_command_queue /* command_queue */,
-// cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-
-//extern CL_API_ENTRY cl_int CL_API_CALL
-//clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
-// cl_uint /* num_events */,
-// const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
+ size_t /* cb_args */,
+ cl_uint /* num_mem_objects */,
+ const cl_mem * /* mem_list */,
+ const void ** /* args_mem_loc */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueMarker(cl_command_queue /* command_queue */,
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
+ cl_uint /* num_events */,
+ const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;