Skip to content

Commit

Permalink
Move tpch examples into benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
JayjeetAtGithub committed Aug 26, 2024
1 parent f511322 commit d2d01d6
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 63 deletions.
8 changes: 8 additions & 0 deletions cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ ConfigureBench(TRANSPOSE_BENCH transpose/transpose.cpp)
# * apply_boolean_mask benchmark ------------------------------------------------------------------
ConfigureBench(APPLY_BOOLEAN_MASK_BENCH stream_compaction/apply_boolean_mask.cpp)

# ##################################################################################################
# * tpch benchmark --------------------------------------------------------------------------------
ConfigureBench(TPCH_Q1 tpch/q1.cpp)
ConfigureBench(TPCH_Q5 tpch/q5.cpp)
ConfigureBench(TPCH_Q6 tpch/q6.cpp)
ConfigureBench(TPCH_Q9 tpch/q9.cpp)
ConfigureBench(TPCH_Q10 tpch/q10.cpp)

# ##################################################################################################
# * stream_compaction benchmark -------------------------------------------------------------------
ConfigureNVBench(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions cpp/examples/tpch/q1.cpp → cpp/benchmarks/tpch/q1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include "../utilities/timer.hpp"
#include "utils.hpp"

#include <cudf/ast/expressions.hpp>
Expand Down Expand Up @@ -108,8 +107,6 @@ int main(int argc, char const** argv)
auto resource = create_memory_resource(args.memory_resource_type);
rmm::mr::set_current_device_resource(resource.get());

cudf::examples::timer timer;

// Define the column projections and filter predicate for `lineitem` table
std::vector<std::string> const lineitem_cols = {"l_returnflag",
"l_linestatus",
Expand Down Expand Up @@ -166,8 +163,6 @@ int main(int argc, char const** argv)
{"l_returnflag", "l_linestatus"},
{cudf::order::ASCENDING, cudf::order::ASCENDING});

timer.print_elapsed_millis();

// Write query result to a parquet file
orderedby_table->to_parquet("q1.parquet");
return 0;
Expand Down
5 changes: 0 additions & 5 deletions cpp/examples/tpch/q10.cpp → cpp/benchmarks/tpch/q10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include "../utilities/timer.hpp"
#include "utils.hpp"

#include <cudf/ast/expressions.hpp>
Expand Down Expand Up @@ -97,8 +96,6 @@ int main(int argc, char const** argv)
auto resource = create_memory_resource(args.memory_resource_type);
rmm::mr::set_current_device_resource(resource.get());

cudf::examples::timer timer;

// Define the column projection and filter predicate for the `orders` table
std::vector<std::string> const orders_cols = {"o_custkey", "o_orderkey", "o_orderdate"};
auto const o_orderdate_ref = cudf::ast::column_reference(std::distance(
Expand Down Expand Up @@ -158,8 +155,6 @@ int main(int argc, char const** argv)
auto const orderedby_table =
apply_orderby(groupedby_table, {"revenue"}, {cudf::order::DESCENDING});

timer.print_elapsed_millis();

// Write query result to a parquet file
orderedby_table->to_parquet("q10.parquet");
return 0;
Expand Down
5 changes: 0 additions & 5 deletions cpp/examples/tpch/q5.cpp → cpp/benchmarks/tpch/q5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include "../utilities/timer.hpp"
#include "utils.hpp"

#include <cudf/ast/expressions.hpp>
Expand Down Expand Up @@ -93,8 +92,6 @@ int main(int argc, char const** argv)
auto resource = create_memory_resource(args.memory_resource_type);
rmm::mr::set_current_device_resource(resource.get());

cudf::examples::timer timer;

// Define the column projection and filter predicate for the `orders` table
std::vector<std::string> const orders_cols = {"o_custkey", "o_orderkey", "o_orderdate"};
auto const o_orderdate_ref = cudf::ast::column_reference(std::distance(
Expand Down Expand Up @@ -161,8 +158,6 @@ int main(int argc, char const** argv)
auto const orderedby_table =
apply_orderby(groupedby_table, {"revenue"}, {cudf::order::DESCENDING});

timer.print_elapsed_millis();

// Write query result to a parquet file
orderedby_table->to_parquet("q5.parquet");
return 0;
Expand Down
5 changes: 0 additions & 5 deletions cpp/examples/tpch/q6.cpp → cpp/benchmarks/tpch/q6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include "../utilities/timer.hpp"
#include "utils.hpp"

#include <cudf/ast/expressions.hpp>
Expand Down Expand Up @@ -67,8 +66,6 @@ int main(int argc, char const** argv)
auto resource = create_memory_resource(args.memory_resource_type);
rmm::mr::set_current_device_resource(resource.get());

cudf::examples::timer timer;

// Read out the `lineitem` table from parquet file
std::vector<std::string> const lineitem_cols = {
"l_extendedprice", "l_discount", "l_shipdate", "l_quantity"};
Expand Down Expand Up @@ -129,8 +126,6 @@ int main(int argc, char const** argv)
auto const revenue_view = revenue->view();
auto const result_table = apply_reduction(revenue_view, cudf::aggregation::Kind::SUM, "revenue");

timer.print_elapsed_millis();

// Write query result to a parquet file
result_table->to_parquet("q6.parquet");
return 0;
Expand Down
5 changes: 0 additions & 5 deletions cpp/examples/tpch/q9.cpp → cpp/benchmarks/tpch/q9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include "../utilities/timer.hpp"
#include "utils.hpp"

#include <cudf/column/column.hpp>
Expand Down Expand Up @@ -116,8 +115,6 @@ int main(int argc, char const** argv)
auto resource = create_memory_resource(args.memory_resource_type);
rmm::mr::set_current_device_resource(resource.get());

cudf::examples::timer timer;

// Read out the table from parquet files
auto const lineitem = read_parquet(
args.dataset_dir + "/lineitem.parquet",
Expand Down Expand Up @@ -174,8 +171,6 @@ int main(int argc, char const** argv)
auto const orderedby_table = apply_orderby(
groupedby_table, {"nation", "o_year"}, {cudf::order::ASCENDING, cudf::order::DESCENDING});

timer.print_elapsed_millis();

// Write query result to a parquet file
orderedby_table->to_parquet("q9.parquet");
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ struct groupby_context_t {
}
auto agg_results = groupby_obj.aggregate(requests);
std::vector<std::unique_ptr<cudf::column>> result_columns;
for (size_t i = 0; i < agg_results.first->num_columns(); i++) {
for (auto i = 0; i < agg_results.first->num_columns(); i++) {
auto col = std::make_unique<cudf::column>(agg_results.first->get_column(i));
result_columns.push_back(std::move(col));
}
Expand Down
1 change: 0 additions & 1 deletion cpp/examples/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ build_example() {
}

build_example basic
build_example tpch
build_example strings
build_example nested_types
build_example parquet_io
Expand Down
36 changes: 0 additions & 36 deletions cpp/examples/tpch/CMakeLists.txt

This file was deleted.

0 comments on commit d2d01d6

Please sign in to comment.