From 14e6ffcc19a47e79325fcf18778c443473ed775b Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Mon, 19 Jun 2023 02:05:56 +0800 Subject: feat(exp): Add a argument in test Signed-off-by: KunoiSayami --- expt_0618_3.cu | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'expt_0618_3.cu') diff --git a/expt_0618_3.cu b/expt_0618_3.cu index 4558f54..15af8f1 100644 --- a/expt_0618_3.cu +++ b/expt_0618_3.cu @@ -84,7 +84,8 @@ int main(int argc, char const *argv[]) { printf("sample length: %ld, population length: %ld\n", sample_length, population_length); - ReadHelper readHelper("normal_distribution.txt", sample_length, 0); + ReadHelper readHelper("normal_distribution.txt", sample_length, + population_length); readHelper.readFile(); std::vector sample, population; @@ -96,17 +97,18 @@ int main(int argc, char const *argv[]) { auto sort = CustomSort(sample_length, sizeof(key_type) * 8); - for (auto element : readHelper.population_vector) { + for (auto element : population) { auto ret = sort.sample_cdf_custom_version(sample.data(), element); auto cdf_index = ret / scale_size; auto index = trailing_zeroes((size_t)cdf_index); result[index]++; } - if (!multiple_times) + if (!multiple_times) { generateRandomLevel(result2, population_length); - else + } else { multiple_generate(result2, population_length); + } for (int i = 0; i < 32; i++) { if (!result[i] && !result2[i]) { -- cgit v1.3.1