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

Get code to compile with CUDA 12.4 #3742

Merged
merged 1 commit into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions modules/cudaimgproc/src/histogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,13 @@ cv::Ptr<cv::cuda::CLAHE> cv::cuda::createCLAHE(double clipLimit, cv::Size tileGr

namespace
{
#if (CUDA_VERSION >= 12040)
typedef NppStatus (*get_buf_size_c1_t)(NppiSize oSizeROI, int nLevels, size_t* hpBufferSize);
typedef NppStatus (*get_buf_size_c4_t)(NppiSize oSizeROI, int nLevels[], size_t* hpBufferSize);
#else
typedef NppStatus (*get_buf_size_c1_t)(NppiSize oSizeROI, int nLevels, int* hpBufferSize);
typedef NppStatus (*get_buf_size_c4_t)(NppiSize oSizeROI, int nLevels[], int* hpBufferSize);
#endif

template<int SDEPTH> struct NppHistogramEvenFuncC1
{
Expand Down Expand Up @@ -315,7 +320,11 @@ namespace
sz.width = src.cols;
sz.height = src.rows;

#if (CUDA_VERSION >= 12040)
size_t buf_size;
#else
int buf_size;
#endif
get_buf_size(sz, levels, &buf_size);

BufferPool pool(stream);
Expand Down Expand Up @@ -349,7 +358,11 @@ namespace

Npp32s* pHist[] = {hist[0].ptr<Npp32s>(), hist[1].ptr<Npp32s>(), hist[2].ptr<Npp32s>(), hist[3].ptr<Npp32s>()};

#if (CUDA_VERSION >= 12040)
size_t buf_size;
#else
int buf_size;
#endif
get_buf_size(sz, levels, &buf_size);

BufferPool pool(stream);
Expand Down Expand Up @@ -419,7 +432,11 @@ namespace
sz.width = src.cols;
sz.height = src.rows;

#if (CUDA_VERSION >= 12040)
size_t buf_size;
#else
int buf_size;
#endif
get_buf_size(sz, levels.cols, &buf_size);

BufferPool pool(stream);
Expand Down Expand Up @@ -460,7 +477,11 @@ namespace
sz.width = src.cols;
sz.height = src.rows;

#if (CUDA_VERSION >= 12040)
size_t buf_size;
#else
int buf_size;
#endif
get_buf_size(sz, nLevels, &buf_size);

BufferPool pool(stream);
Expand Down
Loading