Skip to content

Commit f7224f1

Browse files
authored
[SYCL][CUDA] Add default to image format switch (#3562)
Enables imageElementByteSize to compile when there are values of the CUDA_ARRAY_DESCRIPTOR enum not explicitly covered by the switch statement, such as when compiling with CUDA 11 (which adds CU_AD_FORMAT_NV12). Signed-off-by: John Pennycook <[email protected]>
1 parent 830bca1 commit f7224f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3850,9 +3850,10 @@ static size_t imageElementByteSize(CUDA_ARRAY_DESCRIPTOR array_desc) {
38503850
case CU_AD_FORMAT_SIGNED_INT32:
38513851
case CU_AD_FORMAT_FLOAT:
38523852
return 4;
3853+
default:
3854+
cl::sycl::detail::pi::die("Invalid image format.");
3855+
return 0;
38533856
}
3854-
cl::sycl::detail::pi::die("Invalid iamge format.");
3855-
return 0;
38563857
}
38573858

38583859
/// General ND memory copy operation for images (where N > 1).

0 commit comments

Comments
 (0)