summaryrefslogtreecommitdiffstats
path: root/resources/clImplCustomCode.java
diff options
context:
space:
mode:
Diffstat (limited to 'resources/clImplCustomCode.java')
-rw-r--r--resources/clImplCustomCode.java10
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) {