diff options
Diffstat (limited to 'resources')
-rw-r--r-- | resources/clImplCustomCode.c | 8 | ||||
-rw-r--r-- | resources/clImplCustomCode.java | 21 |
2 files changed, 24 insertions, 5 deletions
diff --git a/resources/clImplCustomCode.c b/resources/clImplCustomCode.c index 9c87c24a..41e9f159 100644 --- a/resources/clImplCustomCode.c +++ b/resources/clImplCustomCode.c @@ -110,6 +110,14 @@ Java_com_mbien_opencl_impl_CLImpl_clBuildProgram0(JNIEnv *env, jobject _unused, if (deviceList != NULL) { _deviceListPtr = (void *) (((char*) (*env)->GetPrimitiveArrayCritical(env, deviceList, NULL)) + offset); } + +/* + printf("---------------------------------------------------------------------------\n"); + printf("deviceList: %d\n", _deviceListPtr); + printf("_strchars_options: %d\n", _strchars_options); + printf("deviceCount: %d\n", deviceCount); + printf("---------------------------------------------------------------------------\n"); +*/ // TODO payload, callback... _res = clBuildProgram((cl_program)program, (cl_uint)deviceCount, _deviceListPtr, _strchars_options, NULL, NULL); diff --git a/resources/clImplCustomCode.java b/resources/clImplCustomCode.java index 618b03c2..3c5e1f07 100644 --- a/resources/clImplCustomCode.java +++ b/resources/clImplCustomCode.java @@ -1,5 +1,6 @@ public long clCreateContext(IntBuffer properties, int offset1, long[] devices, CreateContextCallback cb, Object userData, IntBuffer errcode_ret, int offset2) { + throw new RuntimeException("not yet implemented, use clCreateContextFromType instead"); // return this.clCreateContext0(properties, offset1, devices, cb, null, errcode_ret, offset2); } @@ -7,10 +8,13 @@ public long clCreateContextFromType(IntBuffer properties, int offset1, long device_type, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret, int offset2) { + 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.out.println("WARNING: userData not yet implemented... ignoring"); + return this.clCreateContextFromType0(properties, offset1, device_type, pfn_notify, null, errcode_ret, offset2); } private native long clCreateContextFromType0(IntBuffer properties, int size, long device_type, CreateContextCallback pfn_notify, Object userData, IntBuffer errcode_ret, int size2); @@ -18,11 +22,18 @@ /** 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, long[] deviceList, String options, BuildProgramCallback cb, Object userData) { - 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.out.println("WARNING: userData not yet implemented... ignoring"); - return clBuildProgram0(program, deviceList.length, deviceList, 0, options, cb, userData); + + 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.out.println("WARNING: userData not yet implemented... ignoring"); + + int listLength = 0; + if(deviceList != null) + listLength = deviceList.length; + + return clBuildProgram0(program, listLength, deviceList, 0, options, cb, userData); } /** 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 devices, Object deviceList, int arg2_byte_offset, String options, BuildProgramCallback cb, Object userData); |