Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Try to fix win
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed Jul 28, 2022
1 parent 921885f commit a87316b
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion test/test_block_reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void Initialize(
if (i == 0)
h_reference[0] = h_in[0];
else
h_reference[0] = reduction_op(h_reference[0], h_in[i]);
h_reference[0] = static_cast<T>(reduction_op(h_reference[0], h_in[i]));
}

if (g_verbose)
Expand Down
16 changes: 8 additions & 8 deletions test/test_block_scan.cu
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct WrapperFunctor
template <typename T>
__host__ __device__ __forceinline__ T operator()(const T &a, const T &b) const
{
return op(a, b);
return static_cast<T>(op(a, b));
}
};

Expand Down Expand Up @@ -463,14 +463,14 @@ T Initialize(

T block_aggregate = h_in[0];
h_reference[0] = initial_value;
T inclusive = scan_op(initial_value, h_in[0]);
T inclusive = static_cast<T>(scan_op(initial_value, h_in[0]));

for (int i = 1; i < num_items; ++i)
{
InitValue(gen_mode, h_in[i], i);
h_reference[i] = inclusive;
inclusive = scan_op(inclusive, h_in[i]);
block_aggregate = scan_op(block_aggregate, h_in[i]);
inclusive = static_cast<T>(scan_op(inclusive, h_in[i]));
block_aggregate = static_cast<T>(scan_op(block_aggregate, h_in[i]));
}

return block_aggregate;
Expand All @@ -493,14 +493,14 @@ T Initialize(
InitValue(gen_mode, h_in[0], 0);

T block_aggregate = h_in[0];
T inclusive = scan_op(initial_value, h_in[0]);
T inclusive = static_cast<T>(scan_op(initial_value, h_in[0]));
h_reference[0] = inclusive;

for (int i = 1; i < num_items; ++i)
{
InitValue(gen_mode, h_in[i], i);
inclusive = scan_op(inclusive, h_in[i]);
block_aggregate = scan_op(block_aggregate, h_in[i]);
inclusive = static_cast<T>(scan_op(inclusive, h_in[i]));
block_aggregate = static_cast<T>(scan_op(block_aggregate, h_in[i]));
h_reference[i] = inclusive;
}

Expand Down Expand Up @@ -616,7 +616,7 @@ void Test(
{
// Copy out and display updated prefix
printf("\tScan running total: ");
T running_total = scan_op(initial_value, block_aggregate);
T running_total = static_cast<T>(scan_op(initial_value, block_aggregate));
compare = CompareDeviceResults(&running_total, d_out + TILE_SIZE, 1, g_verbose, g_verbose);
printf("%s\n", compare ? "FAIL" : "PASS");
AssertEquals(0, compare);
Expand Down
2 changes: 1 addition & 1 deletion test/test_device_reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ struct Solution<cub::Sum, InputT, _OutputT>
InitValue(INTEGER_SEED, aggregate, 0);
for (int j = h_segment_begin_offsets[i]; j < h_segment_end_offsets[i]; ++j)
aggregate = reduction_op(aggregate, h_in[j]);
h_reference[i] = aggregate;
h_reference[i] = static_cast<OutputT>(aggregate);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion test/test_device_reduce_by_key.cu
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ int Solve(
}
else
{
aggregate = reduction_op(aggregate, h_values_in[i]);
aggregate = static_cast<ValueT>(reduction_op(aggregate, h_values_in[i]));
}
previous = h_keys_in[i];
}
Expand Down
8 changes: 4 additions & 4 deletions test/test_device_scan.cu
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct WrapperFunctor
template <typename T>
__host__ __device__ __forceinline__ T operator()(const T &a, const T &b) const
{
return op(a, b);
return static_cast<T>(op(a, b));
}
};

Expand Down Expand Up @@ -518,13 +518,13 @@ void Solve(
{
AccumT val = static_cast<AccumT>(h_in[0]);
h_reference[0] = initial_value;
AccumT inclusive = scan_op(initial_value, val);
AccumT inclusive = static_cast<AccumT>(scan_op(initial_value, val));

for (int i = 1; i < num_items; ++i)
{
val = static_cast<AccumT>(h_in[i]);
h_reference[i] = static_cast<OutputT>(inclusive);
inclusive = scan_op(inclusive, val);
inclusive = static_cast<AccumT>(scan_op(inclusive, val));
}
}
}
Expand Down Expand Up @@ -556,7 +556,7 @@ void Solve(
for (int i = 1; i < num_items; ++i)
{
AccumT val = h_in[i];
inclusive = scan_op(inclusive, val);
inclusive = static_cast<AccumT>(scan_op(inclusive, val));
h_reference[i] = static_cast<OutputT>(inclusive);
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/test_device_scan_by_key.cu
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct WrapperFunctor
template <typename T>
__host__ __device__ __forceinline__ T operator()(const T &a, const T &b) const
{
return op(a, b);
return static_cast<T>(op(a, b));
}
};

Expand Down Expand Up @@ -420,15 +420,15 @@ void Solve(
for (int i = 0; i < num_items;) {
AccumT val = static_cast<AccumT>(h_values_in[i]);
h_reference[i] = initial_value;
AccumT inclusive = scan_op(initial_value, val);
AccumT inclusive = static_cast<AccumT>(scan_op(initial_value, val));

++i;

for (; i < num_items && equality_op(h_keys_in[i - 1], h_keys_in[i]); ++i)
{
val = static_cast<AccumT>(h_values_in[i]);
h_reference[i] = static_cast<OutputT>(inclusive);
inclusive = scan_op(inclusive, val);
inclusive = static_cast<AccumT>(scan_op(inclusive, val));
}
}
}
Expand Down Expand Up @@ -468,7 +468,7 @@ void Solve(
for (; i < num_items && equality_op(h_keys_in[i - 1], h_keys_in[i]); ++i)
{
AccumT val = h_values_in[i];
inclusive = scan_op(inclusive, val);
inclusive = static_cast<AccumT>(scan_op(inclusive, val));
h_reference[i] = static_cast<OutputT>(inclusive);
}
}
Expand Down
6 changes: 3 additions & 3 deletions test/test_warp_reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct WrapperFunctor
}
));

