diff options
author | Sven Gothel <[email protected]> | 2010-05-13 22:50:05 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-05-13 22:50:05 +0200 |
commit | 17a620f17f65e8581f1a04f5d2825c24a87678b8 (patch) | |
tree | fa01b1e7f46ec2b9d3fa16b6dd26b63445b4dba6 /resources/clImplCustomCode.java | |
parent | 4bbfd2d4e1544a120facae7e7d8f0e2322c1618f (diff) | |
parent | 6f0a2ffd21d178167dd8e7db3c14da94a2d91f7e (diff) |
Merge branch 'master' of git://github.com/mbien/jocl
Diffstat (limited to 'resources/clImplCustomCode.java')
-rw-r--r-- | resources/clImplCustomCode.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/resources/clImplCustomCode.java b/resources/clImplCustomCode.java index d2993f96..4f9f4c2e 100644 --- a/resources/clImplCustomCode.java +++ b/resources/clImplCustomCode.java @@ -15,6 +15,9 @@ if(properties!=null && !properties.isDirect()) throw new RuntimeException("Argument \"properties\" was not a direct buffer"); + if(errcode_ret!=null && !errcode_ret.isDirect()) + throw new RuntimeException("Argument \"errcode_ret\" was not a direct buffer"); + long[] global = new long[1]; long ctx = this.clCreateContext0( properties!=null?properties.getBuffer():null, Buffers.getDirectBufferByteOffset(properties), @@ -28,7 +31,7 @@ } return ctx; } - private native long clCreateContext0(Object cl_context_properties, int props_offset, int numDevices, Object devices, int devices_offset, CLErrorHandler pfn_notify, long[] global, Object errcode_ret, int err_offset); + private native long clCreateContext0(Object cl_context_properties, int props_offset, int numDevices, Object devices, int devices_offset, Object pfn_notify, long[] global, Object errcode_ret, int err_offset); public long clCreateContextFromType(PointerBuffer properties, long device_type, CLErrorHandler pfn_notify, IntBuffer errcode_ret) { @@ -36,6 +39,9 @@ if(properties!=null && !properties.isDirect()) throw new RuntimeException("Argument \"properties\" was not a direct buffer"); + if(errcode_ret!=null && !errcode_ret.isDirect()) + throw new RuntimeException("Argument \"errcode_ret\" was not a direct buffer"); + long[] global = new long[1]; long ctx = this.clCreateContextFromType0( properties!=null?properties.getBuffer():null, Buffers.getDirectBufferByteOffset(properties), @@ -48,7 +54,7 @@ } return ctx; } - private native long clCreateContextFromType0(Object properties, int props_offset, long device_type, CLErrorHandler pfn_notify, long[] global, Object errcode_ret, int err_offset); + private native long clCreateContextFromType0(Object properties, int props_offset, long device_type, Object pfn_notify, long[] global, Object errcode_ret, int err_offset); public int clReleaseContext(long context) { |