We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3643260 commit bbe1ec0Copy full SHA for bbe1ec0
1 file changed
c++11_cuda/c++11_cuda.cu
@@ -52,9 +52,7 @@ void xyzw_frequency_thrust_device(int *count, char *text, int n)
52
{
53
const char letters[] { 'x','y','z','w' };
54
55
- auto ptext = thrust::device_pointer_cast(text);
56
-
57
- *count = thrust::count_if(thrust::device, ptext, ptext+n, [&](char c) {
+ *count = thrust::count_if(thrust::device, text, text+n, [&](char c) {
58
for (const auto x : letters)
59
if (c == x) return true;
60
return false;
@@ -99,8 +97,8 @@ int main(int argc, char** argv)
99
97
cudaMemset(d_count, 0, sizeof(int));
100
98
101
// Try uncommenting one kernel call at a time
102
- xyzw_frequency<<<8, 256>>>(d_count, d_text, len);
103
- //xyzw_frequency_thrust_device<<<1, 1>>>(d_count, d_text, len);
+ //xyzw_frequency<<<8, 256>>>(d_count, d_text, len);
+ xyzw_frequency_thrust_device<<<1, 1>>>(d_count, d_text, len);
104
cudaMemcpy(&count, d_count, sizeof(int), cudaMemcpyDeviceToHost);
105
106
//xyzw_frequency_thrust_host(&count, h_text, len);
0 commit comments