From dd06152f82a267c50ada27a13a1b854a7509ac65 Mon Sep 17 00:00:00 2001 From: davidwendt Date: Wed, 9 Feb 2022 16:22:20 -0500 Subject: [PATCH] Fix out-of-memory error in UrlDecode benchmark --- cpp/benchmarks/string/url_decode.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/cpp/benchmarks/string/url_decode.cpp b/cpp/benchmarks/string/url_decode.cpp index 4dc77cffa1a..6dc79c44437 100644 --- a/cpp/benchmarks/string/url_decode.cpp +++ b/cpp/benchmarks/string/url_decode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,8 +70,7 @@ cudf::test::strings_column_wrapper generate_column(cudf::size_type num_rows, class UrlDecode : public cudf::benchmark { }; -template -void BM_url_decode(benchmark::State& state) +void BM_url_decode(benchmark::State& state, int esc_seq_pct) { cudf::size_type const num_rows = state.range(0); cudf::size_type const chars_per_row = state.range(1); @@ -88,12 +87,14 @@ void BM_url_decode(benchmark::State& state) (chars_per_row + sizeof(cudf::size_type))); } -#define URLD_BENCHMARK_DEFINE(esc_seq_pct) \ - TEMPLATED_BENCHMARK_F(UrlDecode, BM_url_decode, esc_seq_pct) \ - ->Args({100000000, 10}) \ - ->Args({10000000, 100}) \ - ->Args({1000000, 1000}) \ - ->Unit(benchmark::kMillisecond) \ +#define URLD_BENCHMARK_DEFINE(esc_seq_pct) \ + BENCHMARK_DEFINE_F(UrlDecode, esc_seq_pct) \ + (::benchmark::State & st) { BM_url_decode(st, esc_seq_pct); } \ + BENCHMARK_REGISTER_F(UrlDecode, esc_seq_pct) \ + ->Args({100000000, 10}) \ + ->Args({10000000, 100}) \ + ->Args({1000000, 1000}) \ + ->Unit(benchmark::kMillisecond) \ ->UseManualTime(); URLD_BENCHMARK_DEFINE(10)