Merge preparation.
This commit is contained in:
parent
c9e1319fc6
commit
bab22f696b
|
@ -107,14 +107,13 @@ final class CallbackUtil {
|
|||
* @param user_data the global reference pointer
|
||||
*/
|
||||
static void registerCallback(final CLContext context, final long user_data) {
|
||||
if ( context.getPointerUnsafe() == 0 ) {
|
||||
if ( user_data != 0 )
|
||||
deleteGlobalRef(user_data);
|
||||
if ( user_data == 0 )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( user_data != 0 )
|
||||
if ( context.isValid() )
|
||||
contextUserData.put(context, user_data);
|
||||
else
|
||||
deleteGlobalRef(user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -59,18 +59,11 @@ typedef GLsync cl_GLsync;
|
|||
#define CL_CALLBACK
|
||||
#endif
|
||||
|
||||
// TODO: This is a bug in current CL implementations (AMD's only?), remove when fixed. (used for cl_native_kernel_func)
|
||||
#if defined(_WIN32)
|
||||
#define CL_USER_FUNC_CALLBACK __cdecl
|
||||
#else
|
||||
#define CL_USER_FUNC_CALLBACK CL_CALLBACK
|
||||
#endif
|
||||
|
||||
typedef void (CL_CALLBACK * cl_create_context_callback)(const char *errinfo, const void *private_info, size_t cb, void *user_data);
|
||||
typedef void (CL_CALLBACK * cl_mem_object_destructor_callback)(cl_mem memobj, void *user_data);
|
||||
typedef void (CL_CALLBACK * cl_build_program_callback)(cl_program program, void *user_data);
|
||||
typedef void (CL_CALLBACK * cl_event_callback)(cl_event event, cl_int event_command_exec_status, void *user_data);
|
||||
typedef void (CL_USER_FUNC_CALLBACK * cl_native_kernel_func)(void *args);
|
||||
typedef void (CL_CALLBACK * cl_native_kernel_func)(void *args);
|
||||
|
||||
// -----------------[ Cross-platform functions ]-----------------
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getBuildProgramCallba
|
|||
|
||||
// ----------------- [ NATIVE KERNEL CALLBACK ] -----------------
|
||||
|
||||
static void CL_USER_FUNC_CALLBACK nativeKernelCallback(void *args) {
|
||||
static void CL_CALLBACK nativeKernelCallback(void *args) {
|
||||
JNIEnv *env = attachCurrentThread();
|
||||
jobject user_func = (jobject)(intptr_t)*(jlong *)args;
|
||||
jint num_mem_objects = *(jint *)((char *)args + 8);
|
||||
|
|
Loading…
Reference in New Issue