'\" t .\" Title: clEnqueueCopyBufferRect .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 02/03/2019 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CLENQUEUECOPYBUFFERR" "3clc" "02/03/2019" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" clEnqueueCopyBufferRect \- Enqueues a command to copy a rectangular region from a buffer object to another buffer object\&. .SH "" .HP \w'cl_int\ clEnqueueCopyBufferRect('u .BI "cl_int clEnqueueCopyBufferRect(cl_command_queue\ " "command_queue" ", cl_mem\ " "src_buffer" ", cl_mem\ " "dst_buffer" ", const\ size_t\ *" "src_origin" ", const\ size_t\ *" "dst_origin" ", const\ size_t\ *" "region" ", size_t\ " "src_row_pitch" ", size_t\ " "src_slice_pitch" ", size_t\ " "dst_row_pitch" ", size_t\ " "dst_slice_pitch" ", cl_uint\ " "num_events_in_wait_list" ", const\ cl_event\ *" "event_wait_list" ", cl_event\ *" "event" ");" .SH "PARAMETERS" .PP \fI command_queue \fR .RS 4 The command\-queue in which the copy command will be queued\&. The OpenCL context associated with \fIcommand_queue\fR, \fIsrc_buffer\fR, and \fIdst_buffer\fR must be the same\&. .RE .PP \fI src_origin \fR .RS 4 The (\fIx, y, z\fR) offset in the memory region associated with \fIsrc_buffer\fR\&. For a 2D rectangle region, the \fIz\fR value given by \fIsrc_origin\fR[2] should be 0\&. The offset in bytes is computed as \fIsrc_origin\fR[2] * \fIsrc_slice_pitch\fR + \fIsrc_origin\fR[1] * \fIsrc_row_pitch\fR + \fIsrc_origin\fR[0]\&. .RE .PP \fI dst_origin \fR .RS 4 The (\fIx, y, z\fR) offset in the memory region associated with \fIdst_buffer\fR\&. For a 2D rectangle region, the \fIz\fR value given by \fIdst_origin\fR[2] should be 0\&. The offset in bytes is computed as \fIdst_origin\fR[2] * \fIdst_slice_pitch\fR + \fIdst_origin\fR[1] * \fIdst_row_pitch\fR + \fIdst_origin\fR[0]\&. .RE .PP \fIregion\fR .RS 4 The (\fIwidth, height, depth\fR) in bytes of the 2D or 3D rectangle being copied\&. For a 2D rectangle, the \fIdepth\fR value given by \fIregion\fR[2] should be 1\&. .RE .PP \fIsrc_row_pitch\fR .RS 4 The length of each row in bytes to be used for the memory region associated with \fIsrc_buffer\fR\&. If \fIsrc_row_pitch\fR is 0, \fIsrc_row_pitch\fR is computed as \fIregion\fR[0]\&. .RE .PP \fIsrc_slice_pitch\fR .RS 4 The length of each 2D slice in bytes to be used for the memory region associated with \fIsrc_buffer\fR\&. If \fIsrc_slice_pitch\fR is 0, \fIsrc_slice_pitch\fR is computed as \fIregion\fR[1] * \fIsrc_row_pitch\fR\&. .RE .PP \fIdst_row_pitch\fR .RS 4 The length of each row in bytes to be used for the memory region associated with \fIdst_buffer\fR\&. If \fIdst_row_pitch\fR is 0, \fIdst_row_pitch\fR is computed as \fIregion\fR[0]\&. .RE .PP \fIdst_slice_pitch\fR .RS 4 The length of each 2D slice in bytes to be used for the memory region associated with \fIdst_buffer\fR\&. If \fIdst_slice_pitch\fR is 0, \fIdst_slice_pitch\fR is computed as \fIregion\fR[1] * \fIdst_row_pitch\fR\&. .RE .PP \fI event_wait_list \fR, \fI num_events_in_wait_list \fR .RS 4 Specify events that need to complete before this particular command can be executed\&. If \fIevent_wait_list\fR is NULL, then this particular command does not wait on any event to complete\&. If \fIevent_wait_list\fR is NULL, \fInum_events_in_wait_list\fR must be 0\&. If \fIevent_wait_list\fR is not NULL, the list of events pointed to by \fIevent_wait_list\fR must be valid and \fInum_events_in_wait_list\fR must be greater than 0\&. The events specified in \fIevent_wait_list\fR act as synchronization points\&. The context associated with events in \fIevent_wait_list\fR and \fIcommand_queue\fR must be the same\&. The memory associated with \fIevent_wait_list\fR can be reused or freed after the function returns\&. .RE .PP \fI event \fR .RS 4 Returns an event object that identifies this particular copy command and can be used to query or queue a wait for this particular command to complete\&. \fIevent\fR can 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\&. \fBclEnqueueBarrierWithWaitList\fR(3clc) can be used instead\&. If the \fIevent_wait_list\fR and the \fIevent\fR arguments are not NULL, the \fIevent\fR argument should not refer to an element of the \fIevent_wait_list\fR array\&. .RE .SH "NOTES" .PP \fBclEnqueueCopyBufferRect\fRenqueues a command to copy a 2D or 3D rectangular region from the buffer object identified by \fIsrc_buffer\fR to a 2D or 3D region in the buffer object identified by \fIdst_buffer\fR\&. Copying begins at the source offset and destination offset which are computed as described in the description for \fIsrc_origin\fR and \fIdst_origin\fR\&. .PP Each byte of the region\*(Aqs width is copied from the source offset to the destination offset\&. After copying each width, the source and destination offsets are incremented by their respective source and destination row pitches\&. After copying each 2D rectangle, the source and destination offsets are incremented by their respective source and destination slice pitches\&. .PP NOTE: If \fIsrc_buffer\fR and \fIdst_buffer\fR are the same buffer object, \fIsrc_row_pitch\fR must equal \fIdst_row_pitch\fR and \fIsrc_slice_pitch\fR must equal \fIdst_slice_pitch\fR\&. .SH "ERRORS" .PP Returns CL_SUCCESS if the function is executed successfully\&. Otherwise, it returns one of the following errors: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_COMMAND_QUEUE if \fIcommand_queue\fR is not a valid command\-queue\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_CONTEXT if the context associated with \fIcommand_queue\fR, \fIsrc_buffer\fR, and \fIdst_buffer\fR are not the same or if the context associated with \fIcommand_queue\fR and events in \fIevent_wait_list\fR are not the same\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_MEM_OBJECT if \fIsrc_buffer\fR and \fIdst_buffer\fR are not valid buffer objects\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if (\fIsrc_offset\fR, \fIregion\fR) or (\fIdst_offset\fR, \fIregion\fR) require accessing elements outside the \fIsrc_buffer\fR and \fIdst_buffer\fR objects respectively\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if any \fIregion\fR array element is 0\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIsrc_row_pitch\fR is not 0 and is less than \fIregion\fR[0]\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIdst_row_pitch\fR is not 0 and is less than \fIregion\fR[0]\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIsrc_slice_pitch\fR is not 0 and is less than \fIregion\fR[1] * \fIsrc_row_pitch\fR or if \fIsrc_slice_pitch\fR is not 0 and is not a multiple of \fIsrc_row_pitch\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIdst_slice_pitch\fR is not 0 and is less than \fIregion\fR[1] * \fIdst_row_pitch\fR or if \fIdst_slice_pitch\fR is not 0 and is not a multiple of \fIdst_row_pitch\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIsrc_buffer\fR and \fIdst_buffer\fR are the same buffer object and \fIsrc_slice_pitch\fR is not equal to \fIdst_slice_pitch\fR and \fIsrc_row_pitch\fR is not equal to \fIdst_row_pitch\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_EVENT_WAIT_LIST if \fIevent_wait_list\fR is NULL and \fInum_events_in_wait_list\fR is > 0, or \fIevent_wait_list\fR is not NULL and \fInum_events_in_wait_list\fR is 0, or if event objects in \fIevent_wait_list\fR are not valid events\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_MEM_COPY_OVERLAP if \fIsrc_buffer\fR and \fIdst_buffer\fR are the same buffer object and the source and destination regions overlap or if \fIsrc_buffer\fR and \fIdst_buffer\fR are different sub\-buffers of the same associated buffer object and they overlap\&. Refer to Appendix E in the OpenCL specification for details on how to determine if source and destination regions overlap\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_MISALIGNED_SUB_BUFFER_OFFSET if \fIsrc_buffer\fR is a sub\-buffer object and \fIoffset\fR specified when the sub\-buffer object is created is not aligned to \fBCL_DEVICE_MEM_BASE_ADDR_ALIGN\fR value for device associated with \fIqueue\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_MISALIGNED_SUB_BUFFER_OFFSET if \fIdst_buffer\fR is a sub\-buffer object and \fIoffset\fR specified when the sub\-buffer object is created is not aligned to \fBCL_DEVICE_MEM_BASE_ADDR_ALIGN\fR value for device associated with \fIqueue\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with \fIsrc_buffer\fR or \fIdst_buffer\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host\&. .RE .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBclEnqueueReadBuffer\fR(3clc), \fBclEnqueueReadBufferRect\fR(3clc), \fBclEnqueueWriteBuffer\fR(3clc), \fBclEnqueueWriteBufferRect\fR(3clc), \fBclEnqueueCopyBuffer\fR(3clc), \fBclCreateBuffer\fR(3clc), \fBclCreateSubBuffer\fR(3clc), \fBclEnqueueCopyBufferToImage\fR(3clc), \fBclEnqueueCopyImageToBuffer\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials. .sp .SH "NOTES" .IP " 1." 4 OpenCL Specification .RS 4 \%page 81, section 5.2.2 - Reading, Writing and Copying Buffer Objects .RE