Skip to content

Commit a25f578

Browse files
committed
Rename tie_axes to zip_axes
1 parent 344878e commit a25f578

File tree

8 files changed

+42
-41
lines changed

8 files changed

+42
-41
lines changed

docs/benchmarks.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ using output_types = nvbench::type_list<float, double>;
260260
NVBENCH_BENCH_TYPES(benchmark, NVBENCH_TYPE_AXES(input_types, output_types))
261261
.set_type_axes_names({"InputType", "OutputType"})
262262
.add_int64_axis("NumInputs", {1000, 10000, 100000, 200000, 200000, 200000})
263-
.add_float64_axis("Quality", {0.05, 0.1, 0.25, 0.5, 0.75, 1.});
263+
.add_float64_axis("Quality", {0.05, 0.1, 0.25, 0.5, 0.75, 1.})
264+
.zip_axes({"NumInputs", "Quality"});
264265
```
265266
266267
This tieing reduces the total combinations from 24 to 6, reducing the

examples/custom_iteration_spaces.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ NVBENCH_BENCH(tied_copy_sweep_grid_shape)
7474
// Every power of two from 64->1024:
7575
.add_int64_axis("BlockSize", {32,64,128,256})
7676
.add_int64_axis("NumBlocks", {1024,512,256,128})
77-
.tie_axes({"BlockSize", "NumBlocks"});
77+
.zip_axes({"BlockSize", "NumBlocks"});
7878

7979
//==============================================================================
8080
// under_diag:

nvbench/axes_metadata.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct axes_metadata
6262

6363
void add_string_axis(std::string name, std::vector<std::string> data);
6464

65-
void tie_axes(std::vector<std::string> names);
65+
void zip_axes(std::vector<std::string> names);
6666

6767
void
6868
user_iteration_axes(std::vector<std::string> names,

nvbench/axes_metadata.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ void reset_iteration_space(
238238
}
239239
} // namespace
240240

241-
void axes_metadata::tie_axes(std::vector<std::string> names)
241+
void axes_metadata::zip_axes(std::vector<std::string> names)
242242
{
243243
NVBENCH_THROW_IF((names.size() < 2),
244244
std::runtime_error,
245245
"At least two axi names ( {} provided ) need to be provided "
246-
"when using tie_axes.",
246+
"when using zip_axes.",
247247
names.size());
248248

249249
// compute the numeric indice for each name we have
@@ -269,7 +269,7 @@ void axes_metadata::tie_axes(std::vector<std::string> names)
269269
reset_iteration_space(m_value_space, input_indices);
270270

271271
// add the new tied iteration space
272-
auto tied = std::make_unique<tie_axis_space>(std::move(input_indices),
272+
auto tied = std::make_unique<zip_axis_space>(std::move(input_indices),
273273
std::move(output_indices));
274274
m_value_space.push_back(std::move(tied));
275275
}

nvbench/axis_iteration_space.cuh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ struct linear_axis_space final : axis_space_base
6767
std::size_t do_valid_count(const axes_info &info) const override;
6868
};
6969

70-
struct tie_axis_space final : axis_space_base
70+
struct zip_axis_space final : axis_space_base
7171
{
72-
tie_axis_space(std::vector<std::size_t> input_indices,
72+
zip_axis_space(std::vector<std::size_t> input_indices,
7373
std::vector<std::size_t> output_indices);
74-
~tie_axis_space();
74+
~zip_axis_space();
7575

7676
std::unique_ptr<axis_space_base> do_clone() const override;
7777
detail::axis_space_iterator do_iter(axes_info info) const override;

nvbench/axis_iteration_space.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ std::unique_ptr<axis_space_base> linear_axis_space::do_clone() const
127127
return std::make_unique<linear_axis_space>(*this);
128128
}
129129

130-
tie_axis_space::tie_axis_space(std::vector<std::size_t> input_indices,
130+
zip_axis_space::zip_axis_space(std::vector<std::size_t> input_indices,
131131
std::vector<std::size_t> output_indices)
132132
: axis_space_base(std::move(input_indices), std::move(output_indices))
133133
{}
134134

135-
tie_axis_space::~tie_axis_space() = default;
135+
zip_axis_space::~zip_axis_space() = default;
136136

137-
detail::axis_space_iterator tie_axis_space::do_iter(axes_info info) const
137+
detail::axis_space_iterator zip_axis_space::do_iter(axes_info info) const
138138
{
139139
std::vector<std::size_t> locs = m_output_indices;
140140
auto update_func = [=](std::size_t inc_index,
@@ -150,19 +150,19 @@ detail::axis_space_iterator tie_axis_space::do_iter(axes_info info) const
150150
return detail::make_space_iterator(locs.size(), info[0].size, update_func);
151151
}
152152

153-
std::size_t tie_axis_space::do_size(const axes_info &info) const
153+
std::size_t zip_axis_space::do_size(const axes_info &info) const
154154
{
155155
return info[0].size;
156156
}
157157

158-
std::size_t tie_axis_space::do_valid_count(const axes_info &info) const
158+
std::size_t zip_axis_space::do_valid_count(const axes_info &info) const
159159
{
160160
return info[0].active_size;
161161
}
162162

163-
std::unique_ptr<axis_space_base> tie_axis_space::do_clone() const
163+
std::unique_ptr<axis_space_base> zip_axis_space::do_clone() const
164164
{
165-
return std::make_unique<tie_axis_space>(*this);
165+
return std::make_unique<zip_axis_space>(*this);
166166
}
167167

168168
user_axis_space::user_axis_space(std::vector<std::size_t> input_indices,

nvbench/benchmark_base.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ struct benchmark_base
111111
return *this;
112112
}
113113

114-
benchmark_base &tie_axes(std::vector<std::string> names)
114+
benchmark_base &zip_axes(std::vector<std::string> names)
115115
{
116-
m_axes.tie_axes(std::move(names));
116+
m_axes.zip_axes(std::move(names));
117117
return *this;
118118
}
119119

testing/axes_iteration_space.cu

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ void template_no_op_generator(nvbench::state &state,
7777
NVBENCH_DEFINE_CALLABLE_TEMPLATE(template_no_op_generator,
7878
template_no_op_callable);
7979

80-
void test_tie_axes()
80+
void test_zip_axes()
8181
{
8282
using benchmark_type = nvbench::benchmark<no_op_callable>;
8383
benchmark_type bench;
8484
bench.add_float64_axis("F64 Axis", {0., .1, .25, .5, 1.});
8585
bench.add_int64_axis("I64 Axis", {1, 3, 2, 4, 5});
86-
bench.tie_axes({"F64 Axis", "I64 Axis"});
86+
bench.zip_axes({"F64 Axis", "I64 Axis"});
8787

8888
ASSERT_MSG(bench.get_config_count() == 5 * bench.get_devices().size(),
8989
"Got {}",
@@ -97,10 +97,10 @@ void test_tie_invalid_names()
9797
bench.add_float64_axis("F64 Axis", {0., .1, .25, .5, 1.});
9898
bench.add_int64_axis("I64 Axis", {1, 3, 2});
9999

100-
ASSERT_THROWS_ANY(bench.tie_axes({"F32 Axis", "I64 Axis"}));
101-
ASSERT_THROWS_ANY(bench.tie_axes({"F32 Axis"}));
102-
ASSERT_THROWS_ANY(bench.tie_axes({""}));
103-
ASSERT_THROWS_ANY(bench.tie_axes(std::vector<std::string>()));
100+
ASSERT_THROWS_ANY(bench.zip_axes({"F32 Axis", "I64 Axis"}));
101+
ASSERT_THROWS_ANY(bench.zip_axes({"F32 Axis"}));
102+
ASSERT_THROWS_ANY(bench.zip_axes({""}));
103+
ASSERT_THROWS_ANY(bench.zip_axes(std::vector<std::string>()));
104104
}
105105

106106
void test_tie_unequal_length()
@@ -110,8 +110,8 @@ void test_tie_unequal_length()
110110
bench.add_float64_axis("F64 Axis", {0., .1, .25, .5, 1.});
111111
bench.add_int64_axis("I64 Axis", {1, 3, 2});
112112

113-
bench.tie_axes({"I64 Axis", "F64 Axis"});
114-
ASSERT_THROWS_ANY(bench.tie_axes({"F64 Axis", "I64 Axis"}));
113+
bench.zip_axes({"I64 Axis", "F64 Axis"});
114+
ASSERT_THROWS_ANY(bench.zip_axes({"F64 Axis", "I64 Axis"}));
115115
}
116116

117117
void test_tie_type_axi()
@@ -126,10 +126,10 @@ void test_tie_type_axi()
126126
bench.add_float64_axis("F64 Axis", {0., .1, .25, .5, 1.});
127127
bench.add_int64_axis("I64 Axis", {1, 3, 2});
128128

129-
ASSERT_THROWS_ANY(bench.tie_axes({"F64 Axis", "Float"}));
129+
ASSERT_THROWS_ANY(bench.zip_axes({"F64 Axis", "Float"}));
130130
}
131131

132-
void test_retie_axes()
132+
void test_rezip_axes()
133133
{
134134
using benchmark_type = nvbench::benchmark<no_op_callable>;
135135
benchmark_type bench;
@@ -142,20 +142,20 @@ void test_retie_axes()
142142
.1,
143143
});
144144

145-
bench.tie_axes({"FAxis_5", "IAxis_A"});
146-
bench.tie_axes({"IAxis_B", "FAxis_5", "IAxis_A"}); // re-tie
145+
bench.zip_axes({"FAxis_5", "IAxis_A"});
146+
bench.zip_axes({"IAxis_B", "FAxis_5", "IAxis_A"}); // re-tie
147147

148148
ASSERT_MSG(bench.get_config_count() == 10 * bench.get_devices().size(),
149149
"Got {}",
150150
bench.get_config_count());
151151

152-
bench.tie_axes({"FAxis_5", "IAxis_A"});
152+
bench.zip_axes({"FAxis_5", "IAxis_A"});
153153
ASSERT_MSG(bench.get_config_count() == 50 * bench.get_devices().size(),
154154
"Got {}",
155155
bench.get_config_count());
156156
}
157157

158-
void test_retie_axes2()
158+
void test_rezip_axes2()
159159
{
160160
using benchmark_type = nvbench::benchmark<no_op_callable>;
161161
benchmark_type bench;
@@ -170,17 +170,17 @@ void test_retie_axes2()
170170
.1,
171171
});
172172

173-
bench.tie_axes({"IAxis_A", "IAxis_B", "IAxis_C"});
174-
bench.tie_axes({"FAxis_1", "FAxis_2"});
175-
bench.tie_axes(
173+
bench.zip_axes({"IAxis_A", "IAxis_B", "IAxis_C"});
174+
bench.zip_axes({"FAxis_1", "FAxis_2"});
175+
bench.zip_axes(
176176
{"IAxis_A", "IAxis_B", "IAxis_C", "FAxis_1", "FAxis_2"}); // re-tie
177177

178178
ASSERT_MSG(bench.get_config_count() == 10 * bench.get_devices().size(),
179179
"Got {}",
180180
bench.get_config_count());
181181

182-
bench.tie_axes({"IAxis_A", "IAxis_B", "IAxis_C"});
183-
bench.tie_axes({"FAxis_1", "FAxis_2"});
182+
bench.zip_axes({"IAxis_A", "IAxis_B", "IAxis_C"});
183+
bench.zip_axes({"FAxis_1", "FAxis_2"});
184184
ASSERT_MSG(bench.get_config_count() == 50 * bench.get_devices().size(),
185185
"Got {}",
186186
bench.get_config_count());
@@ -195,7 +195,7 @@ void test_tie_clone()
195195
bench.add_int64_power_of_two_axis("I64 POT Axis", {10, 20});
196196
bench.add_int64_axis("I64 Axis", {10, 20});
197197
bench.add_float64_axis("F64 Axis", {0., .1, .25});
198-
bench.tie_axes({"F64 Axis", "Strings"});
198+
bench.zip_axes({"F64 Axis", "Strings"});
199199

200200
const auto expected_count = bench.get_config_count();
201201

@@ -316,11 +316,11 @@ void test_user_axes()
316316

317317
int main()
318318
{
319-
test_tie_axes();
319+
test_zip_axes();
320320
test_tie_invalid_names();
321321
test_tie_unequal_length();
322322
test_tie_type_axi();
323-
test_retie_axes();
324-
test_retie_axes2();
323+
test_rezip_axes();
324+
test_rezip_axes2();
325325
test_tie_clone();
326326
}

0 commit comments

Comments
 (0)