diff options
Diffstat (limited to 'resources')
-rw-r--r-- | resources/cl-if.cfg | 5 | ||||
-rw-r--r-- | resources/cl-impl.cfg | 1 | ||||
-rw-r--r-- | resources/clImplCustomCode.java | 4 | ||||
-rw-r--r-- | resources/includes/CL_orig/cl_ext.h | 78 | ||||
-rw-r--r-- | resources/opencl.h | 1 |
5 files changed, 85 insertions, 4 deletions
diff --git a/resources/cl-if.cfg b/resources/cl-if.cfg index 8a4d62d8..43898544 100644 --- a/resources/cl-if.cfg +++ b/resources/cl-if.cfg @@ -4,6 +4,7 @@ Style InterfaceOnly #imports for all generated java files Import java.nio.IntBuffer +Import java.nio.LongBuffer ClassJavadoc CL /** ClassJavadoc CL * Java bindings to OpenCL, the Open Computing Language. @@ -18,12 +19,12 @@ Ignore CL_GL_.*|cl.*GL.* Ignore clCreateContext CustomJavaCode CL CustomJavaCode CL /** Interface to C language function: <br> <code> cl_context clCreateContext(intptr_t * , uint32_t, cl_device_id * , void (*pfn_notify)(const char *, const void *, size_t, void *), void *, int32_t * ); </code> */ -CustomJavaCode CL public long clCreateContext(IntBuffer properties, long[] devices, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret); +CustomJavaCode CL public long clCreateContext(LongBuffer properties, long[] devices, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret); Ignore clCreateContextFromType CustomJavaCode CL CustomJavaCode CL /** Interface to C language function: <br> <code> cl_context 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 CL public long clCreateContextFromType(IntBuffer properties, long device_type, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret); +CustomJavaCode CL public long clCreateContextFromType(LongBuffer properties, long device_type, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret); Ignore clBuildProgram CustomJavaCode CL diff --git a/resources/cl-impl.cfg b/resources/cl-impl.cfg index cee848c8..9dff59bc 100644 --- a/resources/cl-impl.cfg +++ b/resources/cl-impl.cfg @@ -5,6 +5,7 @@ Style ImplOnly #imports for all generated java files Import com.mbien.opencl.* Import java.nio.IntBuffer +Import java.nio.LongBuffer Import java.nio.Buffer ClassJavadoc CLImpl /** diff --git a/resources/clImplCustomCode.java b/resources/clImplCustomCode.java index c368fe53..91b1fb48 100644 --- a/resources/clImplCustomCode.java +++ b/resources/clImplCustomCode.java @@ -1,5 +1,5 @@ - public long clCreateContext(IntBuffer properties, long[] devices, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret) { + public long clCreateContext(LongBuffer properties, long[] devices, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret) { if(pfn_notify != null) throw new RuntimeException("asynchronous execution with callback is not yet implemented, pass null through this method to block until complete."); @@ -18,7 +18,7 @@ private native long clCreateContext1(Object cl_context_properties, int props_offset, int deviceCount, long[] devices, CreateContextCallback pfn_notify, Object userData, Object errcode_ret, int err_offset); - public long clCreateContextFromType(IntBuffer properties, long device_type, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret) { + public long clCreateContextFromType(LongBuffer properties, long device_type, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret) { if(pfn_notify != null) throw new RuntimeException("asynchronous execution with callback is not yet implemented, pass null through this method to block until complete."); diff --git a/resources/includes/CL_orig/cl_ext.h b/resources/includes/CL_orig/cl_ext.h new file mode 100644 index 00000000..e94be2a4 --- /dev/null +++ b/resources/includes/CL_orig/cl_ext.h @@ -0,0 +1,78 @@ +/******************************************************************************* + * Copyright (c) 2008-2009 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + ******************************************************************************/ + +#ifndef __CL_EXT_H +#define __CL_EXT_H + +#ifdef __cplusplus +extern "C" { +#endif + +// enum can be used if cl_khr_fp64 extension is supported by the OpenCL implementation. +#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032 + +// enum can be used if cl_khr_fp16 extension is supported by the OpenCL implementation. +#define CL_DEVICE_HALF_FP_CONFIG 0x1033 + + +#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000 +#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001 +#define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002 +#define CL_DEVICE_WARP_SIZE_NV 0x4003 +#define CL_DEVICE_GPU_OVERLAP_NV 0x4004 +#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005 +#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006 + + +typedef cl_uint cl_gl_context_info; + +/* cl_khr_gl_sharing */ +typedef cl_int (CL_API_CALL * clGetGLContextInfoKHR_fn) + (const cl_context_properties *properties, + cl_gl_context_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); + +cl_int CL_API_CALL clGetGLContextInfoKHR(const cl_context_properties *properties, + cl_gl_context_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); + +#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -63 +#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006 +#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007 +#define CL_GL_CONTEXT_KHR 0x2008 +#define CL_EGL_DISPLAY_KHR 0x2009 +#define CL_GLX_DISPLAY_KHR 0x200A +#define CL_WGL_HDC_KHR 0x200B +#define CL_CGL_SHAREGROUP_KHR 0x200C + + +#ifdef __cplusplus +} +#endif + + +#endif /* __CL_EXT_H */ diff --git a/resources/opencl.h b/resources/opencl.h index ab05e15a..d1b0c795 100644 --- a/resources/opencl.h +++ b/resources/opencl.h @@ -1,6 +1,7 @@ #include <CL/cl_platform.h> #include <CL/cl.h> +#include <CL/cl_ext.h> #ifdef _WIN32 #include <windows.h> |