Skip to main content

Module gpu_cpu_verify

Module gpu_cpu_verify 

Source
Expand description

GPU vs CPU output comparison and verification utilities.

Provides tools for verifying that GPU-accelerated operations produce results within an acceptable tolerance of their CPU reference implementations.

§Tolerance Metrics

MetricDescription
ToleranceMetric::MaxAbsDiffMaximum absolute difference across all elements.
ToleranceMetric::MeanAbsDiffMean absolute difference.
ToleranceMetric::PsnrPeak Signal-to-Noise Ratio (dB).
ToleranceMetric::RmsErrorRoot Mean Square error.

§Example

use oximedia_gpu::gpu_cpu_verify::{ComparisonResult, VerificationSuite, ToleranceMetric};

let gpu_output = vec![128u8, 129, 127, 255];
let cpu_output = vec![128u8, 128, 128, 255];
let result = ComparisonResult::compare_u8(&gpu_output, &cpu_output);
assert!(result.max_abs_diff <= 1);

Structs§

ComparisonResult
Detailed result of comparing two buffers element-by-element.
VerificationCase
A single test case result within a verification suite.
VerificationSuite
A suite of GPU vs CPU verification tests.

Enums§

ToleranceMetric
Which metric to use for pass/fail decisions.

Functions§

buffers_within_tolerance
Quick check: are two u8 buffers within max_diff of each other at every element?
compute_buffer_psnr
Quick check: compute PSNR between two u8 buffers.
compute_buffer_rms
Quick check: compute RMS error between two u8 buffers.