2
votes
1answer
41 views

CUDA: How does Thrust manage memory when using a Comparator in a sorting function?

I have a char array of 10 characters that I would like to pass as an argument to a comparator which will be used by Thrust's sorting function. In order to allocate memory for this array I use ...
2
votes
1answer
59 views

Is it possible to deallocate memory for the N last elements of a thrust::device_vector without using resize?

I'm using a device_vector in order to store information about an array of user input data. This information is necessary in order to speed things up when I call the second kernel, which runs the main ...
0
votes
1answer
138 views

CUDA and Thrust library: Trouble with using .cuh .cu and .cpp files together with -std=c++0x

I want to have a .cuh file where I can declare kernel functions and host functions as well. The implementation of these functions will be made inside the .cu file. The implementation will include the ...
0
votes
2answers
169 views

CUDA Thrust: reduce_by_key on only some values in an array, based off values in a “key” array

Let's say I have two device_vector<byte> arrays, d_keys and d_data. If d_data is, for example, a flattened 2D 3x5 array ( e.g. { 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3 } ) and d_keys is a ...