aboutsummaryrefslogtreecommitdiffstats
path: root/make/config
diff options
context:
space:
mode:
Diffstat (limited to 'make/config')
-rw-r--r--make/config/cl-buffer-if.cfg13
-rw-r--r--make/config/cl-common.cfg120
-rw-r--r--make/config/cl-context-if.cfg23
-rw-r--r--make/config/cl-device-if.cfg12
-rw-r--r--make/config/cl-event-if.cfg17
-rw-r--r--make/config/cl-if.cfg42
-rw-r--r--make/config/cl-image-if.cfg16
-rw-r--r--make/config/cl-impl.cfg95
-rw-r--r--make/config/cl-kernel-if.cfg12
-rw-r--r--make/config/cl-mem-if.cfg18
-rw-r--r--make/config/cl-platform-if.cfg12
-rw-r--r--make/config/cl-program-if.cfg18
-rw-r--r--make/config/cl-queue-if.cfg12
-rw-r--r--make/config/cl-sampler-if.cfg12
-rw-r--r--make/config/clImplCustomCode.c435
-rw-r--r--make/config/clImplCustomCode.java53
-rw-r--r--make/config/clgl-if.cfg26
-rw-r--r--make/config/createTagletProps.sh14
-rw-r--r--make/config/native-taglet.properties93
19 files changed, 1043 insertions, 0 deletions
diff --git a/make/config/cl-buffer-if.cfg b/make/config/cl-buffer-if.cfg
new file mode 100644
index 00000000..197ef54d
--- /dev/null
+++ b/make/config/cl-buffer-if.cfg
@@ -0,0 +1,13 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+ClassJavadoc CLBufferBinding /**
+ClassJavadoc CLBufferBinding * Java bindings to OpenCL buffers.
+ClassJavadoc CLBufferBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLBufferBinding */
+JavaClass CLBufferBinding
+
+Extends CLBufferBinding CLMemObjBinding
+
+IgnoreNot .*CreateBuffer.*|.*CreateSubBuffer.*
diff --git a/make/config/cl-common.cfg b/make/config/cl-common.cfg
new file mode 100644
index 00000000..d89643b9
--- /dev/null
+++ b/make/config/cl-common.cfg
@@ -0,0 +1,120 @@
+JavaOutputDir gensrc/java
+NativeOutputDir gensrc/native
+
+Package com.jogamp.opencl.llb
+
+#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 long cl_platform_id
+Opaque long cl_device_id
+Opaque long cl_GLsync
+
+ArgumentIsString clCreateProgramWithSource 2
+ArgumentIsString clBuildProgram 3
+ArgumentIsString clCreateKernel 1
+
+#common ignore
+Ignore clGetExtensionFunctionAddress
+Ignore CL_UINT_MAX
+Ignore CL_LONG_MAX
+Ignore CL_LONG_MIN
+Ignore CL_ULONG_MAX
+
+
+#use IllegalArgumentException for argument validation
+RuntimeExceptionType IllegalArgumentException
+
+#enforce client side "good behavior" by generating direct-memory-only bindings for
+#performance critical functions.
+#NioDirectOnly __ALL__
+
+#command queue ops
+NioDirectOnly clEnqueueBarrier
+NioDirectOnly clEnqueueCopyBuffer
+NioDirectOnly clEnqueueCopyBufferRect
+NioDirectOnly clEnqueueCopyBufferToImage
+NioDirectOnly clEnqueueCopyImage
+NioDirectOnly clEnqueueCopyImageToBuffer
+NioDirectOnly clEnqueueMapBuffer
+NioDirectOnly clEnqueueMapImage
+NioDirectOnly clEnqueueMarker
+NioDirectOnly clEnqueueNDRangeKernel
+NioDirectOnly clEnqueueReadBuffer
+NioDirectOnly clEnqueueReadBufferRect
+NioDirectOnly clEnqueueReadImage
+NioDirectOnly clEnqueueTask
+NioDirectOnly clEnqueueUnmapMemObject
+NioDirectOnly clEnqueueWaitForEvents
+NioDirectOnly clEnqueueWriteBuffer
+NioDirectOnly clEnqueueWriteBufferRect
+NioDirectOnly clEnqueueWriteImage
+NioDirectOnly clEnqueueAcquireGLObjects
+NioDirectOnly clEnqueueReleaseGLObjects
+#kernel ops
+NioDirectOnly clSetKernelArg
+
+#temporary disable all functions containing long[] until 32bit compatibility is fixed
+NioDirectOnly clCreateKernelsInProgram
+NioDirectOnly clCreateProgramWithBinary
+NioDirectOnly clCreateProgramWithSource
+#NioDirectOnly clCreateBuffer
+#NioDirectOnly clCreateUserEvent
+
+NioDirectOnly clGetCommandQueueInfo
+NioDirectOnly clGetContextInfo
+NioDirectOnly clGetDeviceIDs
+NioDirectOnly clGetDeviceInfo
+NioDirectOnly clGetEventInfo
+NioDirectOnly clGetEventProfilingInfo
+NioDirectOnly clGetImageInfo
+NioDirectOnly clGetKernelInfo
+NioDirectOnly clGetKernelWorkGroupInfo
+NioDirectOnly clGetMemObjectInfo
+NioDirectOnly clGetPlatformIDs
+NioDirectOnly clGetPlatformInfo
+NioDirectOnly clGetProgramBuildInfo
+NioDirectOnly clGetProgramInfo
+NioDirectOnly clGetSamplerInfo
+#NioDirectOnly clGetSupportedImageFormats
+
+NioDirectOnly clSetCommandQueueProperty
+NioDirectOnly clWaitForEvents
+#NioDirectOnly clCreateContext
+#NioDirectOnly clBuildProgram
+NioDirectOnly clIcdGetPlatformIDsKHR
+
+#extensions
+NioDirectOnly clGetGLContextInfoKHR
+#NioDirectOnly clCreateSubDevicesEXT
+
+
+#common rename emitted struct accessors
+#struct cl_image_format
+RenameJavaType cl_image_format CLImageFormatImpl
+StructPackage cl_image_format com.jogamp.opencl.llb.impl
+
+#struct fields ([set|get]+FieldName())
+RenameJavaMethod image_channel_order imageChannelOrder
+RenameJavaMethod image_channel_data_type imageChannelDataType
+
+
+ClassJavadoc CLImageFormatImpl /**
+ClassJavadoc CLImageFormatImpl * Struct accessor for cl_image_format.
+ClassJavadoc CLImageFormatImpl * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLImageFormatImpl */
+
+
+# Pick up on-line OpenCL doc and link it with the javadoc
+TagNativeBinding true
+
+# platform dependent extensions
+Ignore .*APPLE.*
+
+Ignore nanf
diff --git a/make/config/cl-context-if.cfg b/make/config/cl-context-if.cfg
new file mode 100644
index 00000000..0e9a5617
--- /dev/null
+++ b/make/config/cl-context-if.cfg
@@ -0,0 +1,23 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+Import com.jogamp.opencl.llb.impl.CLImageFormatImpl
+Import com.jogamp.opencl.CLErrorHandler
+
+ClassJavadoc CLContextBinding /**
+ClassJavadoc CLContextBinding * Java bindings to OpenCL contexts.
+ClassJavadoc CLContextBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLContextBinding */
+JavaClass CLContextBinding
+
+IgnoreNot clGetSupportedImageFormats.*|.*GetContextInfo.*|.*RetainContext.*|.*ReleaseContext.*|CL_CONTEXT_.*
+
+#custom implementations
+CustomJavaCode CLContextBinding
+CustomJavaCode CLContextBinding /** Interface to C language function: <br> <code> cl_context {@native clCreateContext}(intptr_t * , uint32_t, cl_device_id * , void (*pfn_notify)(const char *, const void *, size_t, void *), void *, int32_t * ); </code> */
+CustomJavaCode CLContextBinding public long clCreateContext(PointerBuffer properties, PointerBuffer devices, CLErrorHandler pfn_notify, IntBuffer errcode_ret);
+
+CustomJavaCode CLContextBinding
+CustomJavaCode CLContextBinding /** Interface to C language function: <br> <code> cl_context {@native clCreateContextFromType}(cl_context_properties *properties, cl_device_type device_type, void (*pfn_notify)(const char *errinfo, const void *private_info, size_t cb, void *user_data), void *user_data, cl_int *errcode_ret) ; </code> */
+CustomJavaCode CLContextBinding public long clCreateContextFromType(PointerBuffer properties, long device_type, CLErrorHandler pfn_notify, IntBuffer errcode_ret);
diff --git a/make/config/cl-device-if.cfg b/make/config/cl-device-if.cfg
new file mode 100644
index 00000000..a32476ca
--- /dev/null
+++ b/make/config/cl-device-if.cfg
@@ -0,0 +1,12 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+ClassJavadoc CLDeviceBinding /**
+ClassJavadoc CLDeviceBinding * Java bindings to OpenCL devices.
+ClassJavadoc CLDeviceBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLDeviceBinding */
+JavaClass CLDeviceBinding
+
+IgnoreNot .*CreateSubDevice.*|.*GetDeviceInfo.*|.*RetainDevice.*|.*ReleaseDevice.*|CL_DEVICE_.*|CL_FP_.*|CL_GLOBAL|CL_LOCAL|CL_READ_.*_CACHE
+
diff --git a/make/config/cl-event-if.cfg b/make/config/cl-event-if.cfg
new file mode 100644
index 00000000..87b55bfd
--- /dev/null
+++ b/make/config/cl-event-if.cfg
@@ -0,0 +1,17 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+import com.jogamp.opencl.llb.impl.CLEventCallback
+
+ClassJavadoc CLEventBinding /**
+ClassJavadoc CLEventBinding * Java bindings to OpenCL events.
+ClassJavadoc CLEventBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLEventBinding */
+JavaClass CLEventBinding
+
+IgnoreNot .*CreateUserEvent.*|.*GetEventInfo.*|.*GetEventProfilingInfo.*|.*SetUserEventStatus.*|clWaitForEvents.*|.*RetainEvent.*|.*ReleaseEvent.*|CL_EVENT_.*
+
+CustomJavaCode CLEventBinding
+CustomJavaCode CLEventBinding /** Interface to C language function: <br> <code> int32_t {@native clSetEventCallback}(cl_event event, cl_int command_exec_callback_type, void (CL_CALLBACK *pfn_event_notify) (cl_event event, cl_int event_command_exec_status, void *user_data), void *user_data); </code> */
+CustomJavaCode CLEventBinding public int clSetEventCallback(long event, int type, CLEventCallback cb);
diff --git a/make/config/cl-if.cfg b/make/config/cl-if.cfg
new file mode 100644
index 00000000..2078123a
--- /dev/null
+++ b/make/config/cl-if.cfg
@@ -0,0 +1,42 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+ClassJavadoc CL /**
+ClassJavadoc CL * Java bindings to OpenCL, the Open Computing Language.
+ClassJavadoc CL * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CL */
+JavaClass CL
+
+Extends CL CLContextBinding
+Extends CL CLProgramBinding
+Extends CL CLKernelBinding
+Extends CL CLCommandQueueBinding
+Extends CL CLDeviceBinding
+Extends CL CLImageBinding
+Extends CL CLBufferBinding
+Extends CL CLSamplerBinding
+Extends CL CLEventBinding
+Extends CL CLPlatformBinding
+
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLContextBinding.java
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLProgramBinding.java
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLKernelBinding.java
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLCommandQueueBinding.java
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLDeviceBinding.java
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLMemObjBinding.java
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLImageBinding.java
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLBufferBinding.java
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLSamplerBinding.java
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLEventBinding.java
+ExtendedInterfaceSymbolsIgnore ../build/gensrc/java/com/jogamp/opencl/llb/CLPlatformBinding.java
+
+#ignore cl-gl interoperability functions. Interface 'CL' is pure OpenCL.
+Ignore CL_GL_.*|cl.*GL.*|.*_GL_.*
+
+Ignore clCreateContext
+Ignore clCreateContextFromType
+Ignore clBuildProgram
+Ignore clEnqueueNativeKernel
+Ignore clSetEventCallback
+Ignore clSetMemObjectDestructorCallback
diff --git a/make/config/cl-image-if.cfg b/make/config/cl-image-if.cfg
new file mode 100644
index 00000000..611d1bf2
--- /dev/null
+++ b/make/config/cl-image-if.cfg
@@ -0,0 +1,16 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+Import com.jogamp.opencl.llb.impl.CLImageFormatImpl
+
+ClassJavadoc CLImageBinding /**
+ClassJavadoc CLImageBinding * Java bindings to OpenCL images.
+ClassJavadoc CLImageBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLImageBinding */
+JavaClass CLImageBinding
+
+Extends CLImageBinding CLMemObjBinding
+
+IgnoreNot .*CreateImage.*|.*GetImageInfo.*|CL_IMAGE_.*|CL_R|CL_Rx|CL_A|CL_RG|CL_RGx|CL_RA|CL_RGB|CL_RGBx|CL_RGBA|CL_ARGB|CL_BGRA|CL_INTENSITY|CL_LUMINANCE|CL_SNORM_INT8|CL_SNORM_INT16|CL_UNORM_INT8|CL_UNORM_INT16|CL_UNORM_SHORT_565|CL_UNORM_SHORT_555|CL_UNORM_INT_101010|CL_SIGNED_INT8|CL_SIGNED_INT16|CL_SIGNED_INT32|CL_UNSIGNED_INT8|CL_UNSIGNED_INT16|CL_UNSIGNED_INT32|CL_HALF_FLOAT|CL_FLOAT
+
diff --git a/make/config/cl-impl.cfg b/make/config/cl-impl.cfg
new file mode 100644
index 00000000..c2aff892
--- /dev/null
+++ b/make/config/cl-impl.cfg
@@ -0,0 +1,95 @@
+Include cl-common.cfg
+
+Style ImplOnly
+
+#imports for all generated java files
+Import com.jogamp.opencl.llb.*
+Import com.jogamp.opencl.llb.gl.CLGL
+Import java.security.AccessController
+Import java.security.PrivilegedAction
+
+ClassJavadoc CLAbstractImpl /**
+ClassJavadoc CLAbstractImpl * Java bindings to OpenCL, the Open Computing Language (generated).
+ClassJavadoc CLAbstractImpl * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLAbstractImpl */
+
+ImplJavaClass CLAbstractImpl
+AccessControl CLAbstractImpl PUBLIC_ABSTRACT
+Implements CLAbstractImpl CLGL
+
+EmitProcAddressTable true
+ProcAddressTableClassName CLProcAddressTable
+GetProcAddressTableExpr addressTable
+ProcAddressNameExpr $UpperCase(arg)
+
+#dynamic binding for OpenGL specific functions...
+#ForceProcAddressGen clGetGLContextInfoKHR
+#ForceProcAddressGen clCreateFromGLBuffer
+#ForceProcAddressGen clCreateFromGLRenderbuffer
+#ForceProcAddressGen clCreateFromGLTexture2D
+#ForceProcAddressGen clCreateFromGLTexture3D
+#ForceProcAddressGen clEnqueueAcquireGLObjects
+#ForceProcAddressGen clEnqueueReleaseGLObjects
+#ForceProcAddressGen clGetGLObjectInfo
+#ForceProcAddressGen clGetGLTextureInfo
+#ForceProcAddressGen clCreateEventFromGLsyncKHR
+#ForceProcAddressGen clIcdGetPlatformIDsKHR
+#ForceProcAddressGen clCreateSubBuffer
+#ForceProcAddressGen clCreateSubDevicesEXT
+#ForceProcAddressGen clCreateUserEvent
+#ForceProcAddressGen clEnqueueCopyBufferRect
+#ForceProcAddressGen clEnqueueReadBufferRect
+#ForceProcAddressGen clEnqueueWriteBufferRect
+#ForceProcAddressGen clReleaseDeviceEXT
+#ForceProcAddressGen clRetainDeviceEXT
+#ForceProcAddressGen clSetUserEventStatus
+
+#...or force all
+ForceProcAddressGen __ALL__
+
+#
+# extern CL_API_ENTRY void * CL_API_CALL clGetExtensionFunctionAddress(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
+#
+Ignore clGetExtensionFunctionAddress
+ForceProcAddressGen clGetExtensionFunctionAddress
+
+#append to generated c files
+CustomCCode #include <CL/cl.h>
+CustomCCode #include <CL/cl_ext.h>
+CustomCCode #include <CL/cl_gl.h>
+CustomCCode #include <GL3/gl3.h>
+CustomCCode #include <inttypes.h>
+
+# implement manually via custom code
+Ignore clCreateContext
+ForceProcAddressGen clCreateContext
+
+Ignore clCreateContextFromType
+ForceProcAddressGen clCreateContextFromType
+
+Ignore clBuildProgram
+ForceProcAddressGen clBuildProgram
+
+Ignore clEnqueueNativeKernel
+ForceProcAddressGen clEnqueueNativeKernel
+
+Ignore clReleaseContext
+ForceProcAddressGen clReleaseContext
+
+Ignore clSetEventCallback
+ForceProcAddressGen clSetEventCallback
+
+Ignore clSetMemObjectDestructorCallback
+ForceProcAddressGen clSetMemObjectDestructorCallback
+
+#take buffer capacity from input param 5
+ReturnValueCapacity clEnqueueMapBuffer {5}
+
+#this one is more complicated, we have to calculate the capacity with custom code
+ManuallyImplement clEnqueueMapImage
+ForceProcAddressGen clEnqueueMapImage
+
+#include custom code
+IncludeAs CustomJavaCode CLAbstractImpl clImplCustomCode.java
+IncludeAs CustomCCode clImplCustomCode.c
+
diff --git a/make/config/cl-kernel-if.cfg b/make/config/cl-kernel-if.cfg
new file mode 100644
index 00000000..be9d6aa2
--- /dev/null
+++ b/make/config/cl-kernel-if.cfg
@@ -0,0 +1,12 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+ClassJavadoc CLKernelBinding /**
+ClassJavadoc CLKernelBinding * Java bindings to OpenCL kernels.
+ClassJavadoc CLKernelBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLKernelBinding */
+JavaClass CLKernelBinding
+
+IgnoreNot .*CreateKernel.*|.*GetKernel.*Info.*|.*SetKernel.*|.*RetainKernel.*|.*ReleaseKernel.*|CL_KERNEL_.*
+
diff --git a/make/config/cl-mem-if.cfg b/make/config/cl-mem-if.cfg
new file mode 100644
index 00000000..11c51d19
--- /dev/null
+++ b/make/config/cl-mem-if.cfg
@@ -0,0 +1,18 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+import com.jogamp.opencl.llb.impl.CLMemObjectDestructorCallback
+
+ClassJavadoc CLMemObjBinding /**
+ClassJavadoc CLMemObjBinding * Java bindings to OpenCL memory objects.
+ClassJavadoc CLMemObjBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLMemObjBinding */
+JavaClass CLMemObjBinding
+
+IgnoreNot .*GetMemObjectInfo.*|.*RetainMemObject.*|.*ReleaseMemObject.*|CL_MEM_.*|CL_MAP_.*
+
+CustomJavaCode CLMemObjBinding
+CustomJavaCode CLMemObjBinding /** Interface to C language function: <br> <code> int32_t {@native clSetMemObjectDestructorCallback}(cl_mem memobj, void (CL_CALLBACK *pfn_notify) (cl_mem memobj, void *user_data), void *user_data); </code> */
+CustomJavaCode CLMemObjBinding public int clSetMemObjectDestructorCallback(long memObjID, CLMemObjectDestructorCallback cb);
+
diff --git a/make/config/cl-platform-if.cfg b/make/config/cl-platform-if.cfg
new file mode 100644
index 00000000..1a355f34
--- /dev/null
+++ b/make/config/cl-platform-if.cfg
@@ -0,0 +1,12 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+ClassJavadoc CLPlatformBinding /**
+ClassJavadoc CLPlatformBinding * Java bindings to OpenCL platforms.
+ClassJavadoc CLPlatformBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLPlatformBinding */
+JavaClass CLPlatformBinding
+
+IgnoreNot .*GetPlatformInfo.*|.*GetDeviceIDs.*|.*GetPlatformIDs.*|CL_PLATFORM_.*
+
diff --git a/make/config/cl-program-if.cfg b/make/config/cl-program-if.cfg
new file mode 100644
index 00000000..7b72272f
--- /dev/null
+++ b/make/config/cl-program-if.cfg
@@ -0,0 +1,18 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+Import com.jogamp.opencl.llb.impl.BuildProgramCallback
+
+ClassJavadoc CLProgramBinding /**
+ClassJavadoc CLProgramBinding * Java bindings to OpenCL programs.
+ClassJavadoc CLProgramBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLProgramBinding */
+JavaClass CLProgramBinding
+
+IgnoreNot .*CreateProgramWith.*|.*Program.*Info.*|.*RetainProgram.*|.*ReleaseProgram.*|CL_PROGRAM_.*|CL_BUILD_.*
+
+#custom implementations
+CustomJavaCode CLProgramBinding
+CustomJavaCode CLProgramBinding /** Interface to C language function: <br> <code> int32_t {@native clBuildProgram}(cl_program, uint32_t, cl_device_id * , const char * , void (*pfn_notify)(cl_program, void *user_data), void * ); </code> */
+CustomJavaCode CLProgramBinding public int clBuildProgram(long program, int deviceCount, PointerBuffer devices, String options, BuildProgramCallback cb);
diff --git a/make/config/cl-queue-if.cfg b/make/config/cl-queue-if.cfg
new file mode 100644
index 00000000..171b9332
--- /dev/null
+++ b/make/config/cl-queue-if.cfg
@@ -0,0 +1,12 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+ClassJavadoc CLCommandQueueBinding /**
+ClassJavadoc CLCommandQueueBinding * Java bindings to OpenCL command queues.
+ClassJavadoc CLCommandQueueBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLCommandQueueBinding */
+JavaClass CLCommandQueueBinding
+
+IgnoreNot .*CreateCommandQueue.*|.*GetCommandQueueInfo.*|.*EnqueueRead.*|.*EnqueueWrite.*|.*EnqueueCopy.*|.*EnqueueMap.*|.*EnqueueUnmap.*|.*EnqueueBarrier.*|.*EnqueueNDRange.*|.*EnqueueTask.*|.*EnqueueMarker.*|.*EnqueueWait.*|.*EnqueueMigrate.*|.*RetainCommandQueue.*|.*ReleaseCommandQueue.*|clFinish|clFlush|CL_QUEUE_.*|CL_COMMAND_.*|CL_PROFILING_COMMAND_.*
+
diff --git a/make/config/cl-sampler-if.cfg b/make/config/cl-sampler-if.cfg
new file mode 100644
index 00000000..5329b7f5
--- /dev/null
+++ b/make/config/cl-sampler-if.cfg
@@ -0,0 +1,12 @@
+Include cl-common.cfg
+
+Style InterfaceOnly
+
+ClassJavadoc CLSamplerBinding /**
+ClassJavadoc CLSamplerBinding * Java bindings to OpenCL sampler objects.
+ClassJavadoc CLSamplerBinding * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLSamplerBinding */
+JavaClass CLSamplerBinding
+
+IgnoreNot .*CreateSampler.*|.*GetSamplerInfo.*|.*RetainSampler.*|.*ReleaseSampler.*|CL_SAMPLER_.*|CL_ADDRESS_.*|CL_FILTER_.*
+
diff --git a/make/config/clImplCustomCode.c b/make/config/clImplCustomCode.c
new file mode 100644
index 00000000..751f819b
--- /dev/null
+++ b/make/config/clImplCustomCode.c
@@ -0,0 +1,435 @@
+/*
+void checkStatus(const char* msg, int status) {
+ if (status != CL_SUCCESS) {
+ printf("%s; error: %d \n", msg, status);
+ exit(EXIT_FAILURE);
+ }
+}
+*/
+
+JavaVM * jvm;
+
+jmethodID buildCB_mid;
+jmethodID contextCB_mid;
+jmethodID eventCB_mid;
+jmethodID memObjCB_mid;
+
+
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM * _jvm, void *reserved) {
+
+ JNIEnv *env;
+ jvm = _jvm;
+
+ if ((*jvm)->GetEnv(_jvm, (void **)&env, JNI_VERSION_1_2)) {
+ return JNI_ERR;
+ }
+
+ // throws ClassNotFoundException (or other reflection stuff)
+ jclass buildCBClassID = (*env)->FindClass(env, "com/jogamp/opencl/llb/impl/BuildProgramCallback");
+ jclass errorHandlerClassID = (*env)->FindClass(env, "com/jogamp/opencl/CLErrorHandler");
+ jclass eventCBClassID = (*env)->FindClass(env, "com/jogamp/opencl/llb/impl/CLEventCallback");
+ jclass memObjCBClassID = (*env)->FindClass(env, "com/jogamp/opencl/llb/impl/CLMemObjectDestructorCallback");
+
+ // throws even more reflection Exceptions
+ // IDs are unique and do not change
+ if (buildCBClassID != NULL) {
+ buildCB_mid = (*env)->GetMethodID(env, buildCBClassID, "buildFinished", "(J)V");
+ }
+ if (errorHandlerClassID != NULL) {
+ contextCB_mid = (*env)->GetMethodID(env, errorHandlerClassID, "onError", "(Ljava/lang/String;Ljava/nio/ByteBuffer;J)V");
+ }
+ if (eventCBClassID != NULL) {
+ eventCB_mid = (*env)->GetMethodID(env, eventCBClassID, "eventStateChanged", "(JI)V");
+ }
+ if (memObjCBClassID != NULL) {
+ memObjCB_mid = (*env)->GetMethodID(env, memObjCBClassID, "memoryDeallocated", "(J)V");
+ }
+
+ return JNI_VERSION_1_2;
+}
+
+
+// callbacks
+typedef void (CL_CALLBACK * cccallback)(const char *, const void *, size_t, void *);
+typedef void (CL_CALLBACK * bpcallback)(cl_program, void *);
+typedef void (CL_CALLBACK * evcallback)(cl_event, cl_int, void *);
+typedef void (CL_CALLBACK * mocallback)(cl_mem, void *);
+
+CL_CALLBACK void buildProgramCallback(cl_program id, void * object) {
+
+ JNIEnv *env;
+ jobject obj = (jobject)object;
+
+ (*jvm)->AttachCurrentThread(jvm, (void **)&env, NULL);
+
+ (*env)->CallVoidMethod(env, obj, buildCB_mid, (jlong)(intptr_t)id);
+ (*env)->DeleteGlobalRef(env, obj);
+
+ (*jvm)->DetachCurrentThread(jvm);
+
+}
+
+CL_CALLBACK void createContextCallback(const char * errinfo, const void * private_info, size_t cb, void * object) {
+
+ JNIEnv *env;
+ jobject obj = (jobject)object;
+
+ (*jvm)->AttachCurrentThread(jvm, (void **)&env, NULL);
+
+ jstring errorString = (*env)->NewStringUTF(env, errinfo);
+
+ //TODO private_info
+ (*env)->CallVoidMethod(env, obj, contextCB_mid, errorString, NULL, 0);
+
+ (*jvm)->DetachCurrentThread(jvm);
+
+}
+
+CL_CALLBACK void eventCallback(cl_event event, cl_int status, void * object) {
+
+ JNIEnv *env;
+ jobject obj = (jobject)object;
+
+ (*jvm)->AttachCurrentThread(jvm, (void **)&env, NULL);
+
+ (*env)->CallVoidMethod(env, obj, eventCB_mid, event, status);
+ (*env)->DeleteGlobalRef(env, obj); // events can only fire once
+
+ (*jvm)->DetachCurrentThread(jvm);
+}
+
+CL_CALLBACK void memObjDestructorCallback(cl_mem mem, void * object) {
+
+ JNIEnv *env;
+ jobject obj = (jobject)object;
+
+ (*jvm)->AttachCurrentThread(jvm, (void **)&env, NULL);
+
+ (*env)->CallVoidMethod(env, obj, memObjCB_mid, mem);
+ (*env)->DeleteGlobalRef(env, obj);
+
+ (*jvm)->DetachCurrentThread(jvm);
+}
+
+// extern CL_API_ENTRY void * CL_API_CALL clGetExtensionFunctionAddress(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
+
+JNIEXPORT jlong JNICALL
+Java_com_jogamp_opencl_llb_impl_CLAbstractImpl_dispatch_1clGetExtensionFunctionAddressStatic(JNIEnv *env, jclass _unused, jstring fname, jlong procAddress) {
+ typedef void* (CL_API_ENTRY*_local_LPCLGETPROCADDRESS)(const char * fname);
+ _local_LPCLGETPROCADDRESS ptr_clGetExtensionFunctionAddress;
+ const char* _strchars_fname = NULL;
+ void* _res;
+ if ( NULL != fname ) {
+ _strchars_fname = (*env)->GetStringUTFChars(env, fname, (jboolean*)NULL);
+ if ( NULL == _strchars_fname ) {
+ (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/OutOfMemoryError"),
+ "Failed to get UTF-8 chars for argument \"fname\" in native dispatcher for \"dispatch_clGetExtensionFunctionAddress\"");
+ return 0;
+ }
+ }
+ ptr_clGetExtensionFunctionAddress = (_local_LPCLGETPROCADDRESS) (intptr_t) procAddress;
+ assert(ptr_clGetExtensionFunctionAddress != NULL);
+ _res = (* ptr_clGetExtensionFunctionAddress) ((char *) _strchars_fname);
+ if ( NULL != fname ) {
+ (*env)->ReleaseStringUTFChars(env, fname, _strchars_fname);
+ }
+ return (jlong) (intptr_t) _res;
+}
+
+/* Java->C glue code:
+ * Java package: com.jogamp.opencl.impl.CLImpl
+ * Java method: long clCreateContextFromType(java.nio.IntBuffer props, long device_type, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret)
+ * C function: cl_context clCreateContextFromType( const cl_context_properties * properties ,
+ * cl_device_type device_type ,
+ * void (CL_CALLBACK * pfn_notify )(const char *, const void *, size_t, void *),
+ * void * user_data ,
+ * cl_int * errcode_ret);
+ */
+JNIEXPORT jlong JNICALL
+Java_com_jogamp_opencl_llb_impl_CLImpl_clCreateContextFromType0(JNIEnv *env, jobject _unused,
+ jobject props, jint props_byte_offset, jlong device_type, jobject cb, jobject global, jobject errcode, jint errcode_byte_offset, jlong procAddress) {
+
+ cl_context_properties* _props_ptr = NULL;
+ cl_int * _errcode_ptr = NULL;
+ cl_context _ctx = NULL;
+ cccallback _pfn_notify = NULL;
+ jobject globalCB = NULL;
+
+ typedef cl_context (*function)(const cl_context_properties *, cl_device_type, void (*pfn_notify)(const char *, const void *, size_t, void *), void *, cl_int *);
+ function clCreateContextFromType = (function)(intptr_t) procAddress;
+
+ if (props != NULL) {
+ _props_ptr = (cl_context_properties*) (((char*) (*env)->GetDirectBufferAddress(env, props)) + props_byte_offset);
+ }
+
+ if (errcode != NULL) {
+ _errcode_ptr = (void *) (((char*) (*env)->GetDirectBufferAddress(env, errcode)) + errcode_byte_offset);
+ }
+
+ if (cb != NULL) {
+ _pfn_notify = &createContextCallback;
+ globalCB = (*env)->NewGlobalRef(env, cb);
+ }
+
+ _ctx = (*clCreateContextFromType)(_props_ptr, (uint64_t) device_type, _pfn_notify, globalCB, _errcode_ptr);
+
+ if(globalCB != NULL) {
+ jlong *g = (*env)->GetPrimitiveArrayCritical(env, global, NULL);
+ // if something went wrong
+ if(_ctx == NULL) {
+ g[0] = 0;
+ (*env)->DeleteGlobalRef(env, globalCB);
+ }else{
+ g[0] = (jlong)globalCB;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, global, g, 0);
+ }
+
+ return (jlong) (intptr_t)_ctx;
+}
+
+/*
+ * Entry point to C language function:
+ *extern CL_API_ENTRY cl_context CL_API_CALL
+ *clCreateContext(cl_context_properties * properties ,
+ * cl_uint num_devices ,
+ * const cl_device_id * devices ,
+ * void (*pfn_notify)(const char *, const void *, size_t, void *) pfn_notify ,
+ * void * user_data ,
+ * cl_int * errcode_ret ) CL_API_SUFFIX__VERSION_1_0;
+ */
+JNIEXPORT jlong JNICALL
+Java_com_jogamp_opencl_llb_impl_CLImpl_clCreateContext0(JNIEnv *env, jobject _unused,
+ jobject props, jint props_byte_offset, jint numDevices, jobject deviceList, jint device_type_offset, jobject cb, jobject global, jobject errcode, jint errcode_byte_offset, jlong procAddress) {
+
+ cl_context_properties* _props_ptr = NULL;
+ cl_int * _errcode_ptr = NULL;
+ cl_device_id * _deviceListPtr = NULL;
+ cl_context _ctx = NULL;
+ cccallback _pfn_notify = NULL;
+ jobject globalCB = NULL;
+
+ typedef cl_context (*function)(cl_context_properties *, cl_uint, const cl_device_id *, void (*pfn_notify)(const char *, const void *, size_t, void *), void *, cl_int *);
+ function clCreateContext = (function)(intptr_t) procAddress;
+
+ if (props != NULL) {
+ _props_ptr = (cl_context_properties*) (((char*) (*env)->GetDirectBufferAddress(env, props)) + props_byte_offset);
+ }
+ if (deviceList != NULL) {
+ _deviceListPtr = (void *) (((char*) (*env)->GetDirectBufferAddress(env, deviceList)) + device_type_offset);
+ }
+ if (errcode != NULL) {
+ _errcode_ptr = (void *) (((char*) (*env)->GetDirectBufferAddress(env, errcode)) + errcode_byte_offset);
+ }
+
+ if (cb != NULL) {
+ _pfn_notify = &createContextCallback;
+ globalCB = (*env)->NewGlobalRef(env, cb);
+ }
+
+ _ctx = (*clCreateContext)(_props_ptr, numDevices, _deviceListPtr, _pfn_notify, globalCB, _errcode_ptr);
+
+ if(globalCB != NULL) {
+ jlong *g = (*env)->GetPrimitiveArrayCritical(env, global, NULL);
+ // if something went wrong
+ if(_ctx == NULL) {
+ g[0] = 0;
+ (*env)->DeleteGlobalRef(env, globalCB);
+ }else{
+ g[0] = (jlong)globalCB;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, global, g, 0);
+ }
+
+ return (jlong) (intptr_t)_ctx;
+}
+
+/* Java->C glue code:
+ * Java package: com.jogamp.opencl.impl.CLImpl
+ * Java method: int clReleaseContextImpl(long context)
+ * C function: int32_t clReleaseContextImpl(cl_context context);
+ */
+JNIEXPORT jint JNICALL
+Java_com_jogamp_opencl_llb_impl_CLImpl_clReleaseContextImpl(JNIEnv *env, jobject _unused, jlong context, jlong global, jlong procAddress) {
+
+ int32_t _res;
+ typedef int32_t (*function)(cl_context);
+ function clReleaseContext = (function)(intptr_t) procAddress;
+
+ _res = (*clReleaseContext)((cl_context) (intptr_t) context);
+ // TODO deal with retains
+ if (global != 0) {
+ (*env)->DeleteGlobalRef(env, (jobject) global);
+ }
+ return _res;
+}
+
+
+/**
+ * Entry point to C language function:
+ * extern CL_API_ENTRY cl_int CL_API_CALL
+ *clBuildProgram(cl_program program ,
+ * cl_uint num_devices ,
+ * const cl_device_id * device_list ,
+ * const char * options ,
+ * void (*pfn_notify)(cl_program program , void * user_data ),
+ * void * user_data ) CL_API_SUFFIX__VERSION_1_0;
+ */
+JNIEXPORT jint JNICALL
+Java_com_jogamp_opencl_llb_impl_CLImpl_clBuildProgram0(JNIEnv *env, jobject _unused,
+ jlong program, jint deviceCount, jobject deviceList, jint device_type_offset, jstring options, jobject cb, jlong procAddress) {
+
+ const char* _strchars_options = NULL;
+ cl_int _res;
+ cl_device_id * _deviceListPtr = NULL;
+ bpcallback _pfn_notify = NULL;
+ jobject globalCB = NULL;
+
+ typedef cl_int (*function)(cl_program, cl_uint, const cl_device_id *, const char *, void (CL_CALLBACK *)(cl_program, void *), void *);
+ function clBuildProgram = (function)(intptr_t)procAddress;
+
+ if (options != NULL) {
+ _strchars_options = (*env)->GetStringUTFChars(env, options, (jboolean*)NULL);
+ if (_strchars_options == NULL) {
+ (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/OutOfMemoryError"),
+ "Failed to get UTF-8 chars for argument \"options\" in native dispatcher for \"clBuildProgram\"");
+ return CL_FALSE;
+ }
+ }
+
+ if (deviceList != NULL) {
+ _deviceListPtr = (void *) (((char*) (*env)->GetDirectBufferAddress(env, deviceList)) + device_type_offset);
+ }
+
+ if (cb != NULL) {
+ _pfn_notify = &buildProgramCallback;
+ globalCB = (*env)->NewGlobalRef(env, cb);
+ }
+
+ _res = (*clBuildProgram)((cl_program)(intptr_t)program, (cl_uint)deviceCount, (cl_device_id *)_deviceListPtr, _strchars_options, _pfn_notify, globalCB);
+
+ // if something went wrong
+ if(_res != CL_SUCCESS && globalCB != NULL) {
+ (*env)->DeleteGlobalRef(env, globalCB);
+ }
+
+ if (options != NULL) {
+ (*env)->ReleaseStringUTFChars(env, options, _strchars_options);
+ }
+
+ return (jint)_res;
+}
+
+/* Java->C glue code:
+ * Java package: com.jogamp.opencl.impl.CLImpl
+ * Java method: java.nio.ByteBuffer clEnqueueMapImage(long command_queue, long image, int blocking_map, long map_flags, com.jogamp.gluegen.common.nio.PointerBuffer origin, com.jogamp.gluegen.common.nio.PointerBuffer range, com.jogamp.gluegen.common.nio.PointerBuffer image_row_pitch, com.jogamp.gluegen.common.nio.PointerBuffer image_slice_pitch, int num_events_in_wait_list, com.jogamp.gluegen.common.nio.PointerBuffer event_wait_list, com.jogamp.gluegen.common.nio.PointerBuffer event, java.nio.IntBuffer errcode_ret)
+ * C function: void * clEnqueueMapImage(cl_command_queue command_queue, cl_mem image, uint32_t blocking_map, uint64_t map_flags, const size_t * , const size_t * , size_t * image_row_pitch, size_t * image_slice_pitch, uint32_t num_events_in_wait_list, cl_event * event_wait_list, cl_event * event, int32_t * errcode_ret);
+ */
+JNIEXPORT jobject JNICALL
+Java_com_jogamp_opencl_llb_impl_CLImpl_clEnqueueMapImage0__JJIJLjava_lang_Object_2ILjava_lang_Object_2ILjava_lang_Object_2ILjava_lang_Object_2IILjava_lang_Object_2ILjava_lang_Object_2ILjava_lang_Object_2I(JNIEnv *env, jobject _unused,
+ jlong command_queue, jlong image, jint blocking_map, jlong map_flags,
+ jobject origin, jint origin_byte_offset, jobject range, jint range_byte_offset,
+ jobject image_row_pitch, jint image_row_pitch_byte_offset, jobject image_slice_pitch,
+ jint image_slice_pitch_byte_offset, jint num_events_in_wait_list, jobject event_wait_list,
+ jint event_wait_list_byte_offset, jobject event, jint event_byte_offset, jobject errcode_ret, jint errcode_ret_byte_offset,
+ jlong imageInfoAddress, jlong mapImageAddress) {
+
+ size_t * _origin_ptr = NULL;
+ size_t * _range_ptr = NULL;
+ size_t * _image_row_pitch_ptr = NULL;
+ size_t * _image_slice_pitch_ptr = NULL;
+ cl_event * _event_wait_list_ptr = NULL;
+ cl_event * _event_ptr = NULL;
+ int32_t * _errcode_ret_ptr = NULL;
+ size_t * elements = NULL;
+ size_t * depth = NULL;
+ size_t pixels;
+ cl_int status;
+
+ typedef int32_t (*imageInfoFunctionType)(cl_mem, uint32_t, size_t, void *, size_t *);
+ imageInfoFunctionType clGetImageInfo;
+
+ typedef void* (*mapInfoFunctionType)(cl_command_queue, cl_mem, uint32_t, uint64_t, const size_t *,
+ const size_t *, size_t *, size_t *, uint32_t, cl_event *, cl_event *, int32_t *);
+ mapInfoFunctionType clEnqueueMapImage;
+
+ void * _res;
+
+ if (origin != NULL) {
+ _origin_ptr = (size_t *) (((char*) (*env)->GetDirectBufferAddress(env, origin)) + origin_byte_offset);
+ }
+ if (range != NULL) {
+ _range_ptr = (size_t *) (((char*) (*env)->GetDirectBufferAddress(env, range)) + range_byte_offset);
+ }
+ if (image_row_pitch != NULL) {
+ _image_row_pitch_ptr = (size_t *) (((char*) (*env)->GetDirectBufferAddress(env, image_row_pitch)) + image_row_pitch_byte_offset);
+ }
+ if (image_slice_pitch != NULL) {
+ _image_slice_pitch_ptr = (size_t *) (((char*) (*env)->GetDirectBufferAddress(env, image_slice_pitch)) + image_slice_pitch_byte_offset);
+ }
+ if (event_wait_list != NULL) {
+ _event_wait_list_ptr = (cl_event *) (((char*) (*env)->GetDirectBufferAddress(env, event_wait_list)) + event_wait_list_byte_offset);
+ }
+ if (event != NULL) {
+ _event_ptr = (cl_event *) (((char*) (*env)->GetDirectBufferAddress(env, event)) + event_byte_offset);
+ }
+ if (errcode_ret != NULL) {
+ _errcode_ret_ptr = (int32_t *) (((char*) (*env)->GetDirectBufferAddress(env, errcode_ret)) + errcode_ret_byte_offset);
+ }
+
+ _res = (*clEnqueueMapImage)((cl_command_queue) (intptr_t) command_queue, (cl_mem) (intptr_t) image,
+ (uint32_t) blocking_map, (uint64_t) map_flags, (size_t *) _origin_ptr, (size_t *) _range_ptr,
+ (size_t *) _image_row_pitch_ptr, (size_t *) _image_slice_pitch_ptr, (uint32_t) num_events_in_wait_list,
+ (cl_event *) _event_wait_list_ptr, (cl_event *) _event_ptr, (int32_t *) _errcode_ret_ptr);
+ if (_res == NULL) return NULL;
+
+ // calculate buffer size
+ status = (*clGetImageInfo)((cl_mem) (intptr_t) image, CL_IMAGE_ELEMENT_SIZE, sizeof(size_t), (void *) elements, NULL);
+ status |= (*clGetImageInfo)((cl_mem) (intptr_t) image, CL_IMAGE_DEPTH, sizeof(size_t), (void *) depth, NULL);
+
+ if(status != CL_SUCCESS) {
+ return NULL;
+ }
+
+ if(*depth == 0) { // 2D
+ pixels = (*_image_row_pitch_ptr) * _range_ptr[1] + _range_ptr[0];
+ }else{ // 3D
+ pixels = (*_image_slice_pitch_ptr) * _range_ptr[2]
+ + (*_image_row_pitch_ptr) * _range_ptr[1] + _range_ptr[0];
+ }
+
+ return (*env)->NewDirectByteBuffer(env, _res, pixels * (*elements));
+
+}
+
+JNIEXPORT jint JNICALL
+Java_com_jogamp_opencl_llb_impl_CLImpl_clSetEventCallback0(JNIEnv *env, jobject _unused,
+ jlong event, jint trigger, jobject listener, jlong procAddress) {
+
+ cl_event _event = event;
+ cl_int _trigger = trigger;
+ cl_int _res;
+ typedef int32_t (*function)(cl_event, cl_int, void (*pfn_event_notify) (cl_event, cl_int, void *), void *);
+ function clSetEventCallback = (function)(intptr_t) procAddress;
+
+ jobject cb = (*env)->NewGlobalRef(env, listener);
+ _res = (*clSetEventCallback)(_event, _trigger, &eventCallback, cb);
+
+ return _res;
+}
+
+JNIEXPORT jint JNICALL
+Java_com_jogamp_opencl_llb_impl_CLImpl_clSetMemObjectDestructorCallback0(JNIEnv *env, jobject _unused,
+ jlong mem, jobject listener, jlong procAddress) {
+
+ cl_mem _mem = mem;
+ cl_int _res;
+ typedef int32_t (*function)(cl_mem, void (*pfn_event_notify) (cl_mem, void *), void *);
+ function clSetMemObjectDestructorCallback = (function)(intptr_t) procAddress;
+
+ jobject cb = (*env)->NewGlobalRef(env, listener);
+ _res = (*clSetMemObjectDestructorCallback)(_mem, &memObjDestructorCallback, cb);
+
+ return _res;
+}
diff --git a/make/config/clImplCustomCode.java b/make/config/clImplCustomCode.java
new file mode 100644
index 00000000..bee53425
--- /dev/null
+++ b/make/config/clImplCustomCode.java
@@ -0,0 +1,53 @@
+
+ static final DynamicLibraryBundle dynamicLookupHelper;
+ protected static final CLProcAddressTable addressTable;
+
+ static {
+ addressTable = new CLProcAddressTable();
+ if(null==addressTable) {
+ throw new RuntimeException("Couldn't instantiate ALProcAddressTable");
+ }
+
+ dynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() {
+ public DynamicLibraryBundle run() {
+ final DynamicLibraryBundle bundle = new DynamicLibraryBundle(new CLDynamicLibraryBundleInfo());
+ if(null==bundle) {
+ throw new RuntimeException("Null CLDynamicLookupHelper");
+ }
+ if(!bundle.isToolLibLoaded()) {
+ throw new RuntimeException("Couln't load native CL library");
+ }
+ if(!bundle.isLibComplete()) {
+ throw new RuntimeException("Couln't load native CL/JNI glue library");
+ }
+ addressTable.reset(bundle);
+ return bundle;
+ } } );
+ }
+
+ public static CLProcAddressTable getCLProcAddressTable() { return addressTable; }
+
+ static long clGetExtensionFunctionAddress(long clGetExtensionFunctionAddressHandle, java.lang.String procname)
+ {
+ if (clGetExtensionFunctionAddressHandle == 0) {
+ throw new RuntimeException("Passed null pointer for method \"clGetExtensionFunctionAddress\"");
+ }
+ return dispatch_clGetExtensionFunctionAddressStatic(procname, clGetExtensionFunctionAddressHandle);
+ }
+
+ public CLAbstractImpl() {
+ }
+
+ /** Entry point (through function pointer) to C language function: <br> <code> void* clGetExtensionFunctionAddress(const char * fname); </code> */
+ long clGetExtensionFunctionAddress(String fname) {
+
+ final long __addr_ = addressTable._addressof_clGetExtensionFunctionAddress;
+ if (__addr_ == 0) {
+ throw new UnsupportedOperationException("Method \"clGetExtensionFunctionAddress\" not available");
+ }
+ return dispatch_clGetExtensionFunctionAddressStatic(fname, __addr_);
+ }
+
+ /** Entry point (through function pointer) to C language function: <br> <code> void* clGetExtensionFunctionAddress(const char * fname); </code> */
+ private static native long dispatch_clGetExtensionFunctionAddressStatic(String fname, long procAddress);
+
diff --git a/make/config/clgl-if.cfg b/make/config/clgl-if.cfg
new file mode 100644
index 00000000..1671f76c
--- /dev/null
+++ b/make/config/clgl-if.cfg
@@ -0,0 +1,26 @@
+Include cl-common.cfg
+
+#overwrite package
+Package com.jogamp.opencl.llb.gl
+
+import com.jogamp.opencl.llb.CL
+
+Style InterfaceOnly
+
+ClassJavadoc CLGL /**
+ClassJavadoc CLGL * Java bindings to OpenCL, the Open Computing Language.
+ClassJavadoc CLGL * OpenGL - OpenCL interoperability.
+ClassJavadoc CLGL * @author Michael Bien, GlueGen, et al.
+ClassJavadoc CLGL */
+JavaClass CLGL
+
+Extends CLGL CL
+
+#only include token starting with CL_GL_ and methods containing GL
+IgnoreNot CL_GL_.*|cl.*GL.*|.*_GL_.*
+
+CustomJavaCode CLGL /** To be used on Mac OSX instead of {@link #CL_CGL_SHAREGROUP_KHR}}. FIXME: For all Mac OSX versions? */
+CustomJavaCode CLGL public static final int CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE = 0x10000000;
+
+#append to generated c files
+#CustomCCode #include <inttypes.h>
diff --git a/make/config/createTagletProps.sh b/make/config/createTagletProps.sh
new file mode 100644
index 00000000..af3312e8
--- /dev/null
+++ b/make/config/createTagletProps.sh
@@ -0,0 +1,14 @@
+#download index
+root=http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/
+toc=Opencl_tofc.html
+wget ${root}/${toc};
+#find links to cl* function doc
+grep -E .+\<a\ href=\"cl[A-Z][^\"]+\"[^\>]+\>cl[A-Z][a-Z0-9]+\</a\>.+ ./${toc} > links;
+#add doc root to properties file
+echo "#Generated, do not edit, edit createTagletProps.sh instead.
+#This file is used in NativeTaglet and maps the generated method names
+#to the function specific OpenCL documentation man pages.
+nativetaglet.baseUrl=${root}" > native-taglet.properties;
+#add all links as properties to file and cleanup
+sed -r 's/\s+<li><a href="([a-Z0-9.]+)"[^>]+>([a-Z0-9]+)<\/a><\/li>/\2=\1/' links | tr -d [:blank:] | sort -u >> native-taglet.properties;
+rm ./${toc} ./links
diff --git a/make/config/native-taglet.properties b/make/config/native-taglet.properties
new file mode 100644
index 00000000..84477786
--- /dev/null
+++ b/make/config/native-taglet.properties
@@ -0,0 +1,93 @@
+#Generated, do not edit, edit createTagletProps.sh instead.
+#This file is used in NativeTaglet and maps the generated method names
+#to the function specific OpenCL documentation man pages.
+nativetaglet.baseUrl=http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/
+clBuildProgram=clBuildProgram.html
+clCreateBuffer=clCreateBuffer.html
+clCreateCommandQueue=clCreateCommandQueue.html
+clCreateContext=clCreateContext.html
+clCreateContextFromType=clCreateContextFromType.html
+clCreateEventFromGLsyncKHR=clCreateEventFromGLsyncKHR.html
+clCreateFromD3D10BufferKHR=clCreateFromD3D10BufferKHR.html
+clCreateFromD3D10Texture2DKHR=clCreateFromD3D10Texture2DKHR.html
+clCreateFromD3D10Texture3DKHR=clCreateFromD3D10Texture3DKHR.html
+clCreateFromGLBuffer=clCreateFromGLBuffer.html
+clCreateFromGLRenderbuffer=clCreateFromGLRenderbuffer.html
+clCreateFromGLTexture2D=clCreateFromGLTexture2D.html
+clCreateFromGLTexture3D=clCreateFromGLTexture3D.html
+clCreateImage2D=clCreateImage2D.html
+clCreateImage3D=clCreateImage3D.html
+clCreateKernel=clCreateKernel.html
+clCreateKernelsInProgram=clCreateKernelsInProgram.html
+clCreateProgramWithBinary=clCreateProgramWithBinary.html
+clCreateProgramWithSource=clCreateProgramWithSource.html
+clCreateSampler=clCreateSampler.html
+clCreateSubBuffer=clCreateSubBuffer.html
+clCreateUserEvent=clCreateUserEvent.html
+clEnqueueAcquireD3D10ObjectsKHR=clEnqueueAcquireD3D10ObjectsKHR.html
+clEnqueueAcquireGLObjects=clEnqueueAcquireGLObjects.html
+clEnqueueBarrier=clEnqueueBarrier.html
+clEnqueueCopyBufferRect=clEnqueueCopyBufferRect.html
+clEnqueueCopyBufferToImage=clEnqueueCopyBufferToImage.html
+clEnqueueCopyImage=clEnqueueCopyImage.html
+clEnqueueCopyImageToBuffer=clEnqueueCopyImageToBuffer.html
+clEnqueueMapBuffer=clEnqueueMapBuffer.html
+clEnqueueMapImage=clEnqueueMapImage.html
+clEnqueueMarker=clEnqueueMarker.html
+clEnqueueNativeKernel=clEnqueueNativeKernel.html
+clEnqueueNDRangeKernel=clEnqueueNDRangeKernel.html
+clEnqueueReadBuffer=clEnqueueReadBuffer.html
+clEnqueueReadBufferRect=clEnqueueReadBufferRect.html
+clEnqueueReadImage=clEnqueueReadImage.html
+clEnqueueReleaseD3D10ObjectsKHR=clEnqueueReleaseD3D10ObjectsKHR.html
+clEnqueueReleaseGLObjects=clEnqueueReleaseGLObjects.html
+clEnqueueTask=clEnqueueTask.html
+clEnqueueUnmapMemObject=clEnqueueUnmapMemObject.html
+clEnqueueWaitForEvents=clEnqueueWaitForEvents.html
+clEnqueueWriteBuffer=clEnqueueWriteBuffer.html
+clEnqueueWriteBufferRect=clEnqueueWriteBufferRect.html
+clEnqueueWriteImage=clEnqueueWriteImage.html
+clFinish=clFinish.html
+clFlush=clFlush.html
+clGetCommandQueueInfo=clGetCommandQueueInfo.html
+clGetContextInfo=clGetContextInfo.html
+clGetDeviceIDs=clGetDeviceIDs.html
+clGetDeviceIDsFromD3D10KHR=clGetDeviceIDsFromD3D10KHR.html
+clGetDeviceInfo=clGetDeviceInfo.html
+clGetEventInfo=clGetEventInfo.html
+clGetEventProfilingInfo=clGetEventProfilingInfo.html
+clGetExtensionFunctionAddress=clGetExtensionFunctionAddress.html
+clGetGLContextInfoKHR=clGetGLContextInfoKHR.html
+clGetGLObjectInfo=clGetGLObjectInfo.html
+clGetGLTextureInfo=clGetGLTextureInfo.html
+clGetImageInfo=clGetImageInfo.html
+clGetKernelInfo=clGetKernelInfo.html
+clGetKernelWorkGroupInfo=clGetKernelWorkGroupInfo.html
+clGetMemObjectInfo=clGetMemObjectInfo.html
+clGetPlatformIDs=clGetPlatformIDs.html
+clGetPlatformInfo=clGetPlatformInfo.html
+clGetProgramBuildInfo=clGetProgramBuildInfo.html
+clGetProgramInfo=clGetProgramInfo.html
+clGetSamplerInfo=clGetSamplerInfo.html
+clGetSupportedImageFormats=clGetSupportedImageFormats.html
+clReleaseCommandQueue=clReleaseCommandQueue.html
+clReleaseContext=clReleaseContext.html
+clReleaseEvent=clReleaseEvent.html
+clReleaseKernel=clReleaseKernel.html
+clReleaseMemObject=clReleaseMemObject.html
+clReleaseProgram=clReleaseProgram.html
+clReleaseSampler=clReleaseSampler.html
+clRetainCommandQueue=clRetainCommandQueue.html
+clRetainContext=clRetainContext.html
+clRetainEvent=clRetainEvent.html
+clRetainKernel=clRetainKernel.html
+clRetainMemObject=clRetainMemObject.html
+clRetainProgram=clRetainProgram.html
+clRetainSampler=clRetainSampler.html
+clSetCommandQueueProperty=clSetCommandQueueProperty.html
+clSetEventCallback=clSetEventCallback.html
+clSetKernelArg=clSetKernelArg.html
+clSetMemObjectDestructorCallback=clSetMemObjectDestructorCallback.html
+clSetUserEventStatus=clSetUserEventStatus.html
+clUnloadCompiler=clUnloadCompiler.html
+clWaitForEvents=clWaitForEvents.html