Exact image and audio filters on GPUs
An 8-bit image filtered with an integer kernel, or 16-bit audio filtered with integer taps, has one exact answer. GPU libraries compute it in floating point or in 8-bit fixed point, and many of their outputs differ from it. This paper measures exact integer kernels for the common filters against every major GPU library at its fastest setting, and records how often each library's output is wrong.
Abstract
Image and audio filters with integer inputs and integer weights (a box blur, a Gaussian with integer taps, a general int8 kernel, an audio FIR with 16-bit taps) have an exact integer answer, but GPU libraries compute them in float32, float16 or 8-bit fixed point. This paper measures exact integer kernels for these four filters on three NVIDIA GPUs (A10G and L4 on AWS for every case, B200 for a reduced set) against OpenCV CUDA, NPP, CV-CUDA, CuPy, cuDNN through PyTorch (every precision, cudnn.benchmark, torch.compile), Kornia and cuFFT, each at its fastest setting, and compares every output of every library with the exact answer on every pixel and sample.
- Box filter: constant time in the kernel size. The exact kernel takes 0.17–0.44 ms on an 8K frame on the A10G from 3 × 3 to 31 × 31 (0.26–0.54 ms on the L4); NPP and OpenCV CUDA take 21–40 ms at 31 × 31. From 7 × 7 up it is 3.8–7.5× faster than the fastest stock path at 4K and 8K. At 3 × 3 and 5 × 5 NPP's 8-bit box is about as fast or faster (the exact kernel runs at 0.52–1.02×) and wrong on 44–50% of pixels.
- Separable Gaussian. From 11 × 11 the exact kernel is 2.8–3.3× faster than OpenCV CUDA's separable filter, the fastest stock path, at 4K and 8K, and 9.4–27× faster than float64, the stock path that is always exact. At 3 × 3 to 7 × 7 NPP's 8-bit Gaussian is faster (the exact kernel runs at 0.45–0.83×) and wrong on 50–62% of pixels.
- General int8 filter on int8 tensor cores. From 7 × 7 at 1080p and above, 2.6–13× faster than the fastest stock path (usually cuDNN, NPP or OpenCV CUDA in float32, which are exact for these kernels, or cuFFT float32; at L4 4K, 7 × 7 the fastest is cuDNN float16, which is wrong on 88% of pixels).
- Audio FIR on int8 tensor cores. 60 s of 16-bit audio at 48 kHz in 0.031–0.73 ms for 16–4,096 taps; 2.5–38× faster than float64, the only exact stock path, on the A10G and L4 (1.17–9.97× on the B200). Every float32, TF32, float16 and bfloat16 path is wrong on at least 98.6% of samples. cuFFT float32 is faster only at 4,096 taps on 24-bit audio (the exact kernel runs at 0.72–0.80×), and wrong on all of those samples.
- NVIDIA B200. On 4K frames the exact box filter is 4.2–5.7× faster than the fastest stock path from 7 × 7, the Gaussian 1.7–1.9× faster from 15 × 15 and 2.9–3.6× faster than float64 at every size, the int8 filter 3.1–7.0× faster from 7 × 7; the FIR is faster than every stock path in all 12 cases measured (1.1–7.4×), including 4,096 taps on 24-bit audio. The same small-kernel losses as on the other GPUs remain (0.40–0.82× at 3 × 3 to 7 × 7).
- The same answer on every GPU. Every exact output was identical on the A10G, L4 and B200. Several stock paths gave different outputs on different GPUs for the same input: cuDNN's float16, bfloat16 and separable float paths, Kornia's separable filter, CuPy's FFT and overlap-add convolution, and NPP's Gaussian (details below).
What this lets you do
- Filter 8-bit images and integer audio on a GPU and get the exact integer answer: the same bytes on every GPU tested, so a pipeline validated on one machine needs no tolerance on another.
- Use large box and Gaussian kernels (15 × 15 to 31 × 31) at a fraction of the cost of the library paths, whose time grows with the kernel area.
- Know, for each library and setting, how often its output differs from the exact answer and by how much.
Method
This section describes the methods at the level of the algorithm; the kernels are not published. Every Riptide output below is an integer computed exactly: no floating-point operation touches a pixel or a sample.
Box filter: running sums, one pass, constant work per pixel
The box filter's exact answer is the window sum of bytes and, for an 8-bit image, the mean correctly rounded to an integer. Because is odd for odd , the rounding never ties, so is the correctly rounded mean.
One thread block produces a tile of 128 output columns and output rows ( = 8–64, picked per GPU and per by a short timing pass). It copies the tile plus its halo into shared memory, using 32-bit loads where the tile is inside the image and replicating the edge pixels where it is not. It then forms horizontal running sums of bytes along every staged row (16-bit, since for ), and vertical running sums of those down each column: each step adds one row and subtracts the row that left the window, so the work per pixel does not grow with . Each thread owns four adjacent output columns and writes them as one 32-bit word. The division by is a multiply-high by ; it is exact because the error term times the largest numerator stays below , which the host checks for every .
Separable integer Gaussian: two exact passes in one kernel
A separable integer kernel (here with , so ) gives the 2-D sum , which fits in 32 bits for 8-bit images. One block stages a 64-column tile and its halo, computes the row products into 32-bit shared memory (four outputs per thread, a -byte window sliding through registers), then the column products. The normalized output is the sum divided by and rounded half to even: the quotient comes from a 64-bit multiply-high by (exact for numerators below and ), and the remainder decides the rounding. Every float library in the comparison gets the same taps divided by , so all of them compute the same filter.
General int8 filters on int8 tensor cores
A filter with int8 weights on an 8-bit image is a sum over the kernel rows of 1-D correlations. For one kernel row, sixteen consecutive outputs of an image row are a matrix-vector product with a Toeplitz matrix ( for , otherwise 64). Taking eight such groups of sixteen outputs as eight columns turns it into the integer matrix product the tensor cores execute in one instruction (mma with uint8 image values, int8 weights and int32 accumulation, which is exact for ; here at most ). Each warp computes one output row; eight warps of a block share the staged input rows. The Toeplitz operand wastes of each instruction, so the method pays off from about ; a dp4a kernel (four byte products per instruction, from the earlier exact-filter work) is also measured.
Audio FIR on int8 tensor cores with byte limbs
A valid correlation of 16-bit samples with 16-bit taps is the same Toeplitz product with rounded up to a multiple of 32. Tensor cores multiply bytes, so each value is split exactly into limbs: with signed and unsigned, and likewise (three limbs for 24-bit samples). Each limb pair is one stream of matrix products with the matching signed/unsigned operand types, accumulated in int32 (each limb product is below in magnitude, so taps stay exact), and the streams are combined in 64-bit integers at the end: . A block stages its signal window and the taps as byte arrays in shared memory; a CUDA-core kernel with int64 accumulation is also measured.
How the comparison is made
Every implementation runs on one CUDA stream (OpenCV CUDA through a wrapped stream, NPP through its stream context, CV-CUDA through as_stream, CuPy through an external stream) and is timed with CUDA events over batches of calls, keeping the best per-call time of up to five batches. Inputs and outputs are already on the GPU unless a row says end-to-end. Each library is called in the form its documentation recommends for speed: preallocated outputs, _into variants, cudnn.benchmark, and torch.compile(mode="max-autotune") for the PyTorch 2-D paths at K = 7 and 31 on 8K frames (K = 31 on the B200 at 4K); the FIR and batch PyTorch paths ran without torch.compile. Every output, float or integer, is compared with the exact answer on every pixel or sample: floats are rounded to the nearest integer the way a user would store them, and their raw error against the exact rational value is recorded too. Riptide's exact output is itself checked against an independent int64 CPU reference at 4,096 random positions per 2-D case and 2,048 samples per FIR case (the batch cases have no CPU spot check), and its kernels pass 422 exactness tests against full CPU references (odd sizes, batches, edge values).
Setup
Machines
| machine | GPU | host | used for |
|---|---|---|---|
| AWS g5.xlarge (on-demand, us-east-1) | NVIDIA A10G (Ampere, sm_86, 24 GB), driver 620.70.06 | 4 vCPU, 16 GB | every case |
| AWS g6.xlarge (on-demand, us-east-1) | NVIDIA L4 (Ada, sm_89, 24 GB), driver 620.70.06 | 4 vCPU, 16 GB | every case |
| RunPod secure cloud, one GPU | NVIDIA B200 (Blackwell, sm_100, 180 GB), driver 595.112.07 | Xeon 6960P (shared host) | reduced set: 4K frames at K = 3, 7, 15, 31; 64 × 1080p at K = 7, 31; FIR at 16, 256, 4,096 taps; end to end at 4K |
No H100 could be rented on AWS during the measurement window (no capacity in any zone of the one region with P-instance quota on this account). The B200 ran the same pip-only bundle as the AWS GPUs in one 400-second session (422 of 422 kernel tests passed); RunPod's B200 shares its host with other tenants.
Cases
- Box: uint8 images at 512², 1080p, 4K and 8K; K × K box, K = 3, 5, 7, 11, 15, 21, 31; replicate border. Exact answer: the window sum and the correctly rounded mean.
- Gaussian: the same images; integer taps , ; every float library receives , so all compute the same filter. Exact answer: the sum divided by , rounded half to even. OpenCV's
createGaussianFilterand CV-CUDA'sgaussianbuild their own kernels from σ; they are timed and scored, but not counted as the fastest stock path, since they compute a different filter. - int8 K × K: random signed int8 kernels, zero border, int32 sums, scored on the interior (NPP offers only a replicate border).
- Batches: 64 frames at 1080p, box and Gaussian, K = 3, 7, 15, 31 (OpenCV CUDA and NPP called once per frame).
- FIR: 60 s of 48 kHz audio (two tones and noise) as 16-bit and 24-bit samples; low-pass (windowed-sinc) and random int16 taps, 16–4,096 taps; valid correlation, int64 output.
- End to end: an 8K frame from pinned host memory to the GPU, filtered, and back.
Every GPU filters the same inputs (seeded per case).
Results
Box filter
| GPU | K | exact ms | fastest stock ms (wrong) | fastest exact stock ms | OpenCV CUDA ms | × vs fastest | × vs fastest exact |
|---|---|---|---|---|---|---|---|
| A10G | 3 | 0.17 | 0.16 NPP 8u (44.4%) | 0.56 NPP f32 | 0.37 | 0.94× | 3.35× |
| A10G | 7 | 0.19 | 0.81 CuPy uniform u8 (85.5%) | 1.10 CuPy uniform f32 | 2.13 | 4.34× | 5.84× |
| A10G | 15 | 0.27 | 1.26 CuPy uniform u8 (93.0%) | 1.38 CuPy uniform f32 | 6.01 | 4.62× | 5.07× |
| A10G | 31 | 0.44 | 2.52 CuPy uniform u8 (97.7%) | 2.71 CuPy uniform f32 | 20.79 | 5.76× | 6.21× |
| L4 | 3 | 0.26 | 0.27 NPP 8u (44.4%) | 1.04 NPP f32 | 0.55 | 1.02× | 3.94× |
| L4 | 7 | 0.27 | 1.16 CuPy uniform u8 (85.5%) | 1.65 CV-CUDA u8 | 2.66 | 4.25× | 6.04× |
| L4 | 15 | 0.37 | 1.81 CuPy uniform u8 (93.0%) | 2.18 CuPy uniform f32 | 8.89 | 4.92× | 5.93× |
| L4 | 31 | 0.54 | 3.48 CuPy uniform u8 (97.7%) | 3.86 CuPy uniform f32 | 33.38 | 6.46× | 7.18× |

