@@ -48,17 +48,15 @@ void copy_sweep_grid_shape(nvbench::state &state)
4848 thrust::device_vector<nvbench::int32_t > in (num_values, 0 );
4949 thrust::device_vector<nvbench::int32_t > out (num_values, 0 );
5050
51- state.exec (
52- [block_size,
53- num_blocks,
54- num_values,
55- in_ptr = thrust::raw_pointer_cast (in.data ()),
56- out_ptr = thrust::raw_pointer_cast (out.data ())](nvbench::launch &launch) {
57- nvbench::copy_kernel<<<num_blocks, block_size, 0 , launch.get_stream()>>> (
58- in_ptr,
59- out_ptr,
60- num_values);
61- });
51+ state.exec ([block_size,
52+ num_blocks,
53+ num_values,
54+ in_ptr = thrust::raw_pointer_cast (in.data ()),
55+ out_ptr = thrust::raw_pointer_cast (out.data ())](nvbench::launch &launch) {
56+ nvbench::copy_kernel<<<num_blocks, block_size, 0 , launch.get_stream()>>> (in_ptr,
57+ out_ptr,
58+ num_values);
59+ });
6260}
6361
6462// ==============================================================================
@@ -100,8 +98,7 @@ struct under_diag final : nvbench::user_axis_space
10098 nvbench::detail::axis_space_iterator do_get_iterator (axes_info info) const
10199 {
102100 // generate our increment function
103- auto adv_func = [&, info](std::size_t &inc_index,
104- std::size_t /* len*/ ) -> bool {
101+ auto adv_func = [&, info](std::size_t &inc_index, std::size_t /* len*/ ) -> bool {
105102 inc_index++;
106103 x_pos++;
107104 if (x_pos == info[0 ].size )
@@ -114,19 +111,15 @@ struct under_diag final : nvbench::user_axis_space
114111 };
115112
116113 // our update function
117- auto diag_under =
118- [&, info](std::size_t ,
119- std::vector<nvbench::detail::axis_index>::iterator start,
120- std::vector<nvbench::detail::axis_index>::iterator end) {
121- start->index = x_pos;
122- end->index = y_pos;
123- };
114+ auto diag_under = [&, info](std::size_t ,
115+ std::vector<nvbench::detail::axis_index>::iterator start,
116+ std::vector<nvbench::detail::axis_index>::iterator end) {
117+ start->index = x_pos;
118+ end->index = y_pos;
119+ };
124120
125121 const size_t iteration_length = ((info[0 ].size * (info[1 ].size + 1 )) / 2 );
126- return nvbench::detail::axis_space_iterator (info,
127- iteration_length,
128- adv_func,
129- diag_under);
122+ return nvbench::detail::axis_space_iterator (info, iteration_length, adv_func, diag_under);
130123 }
131124
132125 std::size_t do_get_size (const axes_info &info) const
@@ -184,29 +177,20 @@ struct gauss final : nvbench::user_axis_space
184177 }
185178
186179 // our update function
187- auto gauss_func =
188- [=](std::size_t index,
189- std::vector<nvbench::detail::axis_index>::iterator start,
190- std::vector<nvbench::detail::axis_index>::iterator) {
191- start->index = gauss_indices[index];
192- };
193-
194- return nvbench::detail::axis_space_iterator (info,
195- iteration_length,
196- gauss_func);
180+ auto gauss_func = [=](std::size_t index,
181+ std::vector<nvbench::detail::axis_index>::iterator start,
182+ std::vector<nvbench::detail::axis_index>::iterator) {
183+ start->index = gauss_indices[index];
184+ };
185+
186+ return nvbench::detail::axis_space_iterator (info, iteration_length, gauss_func);
197187 }
198188
199189 std::size_t do_get_size (const axes_info &info) const { return info[0 ].size ; }
200190
201- std::size_t do_get_active_count (const axes_info &info) const
202- {
203- return info[0 ].size ;
204- }
191+ std::size_t do_get_active_count (const axes_info &info) const { return info[0 ].size ; }
205192
206- std::unique_ptr<iteration_space_base> do_clone () const
207- {
208- return std::make_unique<gauss>(*this );
209- }
193+ std::unique_ptr<iteration_space_base> do_clone () const { return std::make_unique<gauss>(*this ); }
210194};
211195// ==============================================================================
212196// Dual parameter sweep:
@@ -216,8 +200,7 @@ void dual_float64_axis(nvbench::state &state)
216200 const auto duration_B = state.get_float64 (" Duration_B" );
217201
218202 state.exec ([duration_A, duration_B](nvbench::launch &launch) {
219- nvbench::sleep_kernel<<<1 , 1 , 0 , launch.get_stream()>>> (duration_A +
220- duration_B);
203+ nvbench::sleep_kernel<<<1 , 1 , 0 , launch.get_stream()>>> (duration_A + duration_B);
221204 });
222205}
223206NVBENCH_BENCH (dual_float64_axis)
0 commit comments