summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/tensor
diff options
context:
space:
mode:
authorArne H Juul <arnej27959@users.noreply.github.com>2021-02-16 13:30:33 +0100
committerGitHub <noreply@github.com>2021-02-16 13:30:33 +0100
commit0399c7f2cf9b75253e91a88e899bab82c36040dd (patch)
tree107c021de2a26f8cc077b304075812af3165a8cd /searchlib/src/tests/tensor
parente355514ed46658e015aff3f933101281ae23e8c1 (diff)
parenta29aa609abab633f01a19a7e7576be444a38328e (diff)
Merge pull request #16495 from vespa-engine/arnej/add-size-literals
add literals for sizes in KB, MB, and GB
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();
}