The exact kernel's time hardly depends on K, because running sums make the work per pixel constant. NPP's box filter (which OpenCV CUDA calls), CV-CUDA and PyTorch's average pooling all grow with the kernel area. CuPy's uniform_filter also uses running sums and is the closest stock path; its uint8 output, the faster one, is wrong on 67–98% of pixels at 8K (by one or two levels), and its float32 output is exact but slower.
Separable Gaussian
| GPU | K | exact ms | fastest stock ms (wrong) | fastest exact stock ms | OpenCV CUDA ms | × vs fastest | × vs fastest exact |
|---|---|---|---|---|---|---|---|
| A10G | 3 | 0.21 | 0.16 NPP Gauss 8u (50.0%) | 2.17 CuPy sep f64 | 0.70 | 0.76× | 10.49× |
| A10G | 7 | 0.25 | 0.19 NPP Gauss 8u (50.0%) | 4.03 CuPy sep f64 | 0.74 | 0.75× | 16.19× |
| A10G | 15 | 0.36 | 1.09 OpenCV CUDA sep 8u (0.001%) | 8.60 CuPy sep f64 | 1.09 | 3.00× | 23.62× |
| A10G | 31 | 0.65 | 2.07 OpenCV CUDA sep 8u (0.001%) | 17.75 CuPy sep f64 | 2.07 | 3.20× | 27.40× |
| L4 | 3 | 0.33 | 0.27 NPP Gauss 8u (50.0%) | 4.54 CuPy sep f64 | 1.38 | 0.83× | 13.87× |
| L4 | 7 | 0.36 | 0.29 NPP Gauss 8u (50.0%) | 4.80 CuPy sep f64 | 1.40 | 0.78× | 13.20× |
| L4 | 15 | 0.49 | 1.50 OpenCV CUDA sep 8u (0.001%) | 10.24 CuPy sep f64 | 1.50 | 3.04× | 20.78× |
| L4 | 31 | 0.84 | 2.49 OpenCV CUDA sep 8u (0.001%) | 21.17 CuPy sep f64 | 2.49 | 2.98× | 25.28× |

