diff options
-rw-r--r-- | resources/cl-impl.cfg | 5 | ||||
-rw-r--r-- | resources/clImplCustomCode.java | 11 | ||||
-rw-r--r-- | test/com/jogamp/opencl/LowLevelBindingTest.java | 4 |
3 files changed, 16 insertions, 4 deletions
diff --git a/resources/cl-impl.cfg b/resources/cl-impl.cfg index a404398f..34753eb7 100644 --- a/resources/cl-impl.cfg +++ b/resources/cl-impl.cfg @@ -32,8 +32,9 @@ ForceProcAddressGen clGetGLTextureInfo ForceProcAddressGen clIcdGetPlatformIDsKHR Unignore clGetExtensionFunctionAddress -#AccessControl clGetExtensionFunctionAddress PACKAGE_PRIVATE -ArgumentIsString clGetExtensionFunctionAddress 0 +RenameJavaMethod clGetExtensionFunctionAddress clGetExtensionFunctionAddressImpl +AccessControl clGetExtensionFunctionAddressImpl PRIVATE +ArgumentIsString clGetExtensionFunctionAddressImpl 0 #append to generated c files CustomCCode #include <CL/cl.h> diff --git a/resources/clImplCustomCode.java b/resources/clImplCustomCode.java index fab3a724..9edbd575 100644 --- a/resources/clImplCustomCode.java +++ b/resources/clImplCustomCode.java @@ -118,6 +118,16 @@ private native java.nio.ByteBuffer clEnqueueMapImage0(long command_queue, long image, int blocking_map, long map_flags, Object origin, int origin_byte_offset, Object range, int range_byte_offset, Object image_row_pitch, int image_row_pitch_byte_offset, Object image_slice_pitch, int image_slice_pitch_byte_offset, int num_events_in_wait_list, Object event_wait_list, int event_wait_list_byte_offset, Object event, int event_byte_offset, Object errcode_ret, int errcode_ret_byte_offset); + public long clGetExtensionFunctionAddress(String name) { + ByteBuffer res = clGetExtensionFunctionAddressImpl(name); + if(Platform.is32Bit()) { + return res.getInt(); + }else{ + return res.getLong(); + } + } + +/* private static void convert32To64(long[] values) { if(values.length%2 == 1) { values[values.length-1] = values[values.length/2]>>>32; @@ -128,3 +138,4 @@ values[i ] = temp & 0x00000000FFFFFFFFL; } } +*/
\ No newline at end of file diff --git a/test/com/jogamp/opencl/LowLevelBindingTest.java b/test/com/jogamp/opencl/LowLevelBindingTest.java index 8d618f7c..8d6aba41 100644 --- a/test/com/jogamp/opencl/LowLevelBindingTest.java +++ b/test/com/jogamp/opencl/LowLevelBindingTest.java @@ -59,8 +59,8 @@ public class LowLevelBindingTest { CL cl = CLPlatform.getLowLevelCLInterface(); -// System.out.println(((CLImpl)cl).clGetExtensionFunctionAddress("clCreateFromGLBuffer").getLong()); -// System.out.println(((CLImpl)cl).clGetExtensionFunctionAddress("clEnqueueAcquireGLObjects").getLong()); +// System.out.println(((CLImpl)cl).clGetExtensionFunctionAddress("clCreateFromGLBuffer")); +// System.out.println(((CLImpl)cl).clGetExtensionFunctionAddress("clEnqueueAcquireGLObjects")); int ret = CL.CL_SUCCESS; |