Skip to content
Open
3 changes: 2 additions & 1 deletion groupby/perfect_groupby.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ void PerfectGroupBy::_run(const size_t buf_size, Meter &meter) {
h.single_task<class clean>([=]() {
for (size_t i = 0; i < groups_count * threads_count; i++) {
ht_v[i] = 0;
o[i] = 0;
if (i < groups_count)
o[i] = 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the logic behind this one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we want to clear all output from previous iteration using single_task
However, groups_count * threads_count may be bigger than output array size, so we need to control it to prevent SEGFAULT
This is not so clear, I wanted to do it in one for loop, but is it better to separate this two operations into two single_tasks?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess no big difference since it's a single task

}
});
}).wait();
Expand Down
3 changes: 2 additions & 1 deletion tests/dwarf_tests/dwarf_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ GENERATE_TEST_SUITE(ReduceDPCPP);
GENERATE_TEST_SUITE(HashBuild);
GENERATE_TEST_SUITE(NestedLoopJoin);
GENERATE_TEST_SUITE(CuckooHashBuild);
GENERATE_TEST_SUITE_GROUPBY(GroupBy);
GENERATE_TEST_SUITE_GROUPBY(GroupByGlobal);
GENERATE_TEST_SUITE_GROUPBY(PerfectGroupBy);
GENERATE_TEST_SUITE_GROUPBY(GroupByLocal);
GENERATE_TEST_SUITE(Join);
GENERATE_TEST_SUITE(HashBuildNonBitmask);
Expand Down
4 changes: 3 additions & 1 deletion tests/dwarf_tests/dwarfs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

#include "constant/constant.hpp"
#include "groupby/groupby.hpp"
#include "groupby/groupby_global.hpp"
#include "groupby/groupby_local.hpp"
#include "groupby/perfect_groupby.hpp"
#include "hash/cuckoo_hash_build.hpp"
#include "hash/hash_build.hpp"
#include "hash/hash_build_non_bitmask.hpp"
Expand All @@ -15,4 +17,4 @@
#include "reduce/reduce.hpp"
#include "scan/scan.hpp"
#include "sort/radix.hpp"
#include "sort/tbbsort.hpp"
#include "sort/tbbsort.hpp"
8 changes: 4 additions & 4 deletions tests/dwarf_tests/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ std::unique_ptr<RunOptions> get_cpu_test_opts(size_t size) {
}

std::unique_ptr<RunOptions> get_cpu_test_opts_groupby(size_t size) {
return std::make_unique<GroupByRunOptions>(*get_cpu_test_opts(size), 64,
1024);
return std::make_unique<GroupByRunOptions>(*get_cpu_test_opts(size), 64, 1024,
32);
}

std::unique_ptr<RunOptions> get_gpu_test_opts_groupby(size_t size) {
return std::make_unique<GroupByRunOptions>(*get_gpu_test_opts(size), 64,
1024);
return std::make_unique<GroupByRunOptions>(*get_gpu_test_opts(size), 64, 1024,
32);
}

std::string get_kernels_root_tests() {
Expand Down