At 3 × 3 to 7 × 7 NPP's 8-bit Gaussian (FilterGaussAdvanced, or its 8-bit row/column filter at L4 4K, 7 × 7) is the fastest stock path and the exact kernel is slower (0.45–0.83× at 4K and 8K). NPP's 8-bit output is off by one level on about half the pixels; at 5 × 5 it is wrong on 62% of pixels, with a 99th-percentile error of 64 levels and a maximum of 107–115 levels, at every image size on the A10G and the L4 (5 × 5 was not in the B200 set). NPP's float32 path with the same taps is wrong on at most 0.002% of pixels; the cause of the 8-bit errors is under investigation (see Limitations). From 11 × 11 OpenCV CUDA's separable filter is the fastest stock path, wrong on at most 0.001% of pixels, and the exact kernel is about 3× faster.
General int8 filters
| GPU | K | exact ms | fastest stock ms (wrong) | fastest exact stock ms | OpenCV CUDA ms | × vs fastest | × vs fastest exact |
|---|---|---|---|---|---|---|---|
| A10G | 3 | 0.36 | 0.57 NPP f32 (0.0%) | 0.57 NPP f32 | 0.63 | 1.59× | 1.59× |
| A10G | 7 | 0.39 | 1.67 NPP f32 (0.0%) | 1.67 NPP f32 | 1.83 | 4.29× | 4.29× |
| A10G | 15 | 0.53 | 7.07 NPP f32 (0.0%) | 7.07 NPP f32 | 7.24 | 13.31× | 13.31× |
| A10G | 31 | 1.71 | 12.02 cuFFT f32 (0.000%) | 29.44 OpenCV CUDA f32 | 29.44 | 7.02× | 17.21× |
| L4 | 3 | 0.71 | 0.66 cuDNN bf16 (96.7%) | 1.03 CuPy correlate f32 | 1.06 | 0.92× | 1.44× |
| L4 | 7 | 0.71 | 1.84 cuDNN f32 (0.0%) | 1.84 cuDNN f32 | 2.55 | 2.60× | 2.60× |
| L4 | 15 | 0.82 | 8.98 NPP f32 (0.0%) | 8.98 NPP f32 | 11.35 | 10.94× | 10.94× |
| L4 | 31 | 2.32 | 23.96 cuFFT f32 (0.000%) | 37.81 NPP f32 | 48.20 | 10.34× | 16.32× |
The exact column is the faster of the tensor-core and dp4a kernels for each case.