return op(a, b);
return static_cast<T>(op(a, b));
}

};
Expand Down Expand Up @@ -444,7 +444,7 @@ void Initialize(
}
else
{
head_aggregate = reduction_op(head_aggregate, h_in[item_offset]);
head_aggregate = static_cast<T>(reduction_op(head_aggregate, h_in[item_offset]));
}

if (h_flags[item_offset])
Expand All @@ -455,7 +455,7 @@ void Initialize(
}
else
{
tail_aggregate = reduction_op(tail_aggregate, h_in[item_offset]);
tail_aggregate = static_cast<T>(reduction_op(tail_aggregate, h_in[item_offset]));
}

item_offset--;
Expand Down
12 changes: 6 additions & 6 deletions test/test_warp_scan.cu
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct WrapperFunctor
template <typename T>
__host__ __device__ __forceinline__ T operator()(const T &a, const T &b) const
{
return op(a, b);
return static_cast<T>(op(a, b));
}
};

Expand Down Expand Up @@ -329,14 +329,14 @@ void Initialize(

T warp_aggregate = h_in[i];
h_reference[i] = initial_value;
T inclusive = scan_op(initial_value, h_in[i]);
T inclusive = static_cast<T>(scan_op(initial_value, h_in[i]));

for (i = i + 1; i < base_idx + logical_warp_items; ++i)
{
InitValue(gen_mode, h_in[i], i);
h_reference[i] = inclusive;
inclusive = scan_op(inclusive, h_in[i]);
warp_aggregate = scan_op(warp_aggregate, h_in[i]);
inclusive = static_cast<T>(scan_op(inclusive, h_in[i]));
warp_aggregate = static_cast<T>(scan_op(warp_aggregate, h_in[i]));
}

warp_aggregates[w] = warp_aggregate;
Expand Down Expand Up @@ -374,8 +374,8 @@ void Initialize(
for (i = i + 1; i < base_idx + logical_warp_items; ++i)
{
InitValue(gen_mode, h_in[i], i);
inclusive = scan_op(inclusive, h_in[i]);
warp_aggregate = scan_op(warp_aggregate, h_in[i]);
inclusive = static_cast<T>(scan_op(inclusive, h_in[i]));
warp_aggregate = static_cast<T>(scan_op(warp_aggregate, h_in[i]));
h_reference[i] = inclusive;
}

Expand Down

0 comments on commit a87316b

Please sign in to comment.