From 2116f5055fd044fd79f36b346044817d827d7651 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 5 Feb 2019 11:36:31 -0500 Subject: use omp for init-kmeans, increase default set size (kmeans-c4-1e5 real: ~20s) --- src/km-init-kmeans.c | 1 + src/main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/km-init-kmeans.c b/src/km-init-kmeans.c index f0c1b5f..b2a24af 100644 --- a/src/km-init-kmeans.c +++ b/src/km-init-kmeans.c @@ -13,6 +13,7 @@ sum_distance_squared( float r = 0; // sum squared distances + #pragma omp parallel for reduction(+:r) for (size_t i = 0; i < set->num_rows; i++) { const float * const vals = km_set_get_row(set, i); r += distance_squared(set->shape.num_floats, floats, vals); diff --git a/src/main.c b/src/main.c index bc8c1f1..386af16 100644 --- a/src/main.c +++ b/src/main.c @@ -92,7 +92,7 @@ load_on_shape( // D("shape: %zu floats, %zu ints", shape->num_floats, shape->num_ints); // init set - if (!km_set_init(set, shape, 100)) { + if (!km_set_init(set, shape, 1000)) { die("km_set_init() failed"); } -- cgit v1.2.3