summaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-05-12 17:17:44 +0200
committerMichael Bien <[email protected]>2010-05-12 17:17:44 +0200
commit503f38b03f6fabcba6e3c3c573eec949966b86ca (patch)
tree0f694a2204c0fb43ecb330f91b116641388267aa /resources
parent8a7c4ac5cea58cad873e4ec4e429c84649e09995 (diff)
status should be an direct buffer.
Diffstat (limited to 'resources')
-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) {