Skip to content

Add .as_slice_memory_order(), improve scalar_sum, and fix bugs in from_vec_dim_stride #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 13, 2016

Conversation

bluss
Copy link
Member

@bluss bluss commented Mar 12, 2016

  • Add .as_slice_memory_order(), .as_slice_memory_order_mut()
  • Fix bugs in from_vec_dim_stride that relate to axes of length 0 or 1.
  • Misc bonus changes: Add Send + Sync to NdFloat, Improve Display for ShapeError.

Part of #138
Fixes #58
Fixes #144

Using cargo-benchcmp to review performance changes

The true improvement here is assign scalar for the transposed (f-order) case and scalar_sum should improve the same way. Most important was though to validate that there are no perf regressions. Everything looks like it's the same or within error.

name                               assign_scalar_before2 ns/iter  assign_scalar_after2 ns/iter    diff ns/iter   diff %
assign_scalar_2d_cutout            1,640                          1,687                                     47    2.87%
assign_scalar_2d_large             1,595                          1,593                                     -2   -0.13%
assign_scalar_2d_transposed_large  3,618                          1,644                                 -1,974  -54.56%
name                       add_before3 ns/iter  add_after2 ns/iter    diff ns/iter   diff %
add_2d_0_to_2_iadd_scalar  476                  399                            -77  -16.18%
add_2d_assign_ops          626                  616                            -10   -1.60%
add_2d_broadcast_0_to_2    476                  400                            -76  -15.97%
add_2d_broadcast_1_to_2    646                  652                              6    0.93%
add_2d_cutout              1,254                1,257                            3    0.24%
add_2d_f32_regular         632                  637                              5    0.79%
add_2d_regular             625                  628                              3    0.48%
add_2d_transposed          3,341                2,906                         -435  -13.02%
muladd_2d_f32_regular      699                  700                              1    0.14%
name                        scalar_sum_before4 ns/iter  scalar_sum_after5 ns/iter    diff ns/iter  diff %
scalar_sum_2d_cutout        745                         732                                   -13  -1.74%
scalar_sum_2d_float         570                         578                                     8   1.40%
scalar_sum_2d_float_cutout  839                         838                                    -1  -0.12%
scalar_sum_2d_regular       251                         253                                     2   0.80%

@bluss
Copy link
Member Author

bluss commented Mar 12, 2016

@SuperFluffy the ordering agnostic version of as_slice() makes its appearance here.

@bluss bluss force-pushed the no-order branch 2 times, most recently from e49aace to 3edea96 Compare March 13, 2016 17:09
@bluss bluss changed the title Improve scalar_sum and unordered_foreach_mut for contiguous arrays Add .as_slice_any_order(), improve scalar_sum, and fix bugs in from_vec_dim_stride Mar 13, 2016
@bluss bluss force-pushed the no-order branch 2 times, most recently from 5b36868 to 462829b Compare March 13, 2016 17:52
@bluss bluss changed the title Add .as_slice_any_order(), improve scalar_sum, and fix bugs in from_vec_dim_stride Add .as_slice_memory_order(), improve scalar_sum, and fix bugs in from_vec_dim_stride Mar 13, 2016
bluss added a commit that referenced this pull request Mar 13, 2016
Add .as_slice_memory_order(), improve scalar_sum, and fix bugs in from_vec_dim_stride
@bluss bluss merged commit b660e0f into master Mar 13, 2016
@bluss bluss deleted the no-order branch March 13, 2016 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant