Skip to content
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

Fix value range overflows in tests #3022

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions thrust/testing/for_each.cu
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void TestForEach(const size_t n)
{
const size_t output_size = std::min((size_t) 10, 2 * n);

thrust::host_vector<T> h_input = unittest::random_integers<T>(n);
thrust::host_vector<T> h_input = unittest::random_integers<size_t>(n);

for (size_t i = 0; i < n; i++)
{
Expand Down Expand Up @@ -199,7 +199,7 @@ void TestForEachN(const size_t n)
{
const size_t output_size = std::min((size_t) 10, 2 * n);

thrust::host_vector<T> h_input = unittest::random_integers<T>(n);
thrust::host_vector<T> h_input = unittest::random_integers<size_t>(n);

for (size_t i = 0; i < n; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion thrust/testing/set_difference.cu
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetDifferenceEquivalentRanges);
template <typename T>
void TestSetDifferenceMultiset(const size_t n)
{
thrust::host_vector<T> vec = unittest::random_integers<T>(2 * n);
thrust::host_vector<T> vec = unittest::random_integers<int>(2 * n);

// restrict elements to [min,13)
for (typename thrust::host_vector<T>::iterator i = vec.begin(); i != vec.end(); ++i)
Expand Down
2 changes: 1 addition & 1 deletion thrust/testing/set_difference_by_key.cu
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetDifferenceByKeyEquivalentRanges);
template <typename T>
void TestSetDifferenceByKeyMultiset(const size_t n)
{
thrust::host_vector<T> vec = unittest::random_integers<T>(2 * n);
thrust::host_vector<T> vec = unittest::random_integers<int>(2 * n);

// restrict elements to [min,13)
for (typename thrust::host_vector<T>::iterator i = vec.begin(); i != vec.end(); ++i)
Expand Down
2 changes: 1 addition & 1 deletion thrust/testing/set_intersection.cu
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetIntersectionEquivalentRanges);
template <typename T>
void TestSetIntersectionMultiset(const size_t n)
{
thrust::host_vector<T> vec = unittest::random_integers<T>(2 * n);
thrust::host_vector<T> vec = unittest::random_integers<int>(2 * n);

// restrict elements to [min,13)
for (typename thrust::host_vector<T>::iterator i = vec.begin(); i != vec.end(); ++i)
Expand Down
2 changes: 1 addition & 1 deletion thrust/testing/set_intersection_by_key.cu
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetIntersectionByKeyEquivalentRanges);
template <typename T>
void TestSetIntersectionByKeyMultiset(const size_t n)
{
thrust::host_vector<T> vec = unittest::random_integers<T>(2 * n);
thrust::host_vector<T> vec = unittest::random_integers<int>(2 * n);

// restrict elements to [min,13)
for (typename thrust::host_vector<T>::iterator i = vec.begin(); i != vec.end(); ++i)
Expand Down
2 changes: 1 addition & 1 deletion thrust/testing/set_symmetric_difference.cu
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetSymmetricDifferenceEquivalentRanges);
template <typename T>
void TestSetSymmetricDifferenceMultiset(const size_t n)
{
thrust::host_vector<T> vec = unittest::random_integers<T>(2 * n);
thrust::host_vector<T> vec = unittest::random_integers<int>(2 * n);

// restrict elements to [min,13)
for (typename thrust::host_vector<T>::iterator i = vec.begin(); i != vec.end(); ++i)
Expand Down
2 changes: 1 addition & 1 deletion thrust/testing/set_symmetric_difference_by_key.cu
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetSymmetricDifferenceByKeyEquivalentRanges);
template <typename T>
void TestSetSymmetricDifferenceByKeyMultiset(const size_t n)
{
thrust::host_vector<T> vec = unittest::random_integers<T>(2 * n);
thrust::host_vector<T> vec = unittest::random_integers<int>(2 * n);

// restrict elements to [min,13)
for (typename thrust::host_vector<T>::iterator i = vec.begin(); i != vec.end(); ++i)
Expand Down
2 changes: 1 addition & 1 deletion thrust/testing/set_union_by_key.cu
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetUnionByKeyEquivalentRanges);
template <typename T>
void TestSetUnionByKeyMultiset(const size_t n)
{
thrust::host_vector<T> vec = unittest::random_integers<T>(2 * n);
thrust::host_vector<T> vec = unittest::random_integers<int>(2 * n);

// restrict elements to [min,13)
for (typename thrust::host_vector<T>::iterator i = vec.begin(); i != vec.end(); ++i)
Expand Down
Loading