summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/tensor
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-02-15 13:54:49 +0000
committerArne Juul <arnej@verizonmedia.com>2021-02-15 14:16:21 +0000
commit805a313df05d2f347af321511527e06ea3cae92c (patch)
tree7e06fbd1c2d5ababf3d219ddb6c4b0cf9525aea9 /searchlib/src/tests/tensor
parentc0b8734987176a93588909739af143c6b0a1a6ff (diff)
use size literals in searchlib
Diffstat (limited to 'searchlib/src/tests/tensor')
-rw-r--r--searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp b/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp
index 8790df5a140..8e3bb95a776 100644
--- a/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp
+++ b/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp
@@ -22,6 +22,7 @@
#include <vespa/vespalib/util/blockingthreadstackexecutor.h>
#include <vespa/vespalib/util/generationhandler.h>
#include <vespa/vespalib/util/lambdatask.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <vespa/vespalib/data/simple_buffer.h>
#include <vespa/log/log.h>
@@ -59,7 +60,7 @@ struct MallocPointVector {
};
static MallocPointVector *aligned_alloc_pv(size_t num) {
size_t num_bytes = num * sizeof(MallocPointVector);
- double mega_bytes = num_bytes / (1024.0*1024.0);
+ double mega_bytes = num_bytes / double(1_Mi);
fprintf(stderr, "allocate %.2f MB of vectors\n", mega_bytes);
char *mem = (char *)malloc(num_bytes + 512);
mem += 512;
@@ -221,8 +222,8 @@ public:
vectors(),
gen_handler(),
index(),
- multi_prepare_workers(10, 128*1024, 50),
- write_thread(1, 128*1024, 500)
+ multi_prepare_workers(10, 128_Ki, 50),
+ write_thread(1, 128_Ki, 500)
{
loaded_vectors.load();
}