Enqueues a command to do a memcpy operation.
cl_int clEnqueueSVMMemcpy(cl_command_queue command_queue, cl_bool blocking_copy, void *dst_ptr, const void *src_ptr, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
Refers to the host command-queue in which the read / write command will be queued. queued. If either
src_ptris allocated using clSVMAlloc then the OpenCL context allocated against must match that of
Indicates if the copy operation is blocking or non-blocking.
CL_TRUEi.e. the copy command is blocking,
clEnqueueSVMMemcpydoes not return until the buffer data has been copied into memory pointed to by
CL_FALSEi.e. the copy command is non-blocking,
clEnqueueSVMMemcpyqueues a non-blocking copy command and returns. The contents of the buffer that
dst_ptrpoint to cannot be used until the copy command has completed. The
eventargument returns an event object which can be used to query the execution status of the read command. When the copy command has completed, the contents of the buffer that
dst_ptrpoints to can be used by the application.
The size in bytes of data being copied.
The pointer to a host or SVM memory allocation where data is copied to.
The pointer to a memory region where data is copied from.
If the memory allocation(s) containing
src_ptrare allocated using
clSVMAllocand either is not allocated from the same context from which
command_queuewas created the behavior is undefined.
Specify events that need to complete before
clEnqueueSVMMemcpycan be executed. If
event_wait_listis NULL, then
clEnqueueSVMMemcpydoes not wait on any event to complete. If
num_events_in_wait_listmust be 0. If
event_wait_listis not NULL, the list of events pointed to by
event_wait_listmust be valid and
num_events_in_wait_listmust be greater than 0. The events specified in
event_wait_listact as synchronization points. The context associated with events in
command_queuemust be the same. The memory associated with
event_wait_listcan be reused or freed after the function returns.
Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete.
eventcan be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the
eventarguments are not NULL, the
eventargument should not refer to an element of the
CL_SUCCESS if the function is executed successfully.
Otherwise, it returns one of the following errors:
command_queueis not a valid host command-queue.
CL_INVALID_CONTEXTif the context associated with
command_queueand events in
event_wait_listare not the same.
event_wait_listis NULL and
num_events_in_wait_list> 0, or
event_wait_listis not NULL and
num_events_in_wait_listis 0, or if event objects in
event_wait_listare not valid events.
CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LISTif the copy operation is blocking and the execution status of any of the events in
event_wait_listis a negative integer value.
CL_MEM_COPY_OVERLAPif the values specified for
sizeresult in an overlapping copy.
CL_OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.