JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL20_nclEnqueueSVMFree(JNIEnv *__env, jclass clazz, jlong command_queueAddress, jint num_svm_pointers, jlong svm_pointersAddress, jlong pfn_free_funcAddress, jlong user_dataAddress, jint num_events_in_wait_list, jlong event_wait_listAddress, jlong eventAddress, jlong __functionAddress) {
	cl_command_queue command_queue = (cl_command_queue)(intptr_t)command_queueAddress;
	void **svm_pointers = (void **)(intptr_t)svm_pointersAddress;
	cl_svmfree_callback pfn_free_func = (cl_svmfree_callback)(intptr_t)pfn_free_funcAddress;
	void *user_data = (void *)(intptr_t)user_dataAddress;
	const cl_event *event_wait_list = (const cl_event *)(intptr_t)event_wait_listAddress;
	cl_event *event = (cl_event *)(intptr_t)eventAddress;
	clEnqueueSVMFreePROC clEnqueueSVMFree = (clEnqueueSVMFreePROC)(intptr_t)__functionAddress;
	UNUSED_PARAMS(__env, clazz)
	return (jint)clEnqueueSVMFree(command_queue, num_svm_pointers, svm_pointers, pfn_free_func, user_data, num_events_in_wait_list, event_wait_list, event);
}
예제 #2
0
    /// Enqueues a command to free \p svm_ptr.
    ///
    /// \opencl_version_warning{2,0}
    ///
    /// \see_opencl2_ref{clEnqueueSVMFree}
    ///
    /// \see svm_free()
    event enqueue_svm_free(void *svm_ptr,
                           const wait_list &events = wait_list())
    {
        event event_;

        cl_int ret = clEnqueueSVMFree(
            m_queue,
            1,
            &svm_ptr,
            0,
            0,
            events.size(),
            events.get_event_ptr(),
            &event_.get()
        );

        if(ret != CL_SUCCESS){
            BOOST_THROW_EXCEPTION(opencl_error(ret));
        }

        return event_;
    }