-
Notifications
You must be signed in to change notification settings - Fork 385
modernize-use-auto #8459
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
modernize-use-auto #8459
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ static void even(nvbench::state& state, nvbench::type_list<SampleT, CounterT, Of | |
| } | ||
|
|
||
| const SampleT lower_level_r = 0; | ||
| const SampleT upper_level_r = get_upper_level<SampleT>(num_bins, elements); | ||
| const auto upper_level_r = get_upper_level<SampleT>(num_bins, elements); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am against this one, it breaks alignnment
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if I made them all const SampleT lower_level_r = 0;
// to
const auto lower_level_r = SamepleT{0};I can silence them with
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could enforce variable alignment 😁 https://clang.llvm.org/docs/ClangFormatStyleOptions.html#alignconsecutivedeclarations |
||
| const SampleT lower_level_g = lower_level_r; | ||
| const SampleT upper_level_g = upper_level_r; | ||
| const SampleT lower_level_b = lower_level_g; | ||
|
|
@@ -80,7 +80,7 @@ static void even(nvbench::state& state, nvbench::type_list<SampleT, CounterT, Of | |
| std::size_t temp_storage_bytes{}; | ||
|
|
||
| cuda::std::bool_constant<sizeof(SampleT) == 1> is_byte_sample; | ||
| OffsetT num_row_pixels = static_cast<OffsetT>(elements); | ||
| auto num_row_pixels = static_cast<OffsetT>(elements); | ||
| OffsetT num_rows = 1; | ||
| OffsetT row_stride_samples = num_row_pixels; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,7 @@ static void range(nvbench::state& state, nvbench::type_list<SampleT, CounterT, O | |
| const int num_levels_b = num_levels_g; | ||
|
|
||
| const SampleT lower_level = 0; | ||
| const SampleT upper_level = get_upper_level<SampleT>(num_bins, elements); | ||
| const auto upper_level = get_upper_level<SampleT>(num_bins, elements); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those also break alignment |
||
|
|
||
| SampleT step = (upper_level - lower_level) / num_bins; | ||
| thrust::device_vector<SampleT> levels_r(num_bins + 1); | ||
|
|
@@ -80,7 +80,7 @@ static void range(nvbench::state& state, nvbench::type_list<SampleT, CounterT, O | |
| std::size_t temp_storage_bytes{}; | ||
|
|
||
| cuda::std::bool_constant<sizeof(SampleT) == 1> is_byte_sample; | ||
| OffsetT num_row_pixels = static_cast<OffsetT>(elements); | ||
| auto num_row_pixels = static_cast<OffsetT>(elements); | ||
| OffsetT num_rows = 1; | ||
| OffsetT row_stride_samples = num_row_pixels; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -387,7 +387,7 @@ private: | |
| ::cuda::std::bool_constant<KEYS_ONLY> is_keys_only, | ||
| DecomposerT decomposer = {}) | ||
| { | ||
| bit_ordered_type(&unsigned_keys)[ItemsPerThread] = reinterpret_cast<bit_ordered_type(&)[ItemsPerThread]>(keys); | ||
| auto(&unsigned_keys)[ItemsPerThread] = reinterpret_cast<bit_ordered_type(&)[ItemsPerThread]>(keys); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remark: haven't seen a reinterpretation as a reference to an array in a long time |
||
|
|
||
| _CCCL_PRAGMA_UNROLL_FULL() | ||
| for (int KEY = 0; KEY < ItemsPerThread; KEY++) | ||
|
|
@@ -466,7 +466,7 @@ public: | |
| ::cuda::std::bool_constant<KEYS_ONLY> is_keys_only, | ||
| DecomposerT decomposer = {}) | ||
| { | ||
| bit_ordered_type(&unsigned_keys)[ItemsPerThread] = reinterpret_cast<bit_ordered_type(&)[ItemsPerThread]>(keys); | ||
| auto(&unsigned_keys)[ItemsPerThread] = reinterpret_cast<bit_ordered_type(&)[ItemsPerThread]>(keys); | ||
|
|
||
| _CCCL_PRAGMA_UNROLL_FULL() | ||
| for (int KEY = 0; KEY < ItemsPerThread; KEY++) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto breaks alignment