We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 306bec0 commit 926ea8dCopy full SHA for 926ea8d
1 file changed
testing/count.cu
@@ -116,3 +116,22 @@ void TestCountDispatchImplicit()
116
}
117
DECLARE_UNITTEST(TestCountDispatchImplicit);
118
119
+void TestCountWithBigIndexesHelper(int magnitude)
120
+{
121
+ thrust::counting_iterator<long long> begin(1);
122
+ thrust::counting_iterator<long long> end = begin + (1ll << magnitude);
123
+ ASSERT_EQUAL(thrust::distance(begin, end), 1ll << magnitude);
124
+
125
+ long long result = thrust::count(thrust::device, begin, end, (1ll << magnitude) - 17);
126
127
+ ASSERT_EQUAL(result, 1);
128
+}
129
130
+void TestCountWithBigIndexes()
131
132
+ TestCountWithBigIndexesHelper(30);
133
+ TestCountWithBigIndexesHelper(31);
134
+ TestCountWithBigIndexesHelper(32);
135
+ TestCountWithBigIndexesHelper(33);
136
137
+DECLARE_UNITTEST(TestCountWithBigIndexes);
0 commit comments