@@ -165,6 +165,187 @@ ur_result_t urCommandBufferAppendUSMMemcpyExp(
165165 return exceptionToResult (std::current_exception ());
166166}
167167
168+ ur_result_t urCommandBufferAppendMemBufferCopyExp (
169+ ur_exp_command_buffer_handle_t hCommandBuffer, ur_mem_handle_t hSrcMem,
170+ ur_mem_handle_t hDstMem, size_t srcOffset, size_t dstOffset, size_t size,
171+ uint32_t numSyncPointsInWaitList,
172+ const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
173+ uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
174+ ur_exp_command_buffer_sync_point_t *pSyncPoint, ur_event_handle_t *phEvent,
175+ ur_exp_command_buffer_command_handle_t *phCommand) try {
176+
177+ // the same issue as in urCommandBufferAppendKernelLaunchExp
178+ std::ignore = numEventsInWaitList;
179+ std::ignore = phEventWaitList;
180+ std::ignore = phEvent;
181+ // sync mechanic can be ignored, because all lists are in-order
182+ std::ignore = numSyncPointsInWaitList;
183+ std::ignore = pSyncPointWaitList;
184+ std::ignore = pSyncPoint;
185+
186+ std::ignore = phCommand;
187+ // Responsibility of UMD to offload to copy engine
188+ UR_CALL (hCommandBuffer->commandListManager .appendMemBufferCopy (
189+ hSrcMem, hDstMem, srcOffset, dstOffset, size, 0 , nullptr , nullptr ));
190+
191+ return UR_RESULT_SUCCESS;
192+ } catch (...) {
193+ return exceptionToResult (std::current_exception ());
194+ }
195+
196+ ur_result_t urCommandBufferAppendMemBufferWriteExp (
197+ ur_exp_command_buffer_handle_t hCommandBuffer, ur_mem_handle_t hBuffer,
198+ size_t offset, size_t size, const void *pSrc,
199+ uint32_t numSyncPointsInWaitList,
200+ const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
201+ uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
202+ ur_exp_command_buffer_sync_point_t *pSyncPoint, ur_event_handle_t *phEvent,
203+ ur_exp_command_buffer_command_handle_t *phCommand) try {
204+
205+ // the same issue as in urCommandBufferAppendKernelLaunchExp
206+ std::ignore = numEventsInWaitList;
207+ std::ignore = phEventWaitList;
208+ std::ignore = phEvent;
209+ // sync mechanic can be ignored, because all lists are in-order
210+ std::ignore = numSyncPointsInWaitList;
211+ std::ignore = pSyncPointWaitList;
212+ std::ignore = pSyncPoint;
213+
214+ std::ignore = phCommand;
215+ // Responsibility of UMD to offload to copy engine
216+ UR_CALL (hCommandBuffer->commandListManager .appendMemBufferWrite (
217+ hBuffer, false , offset, size, pSrc, 0 , nullptr , nullptr ));
218+
219+ return UR_RESULT_SUCCESS;
220+ } catch (...) {
221+ return exceptionToResult (std::current_exception ());
222+ }
223+
224+ ur_result_t urCommandBufferAppendMemBufferReadExp (
225+ ur_exp_command_buffer_handle_t hCommandBuffer, ur_mem_handle_t hBuffer,
226+ size_t offset, size_t size, void *pDst, uint32_t numSyncPointsInWaitList,
227+ const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
228+ uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
229+ ur_exp_command_buffer_sync_point_t *pSyncPoint, ur_event_handle_t *phEvent,
230+ ur_exp_command_buffer_command_handle_t *phCommand) try {
231+
232+ // the same issue as in urCommandBufferAppendKernelLaunchExp
233+ std::ignore = numEventsInWaitList;
234+ std::ignore = phEventWaitList;
235+ std::ignore = phEvent;
236+ // sync mechanic can be ignored, because all lists are in-order
237+ std::ignore = numSyncPointsInWaitList;
238+ std::ignore = pSyncPointWaitList;
239+ std::ignore = pSyncPoint;
240+
241+ std::ignore = phCommand;
242+
243+ // Responsibility of UMD to offload to copy engine
244+ UR_CALL (hCommandBuffer->commandListManager .appendMemBufferRead (
245+ hBuffer, false , offset, size, pDst, 0 , nullptr , nullptr ));
246+
247+ return UR_RESULT_SUCCESS;
248+ } catch (...) {
249+ return exceptionToResult (std::current_exception ());
250+ }
251+
252+ ur_result_t urCommandBufferAppendMemBufferCopyRectExp (
253+ ur_exp_command_buffer_handle_t hCommandBuffer, ur_mem_handle_t hSrcMem,
254+ ur_mem_handle_t hDstMem, ur_rect_offset_t srcOrigin,
255+ ur_rect_offset_t dstOrigin, ur_rect_region_t region, size_t srcRowPitch,
256+ size_t srcSlicePitch, size_t dstRowPitch, size_t dstSlicePitch,
257+ uint32_t numSyncPointsInWaitList,
258+ const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
259+ uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
260+ ur_exp_command_buffer_sync_point_t *pSyncPoint, ur_event_handle_t *phEvent,
261+ ur_exp_command_buffer_command_handle_t *phCommand) try {
262+
263+ // the same issue as in urCommandBufferAppendKernelLaunchExp
264+ std::ignore = numEventsInWaitList;
265+ std::ignore = phEventWaitList;
266+ std::ignore = phEvent;
267+ // sync mechanic can be ignored, because all lists are in-order
268+ std::ignore = numSyncPointsInWaitList;
269+ std::ignore = pSyncPointWaitList;
270+ std::ignore = pSyncPoint;
271+
272+ std::ignore = phCommand;
273+ // Responsibility of UMD to offload to copy engine
274+ UR_CALL (hCommandBuffer->commandListManager .appendMemBufferCopyRect (
275+ hSrcMem, hDstMem, srcOrigin, dstOrigin, region, srcRowPitch,
276+ srcSlicePitch, dstRowPitch, dstSlicePitch, 0 , nullptr , nullptr ));
277+
278+ return UR_RESULT_SUCCESS;
279+ } catch (...) {
280+ return exceptionToResult (std::current_exception ());
281+ }
282+
283+ ur_result_t urCommandBufferAppendMemBufferWriteRectExp (
284+ ur_exp_command_buffer_handle_t hCommandBuffer, ur_mem_handle_t hBuffer,
285+ ur_rect_offset_t bufferOffset, ur_rect_offset_t hostOffset,
286+ ur_rect_region_t region, size_t bufferRowPitch, size_t bufferSlicePitch,
287+ size_t hostRowPitch, size_t hostSlicePitch, void *pSrc,
288+ uint32_t numSyncPointsInWaitList,
289+ const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
290+ uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
291+ ur_exp_command_buffer_sync_point_t *pSyncPoint, ur_event_handle_t *phEvent,
292+ ur_exp_command_buffer_command_handle_t *phCommand) try {
293+
294+ // the same issue as in urCommandBufferAppendKernelLaunchExp
295+ std::ignore = numEventsInWaitList;
296+ std::ignore = phEventWaitList;
297+ std::ignore = phEvent;
298+ // sync mechanic can be ignored, because all lists are in-order
299+ std::ignore = numSyncPointsInWaitList;
300+ std::ignore = pSyncPointWaitList;
301+ std::ignore = pSyncPoint;
302+
303+ std::ignore = phCommand;
304+
305+ // Responsibility of UMD to offload to copy engine
306+ UR_CALL (hCommandBuffer->commandListManager .appendMemBufferWriteRect (
307+ hBuffer, false , bufferOffset, hostOffset, region, bufferRowPitch,
308+ bufferSlicePitch, hostRowPitch, hostSlicePitch, pSrc, 0 , nullptr ,
309+ nullptr ));
310+
311+ return UR_RESULT_SUCCESS;
312+ } catch (...) {
313+ return exceptionToResult (std::current_exception ());
314+ }
315+
316+ ur_result_t urCommandBufferAppendMemBufferReadRectExp (
317+ ur_exp_command_buffer_handle_t hCommandBuffer, ur_mem_handle_t hBuffer,
318+ ur_rect_offset_t bufferOffset, ur_rect_offset_t hostOffset,
319+ ur_rect_region_t region, size_t bufferRowPitch, size_t bufferSlicePitch,
320+ size_t hostRowPitch, size_t hostSlicePitch, void *pDst,
321+ uint32_t numSyncPointsInWaitList,
322+ const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
323+ uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
324+ ur_exp_command_buffer_sync_point_t *pSyncPoint, ur_event_handle_t *phEvent,
325+ ur_exp_command_buffer_command_handle_t *phCommand) try {
326+
327+ // the same issue as in urCommandBufferAppendKernelLaunchExp
328+ std::ignore = numEventsInWaitList;
329+ std::ignore = phEventWaitList;
330+ std::ignore = phEvent;
331+ // sync mechanic can be ignored, because all lists are in-order
332+ std::ignore = numSyncPointsInWaitList;
333+ std::ignore = pSyncPointWaitList;
334+ std::ignore = pSyncPoint;
335+
336+ std::ignore = phCommand;
337+
338+ // Responsibility of UMD to offload to copy engine
339+ UR_CALL (hCommandBuffer->commandListManager .appendMemBufferReadRect (
340+ hBuffer, false , bufferOffset, hostOffset, region, bufferRowPitch,
341+ bufferSlicePitch, hostRowPitch, hostSlicePitch, pDst, 0 , nullptr ,
342+ nullptr ));
343+
344+ return UR_RESULT_SUCCESS;
345+ } catch (...) {
346+ return exceptionToResult (std::current_exception ());
347+ }
348+
168349ur_result_t
169350urCommandBufferGetInfoExp (ur_exp_command_buffer_handle_t hCommandBuffer,
170351 ur_exp_command_buffer_info_t propName,
0 commit comments