Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][CUDA] Fix 3D buffer D2D copy slice pitch #2046

Conversation

przemektmalon
Copy link
Contributor

This commit fixes the slice pitch parameters
for the 2D/3D buffer device to device
copy operation. This fixes a LIT test
(buffer_full_copy) that reported passing on
CUDA despite throwing a CUDA error. This LIT test
is also fixed so that it can no longer silently fail
upon thrown exceptions.

The CUDA error occured due to the srcHeight
member of the CUDA_MEMCPY3D struct not reflecting
the true extent of the source volume, but the copied
region instead.

Signed-off-by: Przemek Malon [email protected]

@przemektmalon przemektmalon requested a review from a team as a code owner July 6, 2020 17:35
@przemektmalon przemektmalon requested a review from rbegam July 6, 2020 17:35
SrcSlicePitch = (3 == DimSrc) ? SrcSize[0] * SrcSize[1] : 0;
DstSlicePitch = (3 == DimDst) ? DstSize[0] * DstSize[1] : 0;
} else {
SrcSlicePitch = (DimSrc > 1) ? SrcSize[0] * SrcSize[1] : SrcSize[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is CUDA specific, can't we move it inside CUDA plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that it is not possible to determine the full size of the source and destination volumes from what is currently passed to PI API (CUDA requires this, but OpenCL seemingly does not).

I've updated this now so that the calculation is the same for all plugins - this doesn't break the OpenCL backend, and fixes the CUDA backend.

@bader bader added the cuda CUDA back-end label Jul 8, 2020
@przemektmalon przemektmalon force-pushed the przemek/cuda-fix-3d-d2d-buffer-copy-slice-pitch branch 2 times, most recently from df8083c to b92cc67 Compare July 14, 2020 11:14
@bader bader requested a review from romanovvlad July 14, 2020 16:46
This commit fixes the slice pitch parameters
for the 2D/3D buffer device to device
copy operation. This fixes a LIT test
(`buffer_full_copy`) that reported passing on
CUDA despite throwing a CUDA error. This LIT test
is amended to check the validity of 3D buffer
copy operations.

The CUDA error occured due to the `srcHeight`
member of the CUDA_MEMCPY3D struct not reflecting
the true extent of the source volume, but the copied
region instead.

Signed-off-by: Przemek Malon <[email protected]>
@przemektmalon przemektmalon force-pushed the przemek/cuda-fix-3d-d2d-buffer-copy-slice-pitch branch from b92cc67 to f6575a1 Compare July 14, 2020 17:13
@bader bader merged commit d917446 into intel:sycl Jul 15, 2020
@przemektmalon przemektmalon deleted the przemek/cuda-fix-3d-d2d-buffer-copy-slice-pitch branch July 22, 2020 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda CUDA back-end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants