@@ -639,13 +639,23 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFill2D(
639
639
}
640
640
641
641
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemcpy2D (
642
- ur_queue_handle_t /* hQueue*/ , bool /* blocking*/ , void * /* pDst*/ ,
643
- size_t /* dstPitch*/ , const void * /* pSrc*/ , size_t /* srcPitch*/ ,
644
- size_t /* width*/ , size_t /* height*/ , uint32_t /* numEventsInWaitList*/ ,
645
- const ur_event_handle_t * /* phEventWaitList*/ ,
646
- ur_event_handle_t * /* phEvent*/ ) {
647
-
648
- DIE_NO_IMPLEMENTATION;
642
+ ur_queue_handle_t hQueue, bool blocking, void *pDst, size_t dstPitch,
643
+ const void *pSrc, size_t srcPitch, size_t width, size_t height,
644
+ uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
645
+ ur_event_handle_t *phEvent) {
646
+ return withTimingEvent (
647
+ UR_COMMAND_USM_MEMCPY_2D, hQueue, numEventsInWaitList, phEventWaitList,
648
+ phEvent,
649
+ [width, height, srcPitch, dstPitch, pDst, pSrc]() {
650
+ for (size_t h = 0 , Src_ind = 0 , Dst_ind = 0 ; h < height;
651
+ h++, Src_ind += srcPitch, Dst_ind += dstPitch) {
652
+ int8_t &d_mem = ur_cast<int8_t *>(pDst)[Dst_ind];
653
+ const int8_t &s_mem = ur_cast<const int8_t *>(pSrc)[Src_ind];
654
+ std::memcpy (&d_mem, &s_mem, width);
655
+ }
656
+ return UR_RESULT_SUCCESS;
657
+ },
658
+ blocking);
649
659
}
650
660
651
661
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite (
0 commit comments