@@ -634,7 +634,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp(
634
634
}
635
635
636
636
UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp (
637
- ur_queue_handle_t hQueue, void *pDst, void *pSrc,
637
+ ur_queue_handle_t hQueue, void *pDst, const void *pSrc,
638
638
const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc,
639
639
ur_exp_image_copy_flags_t imageCopyFlags, ur_rect_offset_t srcOffset,
640
640
ur_rect_offset_t dstOffset, ur_rect_region_t copyExtent,
@@ -676,18 +676,21 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp(
676
676
(CUdeviceptr)pDst) != CUDA_SUCCESS;
677
677
678
678
size_t CopyExtentBytes = PixelSizeBytes * copyExtent.width ;
679
- char *SrcWithOffset = (char *)pSrc + (srcOffset.x * PixelSizeBytes);
679
+ const char *SrcWithOffset =
680
+ static_cast <const char *>(pSrc) + (srcOffset.x * PixelSizeBytes);
680
681
681
682
if (isCudaArray) {
682
- UR_CHECK_ERROR (cuMemcpyHtoAAsync (
683
- (CUarray)pDst, dstOffset.x * PixelSizeBytes,
684
- (void *)SrcWithOffset, CopyExtentBytes, Stream));
683
+ UR_CHECK_ERROR (
684
+ cuMemcpyHtoAAsync ((CUarray)pDst, dstOffset.x * PixelSizeBytes,
685
+ static_cast <const void *>(SrcWithOffset),
686
+ CopyExtentBytes, Stream));
685
687
} else if (memType == CU_MEMORYTYPE_DEVICE) {
686
- void *DstWithOffset =
687
- (void *)((char *)pDst + (PixelSizeBytes * dstOffset.x ));
688
- UR_CHECK_ERROR (cuMemcpyHtoDAsync ((CUdeviceptr)DstWithOffset,
689
- (void *)SrcWithOffset,
690
- CopyExtentBytes, Stream));
688
+ void *DstWithOffset = static_cast <void *>(
689
+ static_cast <char *>(pDst) + (PixelSizeBytes * dstOffset.x ));
690
+ UR_CHECK_ERROR (
691
+ cuMemcpyHtoDAsync ((CUdeviceptr)DstWithOffset,
692
+ static_cast <const void *>(SrcWithOffset),
693
+ CopyExtentBytes, Stream));
691
694
} else {
692
695
// This should be unreachable.
693
696
return UR_RESULT_ERROR_INVALID_VALUE;
@@ -763,15 +766,16 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp(
763
766
(CUdeviceptr)pSrc) != CUDA_SUCCESS;
764
767
765
768
size_t CopyExtentBytes = PixelSizeBytes * copyExtent.width ;
766
- void *DstWithOffset =
767
- ( void *)(( char *) pDst + (PixelSizeBytes * dstOffset.x ));
769
+ void *DstWithOffset = static_cast < void *>(
770
+ static_cast < char *>( pDst) + (PixelSizeBytes * dstOffset.x ));
768
771
769
772
if (isCudaArray) {
770
773
UR_CHECK_ERROR (cuMemcpyAtoHAsync (DstWithOffset, (CUarray)pSrc,
771
774
PixelSizeBytes * srcOffset.x ,
772
775
CopyExtentBytes, Stream));
773
776
} else if (memType == CU_MEMORYTYPE_DEVICE) {
774
- char *SrcWithOffset = (char *)pSrc + (srcOffset.x * PixelSizeBytes);
777
+ const char *SrcWithOffset =
778
+ static_cast <const char *>(pSrc) + (srcOffset.x * PixelSizeBytes);
775
779
UR_CHECK_ERROR (cuMemcpyDtoHAsync (DstWithOffset,
776
780
(CUdeviceptr)SrcWithOffset,
777
781
CopyExtentBytes, Stream));
0 commit comments