@@ -626,7 +626,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp(
626
626
}
627
627
628
628
UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp (
629
- ur_queue_handle_t hQueue, void *pDst, void *pSrc,
629
+ ur_queue_handle_t hQueue, void *pDst, const void *pSrc,
630
630
const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc,
631
631
ur_exp_image_copy_flags_t imageCopyFlags, ur_rect_offset_t srcOffset,
632
632
ur_rect_offset_t dstOffset, ur_rect_region_t copyExtent,
@@ -668,18 +668,21 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp(
668
668
(CUdeviceptr)pDst) != CUDA_SUCCESS;
669
669
670
670
size_t CopyExtentBytes = PixelSizeBytes * copyExtent.width ;
671
- char *SrcWithOffset = (char *)pSrc + (srcOffset.x * PixelSizeBytes);
671
+ const char *SrcWithOffset =
672
+ static_cast <const char *>(pSrc) + (srcOffset.x * PixelSizeBytes);
672
673
673
674
if (isCudaArray) {
674
- UR_CHECK_ERROR (cuMemcpyHtoAAsync (
675
- (CUarray)pDst, dstOffset.x * PixelSizeBytes,
676
- (void *)SrcWithOffset, CopyExtentBytes, Stream));
675
+ UR_CHECK_ERROR (
676
+ cuMemcpyHtoAAsync ((CUarray)pDst, dstOffset.x * PixelSizeBytes,
677
+ static_cast <const void *>(SrcWithOffset),
678
+ CopyExtentBytes, Stream));
677
679
} else if (memType == CU_MEMORYTYPE_DEVICE) {
678
- void *DstWithOffset =
679
- (void *)((char *)pDst + (PixelSizeBytes * dstOffset.x ));
680
- UR_CHECK_ERROR (cuMemcpyHtoDAsync ((CUdeviceptr)DstWithOffset,
681
- (void *)SrcWithOffset,
682
- CopyExtentBytes, Stream));
680
+ void *DstWithOffset = static_cast <void *>(
681
+ static_cast <char *>(pDst) + (PixelSizeBytes * dstOffset.x ));
682
+ UR_CHECK_ERROR (
683
+ cuMemcpyHtoDAsync ((CUdeviceptr)DstWithOffset,
684
+ static_cast <const void *>(SrcWithOffset),
685
+ CopyExtentBytes, Stream));
683
686
} else {
684
687
// This should be unreachable.
685
688
return UR_RESULT_ERROR_INVALID_VALUE;
@@ -755,15 +758,16 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp(
755
758
(CUdeviceptr)pSrc) != CUDA_SUCCESS;
756
759
757
760
size_t CopyExtentBytes = PixelSizeBytes * copyExtent.width ;
758
- void *DstWithOffset =
759
- ( void *)(( char *) pDst + (PixelSizeBytes * dstOffset.x ));
761
+ void *DstWithOffset = static_cast < void *>(
762
+ static_cast < char *>( pDst) + (PixelSizeBytes * dstOffset.x ));
760
763
761
764
if (isCudaArray) {
762
765
UR_CHECK_ERROR (cuMemcpyAtoHAsync (DstWithOffset, (CUarray)pSrc,
763
766
PixelSizeBytes * srcOffset.x ,
764
767
CopyExtentBytes, Stream));
765
768
} else if (memType == CU_MEMORYTYPE_DEVICE) {
766
- char *SrcWithOffset = (char *)pSrc + (srcOffset.x * PixelSizeBytes);
769
+ const char *SrcWithOffset =
770
+ static_cast <const char *>(pSrc) + (srcOffset.x * PixelSizeBytes);
767
771
UR_CHECK_ERROR (cuMemcpyDtoHAsync (DstWithOffset,
768
772
(CUdeviceptr)SrcWithOffset,
769
773
CopyExtentBytes, Stream));
0 commit comments