For random signed int8 kernels the float32 paths are exact here (the sums stay inside float32's 24-bit significand); float16 and bfloat16 are wrong on almost every pixel. The tensor-core kernel runs at 0.21–0.77× at 512² for K ≤ 7, at 0.68–0.92× on the L4 at 3 × 3 (1080p and 8K) and at 0.82× on the B200 at 3 × 3 (4K): its 32-tap matrix tile wastes of each instruction for small kernels.
NVIDIA B200, 4K frames
| filter | K | exact ms | fastest stock ms (wrong) | fastest exact stock ms | OpenCV CUDA ms | × vs fastest | × vs fastest exact |
|---|---|---|---|---|---|---|---|
| box | 3 | 0.023 | 0.010 NPP 8u (44.4%) | 0.047 NPP f32 | 0.028 | 0.44× | 2.07× |
| box | 7 | 0.024 | 0.102 CuPy uniform f32 (0.0%) | 0.102 CuPy uniform f32 | 0.172 | 4.21× | 4.21× |
| box | 15 | 0.033 | 0.150 CuPy uniform f32 (0.0%) | 0.150 CuPy uniform f32 | 0.500 | 4.55× | 4.55× |
| box | 31 | 0.045 | 0.257 CuPy uniform f32 (0.0%) | 0.257 CuPy uniform f32 | 1.785 | 5.68× | 5.68× |
| Gaussian | 3 | 0.028 | 0.011 NPP Gauss 8u (50.0%) | 0.080 CuPy sep f64 | 0.030 | 0.40× | 2.92× |
| Gaussian | 7 | 0.033 | 0.023 NPP Gauss 8u (50.0%) | 0.103 CuPy sep f64 | 0.045 | 0.70× | 3.16× |
| Gaussian | 15 | 0.044 | 0.075 OpenCV CUDA sep 8u (0.001%) | 0.152 CuPy sep f64 | 0.075 | 1.70× | 3.44× |
| Gaussian | 31 | 0.073 | 0.138 OpenCV CUDA sep 8u (0.001%) | 0.261 CuPy sep f64 | 0.138 | 1.91× | 3.59× |
| int8 | 3 | 0.022 | 0.018 NPP f32 (0.0%) | 0.018 NPP f32 | 0.071 | 0.82× | 0.82× |
| int8 | 7 | 0.033 | 0.151 NPP f32 (0.0%) | 0.151 NPP f32 | 0.222 | 4.62× | 4.62× |
| int8 | 15 | 0.055 | 0.383 cuFFT f32 (0.0%) | 0.383 cuFFT f32 | 0.758 | 6.95× | 6.95× |
| int8 | 31 | 0.137 | 0.431 cuFFT f32 (0.0001%) | 0.554 cuFFT f64 | 2.705 | 3.14× | 4.04× |
The B200 shows the same pattern as the other GPUs with smaller margins on the Gaussian: from 15 × 15 OpenCV CUDA's separable filter is about half the exact kernel's speed, against a third on the A10G and L4. The box filter's fastest stock path at 7 × 7 and up is CuPy's float32 uniform_filter, which is exact here and still 4.2–5.7× slower. Every library's timings and error statistics for these cases are in the results files.
Batches
On 64 frames at 1080p the exact kernels run in one launch: box 0.68–1.69 ms and Gaussian 0.84–2.63 ms on the A10G for K = 3–31, 1.02–8.6× faster than the fastest stock path on the A10G and L4; OpenCV CUDA and NPP take one call per frame. On the B200 the same batches take 0.28–0.60 ms (box) and 0.47–1.06 ms (Gaussian) at K = 7 and 31, 2.0–7.5× faster than the fastest stock path.
Audio FIR
| GPU | bits | taps | exact ms | fastest stock ms (wrong) | fastest exact stock ms | × vs fastest | × vs fastest exact |
|---|---|---|---|---|---|---|---|
| A10G | 16 | 16 | 0.065 | 0.086 cuDNN f16 (100.0%) | 0.242 cuDNN f64 | 1.32× | 3.72× |
| A10G | 16 | 64 | 0.067 | 0.218 cuDNN f16 (100.0%) | 0.765 cuDNN f64 | 3.27× | 11.49× |
| A10G | 16 | 256 | 0.080 | 0.637 cuFFT OA f32 (99.9%) | 2.029 cuFFT OA f64 | 7.93× | 25.25× |
| A10G | 16 | 1,024 | 0.194 | 0.657 cuFFT OA f32 (100.0%) | 2.783 cuFFT OA f64 | 3.38× | 14.31× |
| A10G | 16 | 4,096 | 0.729 | 0.876 cuFFT OA f32 (99.9%) | 2.762 cuFFT OA f64 | 1.20× | 3.79× |
| A10G | 24 | 16 | 0.080 | 0.086 cuDNN f16 (100.0%) | 0.242 cuDNN f64 | 1.07× | 3.01× |
| A10G | 24 | 64 | 0.087 | 0.217 cuDNN f16 (100.0%) | 0.765 cuDNN f64 | 2.49× | 8.75× |
| A10G | 24 | 256 | 0.104 | 0.638 cuFFT OA f32 (100.0%) | 2.030 cuFFT OA f64 | 6.14× | 19.55× |
| A10G | 24 | 1,024 | 0.297 | 0.656 cuFFT OA f32 (100.0%) | 2.787 cuFFT OA f64 | 2.21× | 9.39× |
| A10G | 24 | 4,096 | 1.098 | 0.876 cuFFT OA f32 (100.0%) | 2.762 cuFFT OA f64 | 0.80× | 2.51× |
| L4 | 16 | 16 | 0.031 | 0.095 cuDNN conv1d TF32 (99.5%) | 0.266 cuDNN f64 | 3.11× | 8.73× |
| L4 | 16 | 64 | 0.035 | 0.268 cuDNN f16 (100.0%) | 0.860 cuDNN f64 | 7.54× | 24.24× |
| L4 | 16 | 256 | 0.057 | 0.511 cuFFT OA f32 (99.9%) | 2.147 cuFFT OA f64 | 9.03× | 37.89× |
| L4 | 16 | 1,024 | 0.146 | 0.490 cuFFT OA f32 (100.0%) | 3.006 cuFFT OA f64 | 3.35× | 20.55× |
| L4 | 16 | 4,096 | 0.505 | 0.540 cuFFT OA f32 (99.9%) | 2.898 cuFFT OA f64 | 1.07× | 5.74× |
| L4 | 24 | 16 | 0.039 | 0.088 cuDNN conv1d TF32 (100.0%) | 0.268 cuDNN f64 | 2.28× | 6.91× |
| L4 | 24 | 64 | 0.047 | 0.250 cuDNN conv1d TF32 (100.0%) | 0.866 cuDNN f64 | 5.36× | 18.54× |
| L4 | 24 | 256 | 0.076 | 0.511 cuFFT OA f32 (100.0%) | 2.146 cuFFT OA f64 | 6.76× | 28.39× |
| L4 | 24 | 1,024 | 0.207 | 0.512 cuFFT OA f32 (100.0%) | 3.006 cuFFT OA f64 | 2.48× | 14.55× |
| L4 | 24 | 4,096 | 0.736 | 0.569 cuFFT OA f32 (100.0%) | 2.927 cuFFT OA f64 | 0.77× | 3.97× |
| B200 | 16 | 16 | 0.012 | 0.041 cuDNN f32 (99.5%) | 0.046 cuDNN f64 | 3.31× | 3.72× |
| B200 | 16 | 256 | 0.021 | 0.153 cuFFT fftconvolve f32 (99.9%) | 0.207 cuFFT fftconvolve f64 | 7.37× | 9.93× |
| B200 | 16 | 4,096 | 0.133 | 0.210 cuFFT fftconvolve f32 (99.9%) | 0.228 cuFFT OA f64 | 1.58× | 1.72× |
| B200 | 24 | 16 | 0.017 | 0.041 cuDNN f32 (100.0%) | 0.046 cuDNN f64 | 2.43× | 2.74× |
| B200 | 24 | 256 | 0.030 | 0.153 cuFFT fftconvolve f32 (100.0%) | 0.207 cuFFT fftconvolve f64 | 5.13× | 6.96× |
| B200 | 24 | 4,096 | 0.188 | 0.209 cuFFT fftconvolve f32 (100.0%) | 0.220 cuFFT OA f64 | 1.11× | 1.17× |

Float64 (cuDNN or cuFFT overlap-add) is the only exact stock path for these sizes. cuFFT float32 overlap-add is the fastest stock path from 256 taps and is wrong on 99.6–100% of samples, by up to 6.2 million LSB (6.6 million on the B200). On the B200 the exact FIR is faster than every stock path in all 12 cases (low-pass and random taps; the random-tap rows are in the results files), including 24-bit audio at 4,096 taps, where cuFFT float32 is faster on the A10G and L4.
End to end
With an 8K frame copied from pinned host memory and back (4.99 ms for the copies alone on the A10G and L4), the exact box and Gaussian add 0.17–0.82 ms. NPP's 8-bit box matches that at 3 × 3 and is 2.3–7.8× slower at 15 × 15 to 31 × 31. cuDNN, with the int8 kernel as float, takes 15–99 ms against 12.9–14.8 ms for the exact int8 filter with its int32 output. On the B200 with a 4K frame the copies take 0.31 ms; the exact box and Gaussian add 0.02–0.08 ms, NPP's 8-bit box is 0.01 ms faster at 3 × 3 and 2.3–5.6× slower (whole round trip) at 15 × 15 and 31 × 31, and the exact int8 filter takes 0.78–0.89 ms against 1.08–4.57 ms for cuDNN float32.
How often each library is wrong

| implementation | part | wrong outputs | max error | median error of wrong outputs |
|---|---|---|---|---|
| CuPy uniform_filter uint8 | box | 66.7%–97.7% | 2 | 1 |
| OpenCV CUDA box 8u | box | 44.4%–50.0% | 1 | 1 |
| NPP box 8u | box | 44.4%–50.0% | 1 | 1 |
| PyTorch avg-pool f16 | box | 4.4%–5.9% | 1 | 1 |
| PyTorch avg-pool f16, compiled | box | 4.4%–5.1% | 1 | 1 |
| CV-CUDA averageBlur u8 | box | 0.0%–0.000% | 1 | 1 |
| OpenCV CUDA box f32 | box | 0.0%–0.0% | 0 | – |
| NPP box f32 | box | 0.0%–0.0% | 0 | – |
| CuPy uniform_filter f32 | box | 0.0%–0.0% | 0 | – |
| PyTorch avg-pool f32 | box | 0.0%–0.0% | 0 | – |
| Kornia box_blur f32 | box | 0.0%–0.0% | 0 | – |
| PyTorch avg-pool f32, compiled | box | 0.0%–0.0% | 0 | – |
| cuDNN conv1d f16 | fir | 100.0%–100.0% | ∞ (overflow) | 1,897,053 |
| cuDNN conv1d bf16 | fir | 100.0%–100.0% | 42,751,895,431 | 5,829,674,865 |
| cuFFT overlap-add f32 | fir | 99.6%–100.0% | 6,162,749 | 859,954 |
| cuDNN conv1d f32 | fir | 98.6%–100.0% | 28,555,520 | 1,686,205 |
| cuDNN conv1d TF32 | fir | 98.6%–100.0% | 28,555,520 | 1,686,205 |
| cuFFT fftconvolve f32 | fir | 99.8%–100.0% | 4,407,688 | 561,266 |
| cuDNN conv1d f64 | fir | 0.0%–0.0% | 0 | – |
| cuFFT fftconvolve f64 | fir | 0.0%–0.0% | 0 | – |
| cuFFT overlap-add f64 | fir | 0.0%–0.0% | 0 | – |
| NPP row/column 8u | gauss | 89.7%–97.3% | 2 | 1 |
| NPP GaussAdvanced 8u | gauss | 50.0%–62.2% | 115 | 1 |
| CV-CUDA gaussian u8 (own kernel) | gauss | 1.9%–19.4% | 1 | 1 |
| OpenCV CUDA Gaussian 8u (own kernel) | gauss | 1.9%–19.4% | 1 | 1 |
| cuDNN separable f16 | gauss | 4.6%–6.5% | 1 | 1 |
| cuDNN separable f16, compiled | gauss | 4.6%–4.7% | 1 | 1 |
| OpenCV CUDA separable 8u | gauss | 0.000%–0.001% | 1 | 1 |
| OpenCV CUDA separable f32 | gauss | 0.000%–0.001% | 1 | 1 |
| CuPy correlate1d f32 | gauss | 0.000%–0.001% | 1 | 1 |
| NPP GaussAdvanced f32 | gauss | 0.000%–0.001% | 1 | 1 |
| cuDNN separable f32 | gauss | 0.000%–0.001% | 1 | 1 |
| cuDNN separable TF32 | gauss | 0.000%–0.001% | 1 | 1 |
| Kornia separable f32 | gauss | 0.000%–0.001% | 1 | 1 |
| cuDNN separable f32, compiled | gauss | 0.001%–0.001% | 1 | 1 |
| CuPy correlate1d f64 | gauss | 0.0%–0.0% | 0 | – |
On the B200 the same paths make the same errors (the per-GPU error tables are in the results files). Two notes: cuCIM's Gaussian (float32, its own kernel from σ, B200 only) is wrong on 1.9–19.4% of pixels by one level, like OpenCV CUDA's and CV-CUDA's own kernels; cuFFT float32 overlap-add (listed in the error table) is wrong on 99.6–100% of samples there too, with a larger maximum of 6,598,843 LSB.
Every Riptide output was exact on every pixel and sample in all 252 cases (112 on the A10G, 112 on the L4, 28 on the B200), and identical on every GPU that ran the case (216 of 216 comparisons). Stock paths whose outputs differ between GPUs for the same input: cuDNN conv1d bfloat16 (11 of 20 cases) and float16 (6 of 20); cuDNN separable float16 (7 of 32), float32 and TF32 (3 of 28 each), and their compiled forms (1 of 2); Kornia's separable filter (3 of 28); CuPy fftconvolve float32 and float64 (16 of 48 each) and oaconvolve (12 of 20 each); NPP FilterGaussAdvanced 8-bit (2 of 28) and float32 (1 of 28). OpenCV CUDA, CV-CUDA, NPP's box and general filter, and cuDNN's 2-D convolution gave identical outputs on every GPU.
Limitations and next steps
The limits of these results, each with its cause and, where one is planned, the next step.
- Small kernels: NPP's 8-bit box is faster at 3 × 3 and 5 × 5, and its 8-bit Gaussian at 3 × 3 to 7 × 7 (box: NPP's 8-bit box wins only at 3 × 3 and 5 × 5, where the exact kernel runs at 0.52–1.02× at 4K and 8K and 0.2–0.7× at 512² and 1080p; Gaussian: the exact kernel runs at 0.45–0.83× at 3 × 3 to 7 × 7 at 4K and 8K and 0.17–0.86× at 512² and 1080p; one launch dominates at small sizes; 0.40–0.70× on the B200 at 4K). NPP's outputs there are wrong on 44–62% of pixels. Cause: at small K the filter is a few memory passes, and staging a halo tile in shared memory costs more than it saves.
- Small images and 3 × 3 with the tensor-core filter (512², K ≤ 7: 0.21–0.77×; at 3 × 3, 0.68–0.92× on the L4 and 0.82× of NPP float32 on the B200 at 4K). Cause: the tensor-core tile is 32 taps wide, so small kernels waste most of each instruction, and a 512² image is too small to fill the GPU. The dp4a kernel (four byte products per instruction) does not close the gap: the tables report the faster of the two.
- 24-bit audio at 4,096 taps on the A10G and L4: cuFFT float32 is faster (0.72–0.80×) and wrong on every sample; on the B200 the exact FIR is 1.11× faster. Cause: an FFT's cost hardly grows with the number of taps. Next: an exact number-theoretic transform on the GPU.
- GPUs. Every case ran on two inference GPUs (Ampere and Ada); the B200 ran a reduced set (4K frames, two batch sizes, three FIR lengths), and there are no H100 or AMD results. Cause: no H100 capacity in any zone of the one AWS region with P-instance quota on this account during the window; the B200 run was one short shared session with a reduced case set. Next: the full case set on H100 and B200 when AWS capacity opens.
- NPP's 8-bit 5 × 5 Gaussian errors are not explained (62% of pixels wrong, up to 115 levels). Cause: under investigation (NPP is closed source; its float32 path with the same taps is correct on all but 0.002% of pixels). Next: report it to NVIDIA with the inputs and outputs.
Reproduction notes
- Software. The kernels are a Riptide prototype and are not published. Evaluation builds are available through Request an evaluation.
- Records. Every row with all raw times, the error statistics of every output and its SHA-256 prefix, the kernel tests (422 cases, all passing on every GPU), and a machine record and package list per GPU. Evaluation partners can have the raw files on request.
- Cost. About $4.40 of AWS GPU time, including development (A10G $1.63, L4 $0.87, development boxes about $1.9), and a share of one RunPod B200 session ($5.06: 34 minutes at $8.99 per hour) that also ran two other experiments.
References
- NVIDIA, NPP library documentation (image filtering functions), CUDA 13.
- OpenCV, cv::cuda filtering module, version 4.13.
- NVIDIA, CV-CUDA documentation.
- Chetlur et al., cuDNN: efficient primitives for deep learning, arXiv:1410.0759, 2014.
- NVIDIA, PTX ISA (warp-level
mmawith integer operands). - Riptide, Exact integer filters for images, audio and quantized CNNs, December 2026 (the CPU kernels and the dp4a GPU kernel).
Date and version
Version 1, 1 December 2026: A10G, L4 and B200. Measurements from 1 December 2026.
Working with Riptide
Riptide works with a small number of teams. Each engagement starts with 4 weeks inside your systems, learning how your models, data and infrastructure work. Only then does Riptide apply its software to them. Contact samario@riptidecompute.com or riptidecompute.com/evaluate.