@@ -634,7 +634,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp(
634634}
635635
636636UR_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,
638638 const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc,
639639 ur_exp_image_copy_flags_t imageCopyFlags, ur_rect_offset_t srcOffset,
640640 ur_rect_offset_t dstOffset, ur_rect_region_t copyExtent,
@@ -676,18 +676,21 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp(
676676 (CUdeviceptr)pDst) != CUDA_SUCCESS;
677677
678678 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);
680681
681682 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));
685687 } 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));
691694 } else {
692695 // This should be unreachable.
693696 return UR_RESULT_ERROR_INVALID_VALUE;
@@ -763,15 +766,16 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp(
763766 (CUdeviceptr)pSrc) != CUDA_SUCCESS;
764767
765768 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 ));
768771
769772 if (isCudaArray) {
770773 UR_CHECK_ERROR (cuMemcpyAtoHAsync (DstWithOffset, (CUarray)pSrc,
771774 PixelSizeBytes * srcOffset.x ,
772775 CopyExtentBytes, Stream));
773776 } 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);
775779 UR_CHECK_ERROR (cuMemcpyDtoHAsync (DstWithOffset,
776780 (CUdeviceptr)SrcWithOffset,
777781 CopyExtentBytes, Stream));
0 commit comments