Skip to content

Commit 4bd5690

Browse files
committed
Fix warnings on clang.
1 parent 4defa02 commit 4bd5690

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

examples/custom_iteration_spaces.cu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
void copy_sweep_grid_shape(nvbench::state &state)
3434
{
3535
// Get current parameters:
36-
const int block_size = static_cast<int>(state.get_int64("BlockSize"));
37-
const int num_blocks = static_cast<int>(state.get_int64("NumBlocks"));
36+
const auto block_size = static_cast<unsigned int>(state.get_int64("BlockSize"));
37+
const auto num_blocks = static_cast<unsigned int>(state.get_int64("NumBlocks"));
3838

3939
// Number of int32s in 256 MiB:
4040
const std::size_t num_values = 256 * 1024 * 1024 / sizeof(nvbench::int32_t);
@@ -53,6 +53,7 @@ void copy_sweep_grid_shape(nvbench::state &state)
5353
num_values,
5454
in_ptr = thrust::raw_pointer_cast(in.data()),
5555
out_ptr = thrust::raw_pointer_cast(out.data())](nvbench::launch &launch) {
56+
(void)num_values; // clang thinks this is unused.
5657
nvbench::copy_kernel<<<num_blocks, block_size, 0, launch.get_stream()>>>(in_ptr,
5758
out_ptr,
5859
num_values);

nvbench/detail/axes_iterator.cuh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ struct axis_space_iterator
8383

8484
void update_indices(std::vector<axis_index> &indices) const
8585
{
86+
using diff_t = typename axes_info::difference_type;
8687
indices.insert(indices.end(), m_info.begin(), m_info.end());
8788
axes_info::iterator end = indices.end();
88-
axes_info::iterator start = end - m_info.size();
89+
axes_info::iterator start = end - static_cast<diff_t>(m_info.size());
8990
this->m_update(m_current_index, start, end);
9091
}
9192

0 commit comments

Comments
 (0)