summaryrefslogtreecommitdiffstats
path: root/resources/clImplCustomCode.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-04-25 14:27:17 +0200
committerMichael Bien <[email protected]>2010-04-25 14:27:17 +0200
commitf129ec5b006062e7a63cd9afbb92057b8faaeef9 (patch)
tree7c3d53d141bd795d3cfc4368ff34351e5b4290cb /resources/clImplCustomCode.java
parent1be089aa2acaeef8670a5b19e7c2d08e7c87cb94 (diff)
implemented low level BuildProgramCallbacks.
- removed userdata arguments from createContext* and buildProgram bindings - updated LowLevelBindingTest
Diffstat (limited to 'resources/clImplCustomCode.java')
-rw-r--r--resources/clImplCustomCode.java44
1 files changed, 16 insertions, 28 deletions
diff --git a/resources/clImplCustomCode.java b/resources/clImplCustomCode.java
index 9edbd575..5ebf12aa 100644
--- a/resources/clImplCustomCode.java
+++ b/resources/clImplCustomCode.java
@@ -5,63 +5,48 @@
this.addressTable = addressTable;
}
- public long clCreateContext(PointerBuffer properties, PointerBuffer devices, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret) {
+ public long clCreateContext(PointerBuffer properties, PointerBuffer devices, CreateContextCallback pfn_notify, IntBuffer errcode_ret) {
if(properties!=null && !properties.isDirect())
throw new RuntimeException("Argument \"properties\" was not a direct buffer");
if(pfn_notify != null)
- throw new RuntimeException("asynchronous execution with callback is not yet implemented, pass null through this method to block until complete.");
-
- if(userData != null)
- System.err.println("WARNING: userData not yet implemented... ignoring");
+ throw new RuntimeException("asynchronous errorhandler are not supported yet, pass null through this method to block until complete.");
return this.clCreateContext0(
properties!=null?properties.getBuffer():null, Buffers.getDirectBufferByteOffset(properties),
devices!=null?devices.remaining():0, devices!=null?devices.getBuffer():null, Buffers.getDirectBufferByteOffset(devices),
- null, null,
- errcode_ret, Buffers.getDirectBufferByteOffset(errcode_ret) );
+ null, errcode_ret, Buffers.getDirectBufferByteOffset(errcode_ret) );
}
- private native long clCreateContext0(Object cl_context_properties, int props_offset, int numDevices, Object devices, int devices_offset, CreateContextCallback pfn_notify, Object userData, Object errcode_ret, int err_offset);
+ private native long clCreateContext0(Object cl_context_properties, int props_offset, int numDevices, Object devices, int devices_offset, CreateContextCallback pfn_notify, Object errcode_ret, int err_offset);
- public long clCreateContextFromType(PointerBuffer properties, long device_type, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret) {
+ public long clCreateContextFromType(PointerBuffer properties, long device_type, CreateContextCallback pfn_notify, IntBuffer errcode_ret) {
if(properties!=null && !properties.isDirect())
throw new RuntimeException("Argument \"properties\" was not a direct buffer");
if(pfn_notify != null)
- throw new RuntimeException("asynchronous execution with callback is not yet implemented, pass null through this method to block until complete.");
-
- if(userData != null)
- System.err.println("WARNING: userData not yet implemented... ignoring");
+ throw new RuntimeException("asynchronous errorhandler are not supported yet, pass null through this method to block until complete.");
return this.clCreateContextFromType0(
properties!=null?properties.getBuffer():null, Buffers.getDirectBufferByteOffset(properties),
- device_type, pfn_notify, null,
- errcode_ret, Buffers.getDirectBufferByteOffset(errcode_ret) );
+ device_type, pfn_notify, errcode_ret, Buffers.getDirectBufferByteOffset(errcode_ret) );
}
- private native long clCreateContextFromType0(Object properties, int props_offset, long device_type, CreateContextCallback pfn_notify, Object userData, Object errcode_ret, int err_offset);
+ private native long clCreateContextFromType0(Object properties, int props_offset, long device_type, CreateContextCallback pfn_notify, Object errcode_ret, int err_offset);
/** Interface to C language function: <br> <code> int32_t clBuildProgram(cl_program, uint32_t, cl_device_id * , const char * , void * ); </code> */
- public int clBuildProgram(long program, int deviceCount, PointerBuffer deviceList, String options, BuildProgramCallback cb, Object userData) {
+ public int clBuildProgram(long program, int deviceCount, PointerBuffer deviceList, String options, BuildProgramCallback cb) {
if(deviceList!=null && !deviceList.isDirect())
throw new RuntimeException("Argument \"properties\" was not a direct buffer");
- if(cb != null)
- throw new RuntimeException("asynchronous execution with callback is not yet implemented, pass null through this method to block until complete.");
-
- if(userData != null)
- System.err.println("WARNING: userData not yet implemented... ignoring");
-
- return clBuildProgram0(program, deviceCount,
- deviceList!=null?deviceList.getBuffer():null, Buffers.getDirectBufferByteOffset(deviceList),
- options, cb, userData);
+ return clBuildProgram0(program, deviceCount, deviceList!=null?deviceList.getBuffer():null,
+ Buffers.getDirectBufferByteOffset(deviceList), options, cb);
}
/** Entry point to C language function: <code> int32_t clBuildProgram(cl_program, uint32_t, cl_device_id * , const char * , void * ); </code> */
- private native int clBuildProgram0(long program, int deviceCount, Object deviceList, int deviceListOffset, String options, BuildProgramCallback cb, Object userData);
+ private native int clBuildProgram0(long program, int deviceCount, Object deviceList, int deviceListOffset, String options, BuildProgramCallback cb);
/** Interface to C language function: <br> <code> void * {@native clEnqueueMapImage}(cl_command_queue command_queue, cl_mem image, uint32_t blocking_map, uint64_t map_flags, const size_t * , const size_t * , size_t * image_row_pitch, size_t * image_slice_pitch, uint32_t num_events_in_wait_list, cl_event * event_wait_list, cl_event * event, int32_t * errcode_ret); </code>
@@ -115,9 +100,12 @@
@param event_wait_list a direct {@link com.jogamp.gluegen.runtime.PointerBuffer}
@param event a direct {@link com.jogamp.gluegen.runtime.PointerBuffer}
@param errcode_ret a direct {@link java.nio.IntBuffer} */
- 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);
+ private native 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);
+ /**
+ * Returns the extension function address for the given function name.
+ */
public long clGetExtensionFunctionAddress(String name) {
ByteBuffer res = clGetExtensionFunctionAddressImpl(name);
if(Platform.is32Bit()) {