Skip to content

Commit

Permalink
Modify to return a StsNotImplemented error when CUDA is outdated and …
Browse files Browse the repository at this point in the history
…the Mat is not supported
  • Loading branch information
TumoiYorozu committed Feb 10, 2024
1 parent 89e592f commit 1334d27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion modules/cudafilters/src/filtering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,9 @@ namespace
|| srcType == CV_16UC1 || srcType == CV_16UC3 || srcType == CV_16UC4
|| srcType == CV_32FC1 || srcType == CV_32FC3 || srcType == CV_32FC4);
#else
CV_Assert(srcType == CV_8UC1);
if (srcType != CV_8UC1) {
CV_Error(Error::StsNotImplemented, "If CUDA version is below 10, only implementations that support CV_8UC1 are available");
}
#endif
CV_Assert(windowSize>=3);
CV_Assert(_partitions>=1);
Expand Down
5 changes: 2 additions & 3 deletions modules/cudafilters/test/test_filters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,6 @@ INSTANTIATE_TEST_CASE_P(CUDA_Filters, Median, testing::Combine(
WHOLE_SUBMAT)
);

#ifdef __OPENCV_USE_WAVELET_MATRIX_FOR_MEDIAN_FILTER_CUDA__
INSTANTIATE_TEST_CASE_P(CUDA_Filters_Median_HDR, Median, testing::Combine(
ALL_DEVICES,
DIFFERENT_SIZES,
Expand All @@ -713,8 +712,8 @@ INSTANTIATE_TEST_CASE_P(CUDA_Filters_Median_HDR, Median, testing::Combine(
MatType(CV_16U), MatType(CV_16UC3), MatType(CV_16UC4),
MatType(CV_32F), MatType(CV_32FC3), MatType(CV_32FC4)),
testing::Values(KernelSize(3), KernelSize(5)),
WHOLE_SUBMAT));
#endif
WHOLE_SUBMAT)
);


}} // namespace
Expand Down

0 comments on commit 1334d27

Please sign in to comment.