Skip to content

Commit 0eabd46

Browse files
committed
tests : fix UB in test-quantize-perf
1 parent 43bbfb7 commit 0eabd46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test-quantize-perf.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static void * align_with_offset(void * ptr, int offset) {
7676
return (char *) std::align(MAX_ALIGNMENT, MAX_ALIGNMENT, ptr, dummy_size) + offset;
7777
}
7878

79-
static void benchmark_function(size_t size, size_t q_size, int64_t iterations, const std::function<size_t(void)> & function) {
79+
static void benchmark_function(size_t size, size_t q_size, int64_t iterations, const std::function<float(void)> & function) {
8080
int64_t min_time_us = INT64_MAX;
8181
int64_t total_time_us = 0;
8282
int64_t min_time_cycles = INT64_MAX;
@@ -283,7 +283,7 @@ int main(int argc, char * argv[]) {
283283
printf(" quantize_row_q_reference\n");
284284
for (size_t size : params.test_sizes) {
285285
printf(" %zu values (%.2f MB)\n", size, 4*size/(float)(1024*1024));
286-
auto quantize_fn = [&](void ) {
286+
auto quantize_fn = [&](void) -> float {
287287
qfns.from_float_reference(test_data1, test_q1, size);
288288
return test_q1[0];
289289
};

0 commit comments

Comments
 (0)