@@ -281,8 +281,13 @@ cv::Ptr<cv::cuda::CLAHE> cv::cuda::createCLAHE(double clipLimit, cv::Size tileGr
281281
282282namespace
283283{
284+ #if (CUDA_VERSION >= 12040)
285+ typedef NppStatus (*get_buf_size_c1_t )(NppiSize oSizeROI, int nLevels, size_t * hpBufferSize);
286+ typedef NppStatus (*get_buf_size_c4_t )(NppiSize oSizeROI, int nLevels[], size_t * hpBufferSize);
287+ #else
284288 typedef NppStatus (*get_buf_size_c1_t )(NppiSize oSizeROI, int nLevels, int * hpBufferSize);
285289 typedef NppStatus (*get_buf_size_c4_t )(NppiSize oSizeROI, int nLevels[], int * hpBufferSize);
290+ #endif
286291
287292 template <int SDEPTH> struct NppHistogramEvenFuncC1
288293 {
@@ -315,7 +320,11 @@ namespace
315320 sz.width = src.cols ;
316321 sz.height = src.rows ;
317322
323+ #if (CUDA_VERSION >= 12040)
324+ size_t buf_size;
325+ #else
318326 int buf_size;
327+ #endif
319328 get_buf_size (sz, levels, &buf_size);
320329
321330 BufferPool pool (stream);
@@ -349,7 +358,11 @@ namespace
349358
350359 Npp32s* pHist[] = {hist[0 ].ptr <Npp32s>(), hist[1 ].ptr <Npp32s>(), hist[2 ].ptr <Npp32s>(), hist[3 ].ptr <Npp32s>()};
351360
361+ #if (CUDA_VERSION >= 12040)
362+ size_t buf_size;
363+ #else
352364 int buf_size;
365+ #endif
353366 get_buf_size (sz, levels, &buf_size);
354367
355368 BufferPool pool (stream);
@@ -419,7 +432,11 @@ namespace
419432 sz.width = src.cols ;
420433 sz.height = src.rows ;
421434
435+ #if (CUDA_VERSION >= 12040)
436+ size_t buf_size;
437+ #else
422438 int buf_size;
439+ #endif
423440 get_buf_size (sz, levels.cols , &buf_size);
424441
425442 BufferPool pool (stream);
@@ -460,7 +477,11 @@ namespace
460477 sz.width = src.cols ;
461478 sz.height = src.rows ;
462479
480+ #if (CUDA_VERSION >= 12040)
481+ size_t buf_size;
482+ #else
463483 int buf_size;
484+ #endif
464485 get_buf_size (sz, nLevels, &buf_size);
465486
466487 BufferPool pool (stream);
0 commit comments