JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL20_nclEnqueueSVMMemcpy(JNIEnv *__env, jclass clazz, jlong command_queueAddress, jint blocking_copy, jlong dst_ptrAddress, jlong src_ptrAddress, jlong size, 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 *dst_ptr = (void *)(intptr_t)dst_ptrAddress;
	const void *src_ptr = (const void *)(intptr_t)src_ptrAddress;
	const cl_event *event_wait_list = (const cl_event *)(intptr_t)event_wait_listAddress;
	cl_event *event = (cl_event *)(intptr_t)eventAddress;
	clEnqueueSVMMemcpyPROC clEnqueueSVMMemcpy = (clEnqueueSVMMemcpyPROC)(intptr_t)__functionAddress;
	UNUSED_PARAMS(__env, clazz)
	return (jint)clEnqueueSVMMemcpy(command_queue, blocking_copy, dst_ptr, src_ptr, (size_t)size, num_events_in_wait_list, event_wait_list, event);
}
Beispiel #2
0
    /// Enqueues a command to copy \p size bytes of data from \p src_ptr to
    /// \p dst_ptr.
    ///
    /// \opencl_version_warning{2,0}
    ///
    /// \see_opencl2_ref{clEnqueueSVMMemcpy}
    void enqueue_svm_memcpy(void *dst_ptr,
                            const void *src_ptr,
                            size_t size,
                            const wait_list &events = wait_list())
    {
        cl_int ret = clEnqueueSVMMemcpy(
            m_queue,
            CL_TRUE,
            dst_ptr,
            src_ptr,
            size,
            events.size(),
            events.get_event_ptr(),
            0
        );

        if(ret != CL_SUCCESS){
            BOOST_THROW_EXCEPTION(opencl_error(ret));
        }
    }
Beispiel #3
0
    /// Enqueues a command to copy \p size bytes of data from \p src_ptr to
    /// \p dst_ptr. The operation is performed asynchronously.
    ///
    /// \opencl_version_warning{2,0}
    ///
    /// \see_opencl2_ref{clEnqueueSVMMemcpy}
    event enqueue_svm_memcpy_async(void *dst_ptr,
                                   const void *src_ptr,
                                   size_t size,
                                   const wait_list &events = wait_list())
    {
        event event_;

        cl_int ret = clEnqueueSVMMemcpy(
            m_queue,
            CL_FALSE,
            dst_ptr,
            src_ptr,
            size,
            events.size(),
            events.get_event_ptr(),
            &event_.get()
        );

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

        return event_;
    }