summaryrefslogtreecommitdiff
path: root/expt_0618_3.cu
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2023-06-19 02:05:56 +0800
committerKunoiSayami <[email protected]>2023-06-19 02:05:56 +0800
commit14e6ffcc19a47e79325fcf18778c443473ed775b (patch)
treef1ffcc196dfee009c2687bc00177a96b5ce73941 /expt_0618_3.cu
parent813049a3ff85b18bc1ca6f640c7677c8bbf39414 (diff)
feat(exp): Add a argument in test
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'expt_0618_3.cu')
-rw-r--r--expt_0618_3.cu10
1 files changed, 6 insertions, 4 deletions
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<key_type> readHelper("normal_distribution.txt", sample_length, 0);
+ ReadHelper<key_type> readHelper("normal_distribution.txt", sample_length,
+ population_length);
readHelper.readFile();
std::vector<key_type> 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]) {