Skip to content

Commit 8dec2fb

Browse files
committed
Test
1 parent 72a8a90 commit 8dec2fb

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

  • unified-runtime/source/adapters/cuda

unified-runtime/source/adapters/cuda/image.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,23 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp(
505505
hDevice) != hContext->getDevices().end(),
506506
UR_RESULT_ERROR_INVALID_CONTEXT);
507507

508+
const int unsupportedImageChannelTypes[] = {
509+
UR_IMAGE_CHANNEL_TYPE_SNORM_INT8,
510+
UR_IMAGE_CHANNEL_TYPE_SNORM_INT16,
511+
UR_IMAGE_CHANNEL_TYPE_UNORM_INT8,
512+
UR_IMAGE_CHANNEL_TYPE_UNORM_INT16,
513+
UR_IMAGE_CHANNEL_TYPE_UNORM_SHORT_565,
514+
UR_IMAGE_CHANNEL_TYPE_UNORM_SHORT_555};
515+
if (std::find(std::begin(unsupportedImageChannelTypes),
516+
std::end(unsupportedImageChannelTypes),
517+
pImageFormat->channelType) !=
518+
std::end(unsupportedImageChannelTypes)) {
519+
UR_LOG(
520+
ERR,
521+
"CUDA does not support normalized channel types for unsampled images");
522+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
523+
}
524+
508525
unsigned int NumChannels = 0;
509526
UR_CALL(urCalculateNumChannels(pImageFormat->channelOrder, &NumChannels));
510527

0 commit comments

Comments
 (0)