diff test/test_benchmark.h @ 39:f9ca85d2f14c

*: rearrange some things; add avx512bw support
author Paper <paper@tflc.us>
date Sat, 26 Apr 2025 15:31:39 -0400
parents 4b5a557aa64f
children c6e0df09b86f
line wrap: on
line diff
--- a/test/test_benchmark.h	Sat Apr 26 02:54:44 2025 -0400
+++ b/test/test_benchmark.h	Sat Apr 26 15:31:39 2025 -0400
@@ -2,10 +2,6 @@
 /* ------------------------------------------------------------------------ */
 /* simple benchmark for getting the min/max range of an audio sample. */
 
-/* prevent GCC from optimizing these function calls away - i think there's
- * probably a better way to do this, but I haven't found it yet :) */
-
-
 extern void test_benchmark_sample_minmax_simple_impl(int16_t *smpl, uint32_t length, int32_t *pmin, int32_t *pmax);
 extern void test_benchmark_sample_minmax_vec_impl(int16_t *smpl, uint32_t length, int32_t *pmin, int32_t *pmax);
 
@@ -14,19 +10,19 @@
 	int32_t min, max;
 	clock_t start, end;
 	int i;
-	int16_t *q = vec_malloc(16000000u * 2u);
+	int16_t *q = vec_malloc(16000001u * 2u);
 
-	printf("\nsigned 16-bit audio sample min/max - 1 thousand passes - 16000000 samples\n\n");
+	printf("\nsigned 16-bit audio sample min/max - 1 thousand passes - 16000001 samples\n\n");
 
 	/* generate random sample values */
-	for (i = 0; i < 16000000; i++)
+	for (i = 0; i < 16000001; i++)
 		q[i] = rand();
 
 	start = clock();
 	for (i = 0; i < 1000; i++) {
 		min = INT32_MAX;
 		max = INT32_MIN;
-		test_benchmark_sample_minmax_vec_impl(q, 16000000u, &min, &max);
+		test_benchmark_sample_minmax_vec_impl(q, 16000001u, &min, &max);
 	}
 	end = clock();
 
@@ -36,7 +32,7 @@
 	for (i = 0; i < 1000; i++) {
 		min = INT32_MAX;
 		max = INT32_MIN;
-		test_benchmark_sample_minmax_simple_impl(q, 16000000u, &min, &max);
+		test_benchmark_sample_minmax_simple_impl(q, 16000001u, &min, &max);
 	}
 	end = clock();